Code Monkey home page Code Monkey logo

etfsite's Introduction

ETF Converter

For a live demo, please visit https://etfconverter.herokuapp.com/. There is also a GIF loop of the demo file included in this README.

This app is meant for personal/project use only and the live demo is not secure.

ETF Converter is a simple site which takes csv input from a user's Yahoo Finance data, and returns underlying ETF holdings and the resulting overall exposure to individual companies.

It's written using Flask in python3, and primarily uses pandas and asynchronous webscraping (grequests, Beautiful soup) to convert user input. Front end is HTML with some Jinja and the CSS is mainly from Pure-CSS.

Demo

Installation

Download all of the files and folders from Github and add it to a new project path. Use the package manager pip to install the required libraries outlined in requirements.txt. Make sure that the folder structure is kept consistent between the package downloaded from Github and your project path. If planning to run locally, uncomment out the python # tags on app.py indicating local use and comment out the Heroku ones.

$ pip install -r requirements.txt

Usage

To launch this site locally, run app.py and navigate to your local host address. In another tab, log into your Yahoo Finance account and open the portfolio containing ETFs that you are looking to analyze. Download this portfolio as a .csv file and save it somewhere on your CPU. Go back to local host, and use the drag 'n drop upload box to upload the csv data to the server. Wait a moment (Larger portfolios will take longer to analyze) and the sript will execute. A new page will load returning a table view with a breakdown of the data which was received, and a download link to the results. Click on the 'Download' button to download the results as a .csv to your CPU.

$ py app.py
http://127.0.0.1:5000/

Alternatively, you can also use the demo site provided, however, file uploads are not secure!

*There is already a quotes.csv file added to the project folder to use as a demo file. For actual use, delete this demo file and replace it with the quotes.csv downloaded from your Yahoo Finance portfolio. This .csv file can be anywhere on your computer, it doesn't need to stay in the project folder.

Limitations

This script only works for portfolios containing US and Canadian equitities traded on the major exchanges. This means that it will only work with ETFs and individual stocks, not things like precious metals, cash equivalents, or mutual funds etc. Also, only the top 25 holdings from each ETF can be pulled, so any remaining value will be added back to the original ETF ticker name with a 'Misc' notation added. If ycharts changes their site structure, the script will break.

Contributing

Feel free to take this template and edit it however you would like. I would love to hear about any improvements you make!

License

MIT Free Usage

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.