Module to create custom, interactive stock portfolio tree maps. Pulls data from Yahoo! Finance.
Project description
stock_treemap
Generate tree maps for stock portfolios using Python, Yahoo Finance, and Plotly. This code is meant to be run within a Jupyter environment. More details of requirements are further below.
You will need to create a CSV file that has 2 columns: ticker and stocks. The ticker column should contain the stock ticker symbols for each stock you own. The shares column should contain the number of shares that you own. An example is shown below:
aapl,10
amd,10
amzn,10
gbtc,10```
If this file is called 'example.csv', then you can create a tree map as follows:
```from stock_treemap import stock_treemap, update_sectors
stock_treemap('example.csv')
A static example of the output is shown below: ~Example tree map created by stock_treemap()
Requirements
Requires
-
yfinance
-
tqdm
-
numpy
-
pandas
-
plotly
-
Plotly requires plug-ins to work properly in Jupyter environments. See https://plotly.com/python/getting-started/
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for stock_treemap-1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | acdcced7d6ea63178aa6651c873809e10cd8fd7efc86de927c5ea1f8bad6ee35 |
|
MD5 | 0d4bab54f295510f4ee538eff26587dd |
|
BLAKE2b-256 | 15527ec7852b00f1381bc7200de54043d09d6e7f65a21b58d4dff060eeb1c986 |