Skip to main content

Tool for tracking of your investments and your actual portfolio

Project description

Stock summary tool

CREATE YOUR ENVIRONMENT

  1. Create virtual environment that you will use for the project and activate it (python3.8+ required):
python3 -m venv my_venv/
source my_venv/bin/activate
  1. Install the package:
pip3 install stock_summary_tool
  1. Generate and save your token:
    1. Register or log in to the page.
    2. Go to https://rapidapi.com/ and register.
    3. Subscribe to these APIs and obtain your API key:
      1. https://rapidapi.com/sparior/api/yahoo-finance15
      2. https://rapidapi.com/fixer/api/fixer-currency
    4. Save your key for the project:
    stock_summary_tool save-token <YOUR_TOKEN>
    

DEMO

  1. You can download demo datasets and import them:
    stock_summary_tool import-data -y -e <PATH_TO_DEMO_ENTRIES> -p <PATH_TO_DEMO_PORTFOLIO)
    
  2. You can generate-html (it should open automatically in your browser):
    stock_summary_tool generate-html
    
  3. You can update your portoflio by actual cost and generate again HTML page:
    stock_summary_tool generate-portfolio
    stock_summary_tool generate-html
    

CREATE YOUR PORTFOLIO

  1. Refresh data to empty files:
    stock_summary_tool import-data -y --rewrite
    
  2. Add your entries (example) - stock symbol, date, count of stocks, price (sell entries are also supported, just add '-' sign before count):
    stock_summary_tool add-entry -s BOTZ.MI -d 12/01/2023 -c 20 -p 30
    
  3. You can enter also your dividends (amount is in original currency):
    stock_summary_tool add-dividend -s BOTZ.MI -d 12/01/2023 -a 10 
    
  4. After you add your entries and dividends, generate actual portfolio and HTML:
    stock_summary_tool generate-portfolio
    stock_summary_tool generate-html
    
  5. You can also export your data and share them across multiple systems (by importing them again):
    stock_summary_tool export-data -d <DIRECTORY_FOR_EXPORT>
    

HTML tutorial

You can open example summary stock_summary/demo_datasets/index.html Right now, there is supported only czech language and CZK currency is taken as base.

You can see plot with your actual investments in stocks, and also your profit (generated from portfolio file). Below you can see your actual holdings and statistics about them. Only actual holdings with >0 count are shown. The last table is for dividends.

Rules about generating portfolio and balance

  1. Entries are converted to the base currency with conversion rate for the execution day.
  2. Dividends are converted to the base currency with conversion rate for the execution day.
  3. Value of your portfolio for the current day is counted as sum of your holdings for the day. (converted to base currency)
  4. Profit is comparison of your invested amount with dividends and your actual holdings. If you sell some stocks, profit stays same, only value of your portfolio goes down. Same with buy entries (portfolio up, profit stays same). If you get some dividends, it grows your profit by that amount.
  5. ONCE AGAIN: All amounts are automatically converted to base currency by exchange rate of the execution day. It doesn't matter if you convert them or not. Right now it's out of scope of the tool.

Plans for the future

  1. Adding option for fees to the operations.
  2. Supporting more languages and base currencies.
  3. Adding backward possibility to generate portfolio and no need to generate it manually anymore (blocked by higher number of API calls and subscription)
  4. Support for cloud storage (easy setup and option to use tool across more systems without manual import/export)
  5. Adding option to track other investments except stocks/cryptocurrencies/dividends.

Be free to open issue or ask me, if you want to know something or you want to help with the project.

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

stock_summary_tool-0.1.1.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stock_summary_tool-0.1.1-py3-none-any.whl (1.1 MB view details)

Uploaded Python 3

File details

Details for the file stock_summary_tool-0.1.1.tar.gz.

File metadata

  • Download URL: stock_summary_tool-0.1.1.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.10.6 Linux/5.15.0-1031-azure

File hashes

Hashes for stock_summary_tool-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0d2c5a0a923082adf2e6528916b7304b241c11204f8c5057053082c889309e0d
MD5 5dcc86e01951e94013f960b0b8ead03c
BLAKE2b-256 dad56f4df1b2ae867226169d658573613ce9c785abf7bdf8fc2413691578081d

See more details on using hashes here.

File details

Details for the file stock_summary_tool-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: stock_summary_tool-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.10.6 Linux/5.15.0-1031-azure

File hashes

Hashes for stock_summary_tool-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1aed7f06dd4b4a52d43f2464f50ce29cb6e717353f426707ad2ffdd4081a1694
MD5 7753fa09ecdcaca24df463615e4bba61
BLAKE2b-256 fa325db96b0f5bc2408696196daf8af01cb5464759cba73bee10726495797219

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page