stonky is a simple command line dashboard for monitoring stocks.

Overview

pypi unittest licence style black

📈 stonky

stonky is a simple command line dashboard for monitoring stocks. It pulls live data from Yahoo! Finance so anything it can support, e.g. international exchanges, cryptocurrencies, etc., stonky can too.

screenshot

Installing and Upgrading

$ pip3 install --user --upgrade stonky

Config

stonky is mainly configured through a config file. By default it looks for and loads a file named .stonky.cfg in your home directory. You can also specify a custom path by passing the --config= command line argument which can be useful to monitor multiple watchlists. If you run stonky without a config file it will load the example one by default.

Arguments

You can also set or override many of stonky's settings via command-line arguments.

usage: stonky [-h] [--config PATH] [--currency CODE] [--refresh SECONDS] [--sort FIELD]

optional arguments:
  -h, --help         show this help message and exit
  --config PATH      sets path to config file
  --currency CODE    converts all amounts using current forex rates
  --refresh SECONDS  refreshes output on set interval
  --sort FIELD       orders stocks by field

FIELDS can be one of amount, amount_desc, ticket, ticket_desc, change, change_desc, volume, volume_desc.

Contributions

Community contributions are a welcome addition to the project. In order to be merged upsteam any additions will need to be formatted with black for consistency with the rest of the project and pass the continuous integration tests run against the PR. Before introducing any major features or changes to the configuration api please consider opening an issue to outline your proposal.

Bug reports are also welcome on the issue page. Please include any generated crash reports if applicable. Feature requests are welcome but consider checking out if it is in the works first to avoid duplication.

Comments
  • Install Questions

    Install Questions

    More of a user issue, but having trouble configuring my .stonky.cfg file. It keeps loading the example. What are the install steps as far as setup.py build/install?

    question / problem 
    opened by m-a-c-k 3
  • Integration of Bitpanda

    Integration of Bitpanda

    Stonky is really useful but a disadvantage is that it only supports Yahoo. For me it would be great if there would also be a support for Bitpanda. I wanted to ask if this would be a possible new feature of stonky if I start working at it.

    question / problem 
    opened by MMartin09 2
  • Mutual Funds Error

    Mutual Funds Error

    There appears to be some issue when pulling Mutual Fund information. I tried the follow 3 Mutual Funds (HBLFX, JSGTX, JNBZX) and received an error, listed below. I validated that all 3 are available in the Yahoo Finance site. All other stocks I entered work perfectly fine.

    ============================== CRASH REPORT BEGIN ==============================

    --------------------------------- environment ----------------------------------

    • date = 2020-07-25
    • platform = Windows-10-10.0.18362-SP0
    • arguments = []
    • python version = 3.8.5
    • stonky version = 1.0.1
    • teletype version = 1.1.0

    --------------------------------- stack trace ----------------------------------

    Traceback (most recent call last): File "C:\Users\user1\AppData\Roaming\Python\Python38\site-packages\stonky_main_.py", line 12, in main stock_store = StockStore(api, settings) File "C:\Users\user1\AppData\Roaming\Python\Python38\site-packages\stonky\stock_store.py", line 15, in init self.update_stocks() File "C:\Users\user1\AppData\Roaming\Python\Python38\site-packages\stonky\stock_store.py", line 27, in update_stocks self._stocks = { File "C:\Users\user1\AppData\Roaming\Python\Python38\site-packages\stonky\stock_store.py", line 28, in ticket: self.api.get_quote(ticket) File "C:\Users\user1\AppData\Roaming\Python\Python38\site-packages\stonky\api.py", line 28, in get_quote volume=summary_data["volume"]["raw"], KeyError: 'raw'

    =============================== CRASH REPORT END ===============================

    bug 
    opened by billdriver 2
  • Add configuration section for average price

    Add configuration section for average price

    Hi,

    Would it be possible to add a config section that you can write the average price that you bought your share holdings onto (so that you can see how much your P/L is overall)? Something along these lines in .stonky.cfg:

    [avg_price]
    AMZN=2367.92
    VGRO.TO=24.81
    BTC-USD=11.983.70
    

    It won't take into account dividends etc. but it's still good as a guide and I'd personally find it very useful. If this is something that you'd like, I can add make a pull request for it myself?

    This is a great and super useful project; thanks a lot!

    request wont do 
    opened by kumar-ish 2
  • ECB is not Forex prices

    ECB is not Forex prices

    https://github.com/jkwill87/stonky/blob/d603280936876b337ec8a772fc2cdc202b62f832/stonky/api.py#L58-L59

    Hello, API exchangeratesapi.io did not provide forex prices, they provide only ECB exchange rates, you should find another API source.

    question / problem request 
    opened by arzzen 1
  • Stonky Crashes on start

    Stonky Crashes on start

    I'll preface this by saying that I'm a beginner with Python and programming in general.

    But I don't know if I'm missing something, but it crashes every time I start it. Any help or clarification would be appreciated!

    ============================== CRASH REPORT BEGIN ==============================

    --------------------------------- environment ----------------------------------

    • date = 2021-07-26
    • platform = Windows-10-10.0.19042-SP0
    • arguments = ['--config', 'D:\Base\Projects\Software\Stonky\configuration.stonky.cfg']
    • python version = 3.9.6
    • stonky version = 1.3.3
    • teletype version = 1.1.0

    --------------------------------- stack trace ----------------------------------

    Traceback (most recent call last): File "C:\Users\clapf\AppData\Roaming\Python\Python39\site-packages\stonky_main_.py", line 13, in entrypoint loop.run_until_complete(main()) File "c:\users\clapf\pyversion\py396\lib\asyncio\base_events.py", line 642, in run_until_complete return future.result() File "C:\Users\clapf\AppData\Roaming\Python\Python39\site-packages\stonky_main_.py", line 33, in main await tty.draw() File "C:\Users\clapf\AppData\Roaming\Python\Python39\site-packages\stonky\tty.py", line 101, in draw await self.stock_store.update() File "C:\Users\clapf\AppData\Roaming\Python\Python39\site-packages\stonky\stock_store.py", line 24, in update await self._update_quotes() File "C:\Users\clapf\AppData\Roaming\Python\Python39\site-packages\stonky\stock_store.py", line 102, in _update_quotes stock.ticket: stock for stock in await asyncio.gather(*futures) File "C:\Users\clapf\AppData\Roaming\Python\Python39\site-packages\stonky\api.py", line 39, in get_quote summary_data = response["quoteSummary"]"result"][0][ KeyError: 'summaryDetail'

    =============================== CRASH REPORT END ===============================

    opened by EmberCN 0
  • Balance amount is multiplied times 2

    Balance amount is multiplied times 2

    Hi, I just found this project and I really like it! It is easy to use and configure. However, I found a little bug with a given config. So when I use this config the calculated balance is incorrect ( the cash is calculated twice in to the balance):

    [watchlist] APC.DE TL0.DE WDP.DE PLUN.DE AMD.DE DWNI.DE ASME.DE

    [positions] APC.DE=1

    [cash] EUR= 100 USD = 0

    [preferences] currency= EUR ; refresh= 1 ; sort= volume ;

    bug 
    opened by flamestro 0
  • Stonky crashes (Most likely due to proxy settings)

    Stonky crashes (Most likely due to proxy settings)

    Stack/Crashreport as requested:

    ============================== CRASH REPORT BEGIN ==============================
    
    --------------------------------- environment ----------------------------------
    
     - date = 2020-07-29
     - platform = Windows-10-10.0.17763-SP0
     - arguments = []
     - python version = 3.6.5
     - stonky version = 1.1.1
     - teletype version = 1.1.0
    
    --------------------------------- stack trace ----------------------------------
    
    Traceback (most recent call last):
      File "C:\Users\andreg\AppData\Roaming\Python\Python36\site-packages\aiohttp\connector.py", line 936, in _wrap_create_connection
        return await self._loop.create_connection(*args, **kwargs)  # type: ignore  # noqa
      File "c:\program files\python36\lib\asyncio\base_events.py", line 778, in create_connection
        raise exceptions[0]
      File "c:\program files\python36\lib\asyncio\base_events.py", line 765, in create_connection
        yield from self.sock_connect(sock, address)
      File "c:\program files\python36\lib\asyncio\selector_events.py", line 450, in sock_connect
        return (yield from fut)
      File "c:\program files\python36\lib\asyncio\selector_events.py", line 480, in _sock_connect_cb
        raise OSError(err, 'Connect call failed %s' % (address,))
    ConnectionRefusedError: [Errno 10061] Connect call failed ('87.248.118.23', 443)
    
    The above exception was the direct cause of the following exception:
    
    Traceback (most recent call last):
      File "C:\Users\andreg\AppData\Roaming\Python\Python36\site-packages\stonky\__main__.py", line 20, in main
        await stock_store.update_stocks()
      File "C:\Users\andreg\AppData\Roaming\Python\Python36\site-packages\stonky\stock_store.py", line 31, in update_stocks
        stock.ticket: stock for stock in await asyncio.gather(*futures)
      File "C:\Users\andreg\AppData\Roaming\Python\Python36\site-packages\stonky\api.py", line 27, in get_quote
        response = await self._query(url, params)
      File "C:\Users\andreg\AppData\Roaming\Python\Python36\site-packages\stonky\api.py", line 68, in _query
        async with self._session.get(url) as response:
      File "C:\Users\andreg\AppData\Roaming\Python\Python36\site-packages\aiohttp\client.py", line 1012, in __aenter__
        self._resp = await self._coro
      File "C:\Users\andreg\AppData\Roaming\Python\Python36\site-packages\aiohttp\client.py", line 483, in _request
        timeout=real_timeout
      File "C:\Users\andreg\AppData\Roaming\Python\Python36\site-packages\aiohttp\connector.py", line 523, in connect
        proto = await self._create_connection(req, traces, timeout)
      File "C:\Users\andreg\AppData\Roaming\Python\Python36\site-packages\aiohttp\connector.py", line 859, in _create_connection
        req, traces, timeout)
      File "C:\Users\andreg\AppData\Roaming\Python\Python36\site-packages\aiohttp\connector.py", line 1004, in _create_direct_connection
        raise last_exc
      File "C:\Users\andreg\AppData\Roaming\Python\Python36\site-packages\aiohttp\connector.py", line 986, in _create_direct_connection
        req=req, client_error=client_error)
      File "C:\Users\andreg\AppData\Roaming\Python\Python36\site-packages\aiohttp\connector.py", line 943, in _wrap_create_connection
        raise client_error(req.connection_key, exc) from exc
    aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host query1.finance.yahoo.com:443 ssl:default [Connect call failed ('87.248.118.23', 443)]
    
    =============================== CRASH REPORT END ===============================
    
    question / problem wont do 
    opened by AndreGosselink 0
  • new

    new

    My name is Luis, I'm a big-data machine-learning developer, I'm a fan of your work, and I usually check your updates.

    I was afraid that my savings would be eaten by inflation. I have created a powerful tool that based on past technical patterns (volatility, moving averages, statistics, trends, candlesticks, support and resistance, stock index indicators). All the ones you know (RSI, MACD, STOCH, Bolinger Bands, SMA, DEMARK, Japanese candlesticks, ichimoku, fibonacci, williansR, balance of power, murrey math, etc) and more than 200 others.

    The tool creates prediction models of correct trading points (buy signal and sell signal, every stock is good traded in time and direction). For this I have used big data tools like pandas python, stock market libraries like: tablib, TAcharts ,pandas_ta... For data collection and calculation. And powerful machine-learning libraries such as: Sklearn.RandomForest , Sklearn.GradientBoosting, XGBoost, Google TensorFlow and Google TensorFlow LSTM.

    With the models trained with the selection of the best technical indicators, the tool is able to predict trading points (where to buy, where to sell) and send real-time alerts to Telegram or Mail. The points are calculated based on the learning of the correct trading points of the last 2 years (including the change to bear market after the rate hike).

    I think it could be useful to you, to improve, I would like to share it with you, and if you are interested in improving and collaborating I am also willing, and if not file it in the box.

    If tou want, Please read the readme , and in case of any problem you can contact me , If you are convinced try to install it with the documentation. https://github.com/Leci37/LecTrade/tree/develop I appreciate the feedback

    opened by Leci37 0
  • Can't handle commodities futures

    Can't handle commodities futures

    When trying to add commodities such as brent oil "BZ=F" and "gold "GC=F" stonky seems to crash. I suspect it is the "=" sign that causes the crash.

    Traceback (most recent call last): File "/home/ptruong/anaconda3/envs/py38/lib/python3.8/site-packages/stonky/api.py", line 42, in get_quote currency=CurrencyType(price_data["currency"]),

    KeyError: 'currency'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last): File "/home/ptruong/anaconda3/envs/py38/lib/python3.8/site-packages/stonky/main.py", line 12, in entrypoint asyncio.run(main()) File "/home/ptruong/anaconda3/envs/py38/lib/python3.8/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/home/ptruong/anaconda3/envs/py38/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "/home/ptruong/anaconda3/envs/py38/lib/python3.8/site-packages/stonky/main.py", line 32, in main await tty.draw() File "/home/ptruong/anaconda3/envs/py38/lib/python3.8/site-packages/stonky/tty.py", line 101, in draw await self.stock_store.update() File "/home/ptruong/anaconda3/envs/py38/lib/python3.8/site-packages/stonky/stock_store.py", line 25, in update await self._update_quotes() File "/home/ptruong/anaconda3/envs/py38/lib/python3.8/site-packages/stonky/stock_store.py", line 105, in _update_quotes stock.ticket: stock for stock in await asyncio.gather(*futures) File "/home/ptruong/anaconda3/envs/py38/lib/python3.8/site-packages/stonky/api.py", line 52, in get_quote raise StonkyException( stonky.exceptions.StonkyException: Could not get stock information for 'GC'

    opened by patruong 0
  • Won't start

    Won't start

    --------------------------------- environment ----------------------------------

    • date = 2022-01-15
    • platform = Linux-5.10.63-v7+-armv7l-with-glibc2.31
    • arguments = []
    • python version = 3.9.2
    • stonky version = 1.4.0
    • teletype version = 1.1.0

    --------------------------------- stack trace ----------------------------------

    Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/stonky/main.py", line 12, in entrypoint asyncio.run(main()) File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete return future.result() File "/usr/local/lib/python3.9/dist-packages/stonky/main.py", line 32, in main await tty.draw() File "/usr/local/lib/python3.9/dist-packages/stonky/tty.py", line 115, in draw print("\n".join(lines)) UnicodeEncodeError: 'latin-1' codec can't encode character '\u25bc' in position 51: ordinal not in range(256)

    =============================== CRASH REPORT END ===============================

    Dang, it looks like stonky crashed! Please consider filling an issue at https://github.com/jkwill87/stonky/issues along with this report.

    opened by miraixyz 1
  • [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate

    [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate

    I feel like there should be an obvious fix to this but I cannot figure it out. Thanks.

    ============================== CRASH REPORT BEGIN ==============================
    
    --------------------------------- environment ----------------------------------
    
     - date = 2021-03-03
     - platform = macOS-11.2.2-x86_64-i386-64bit
     - arguments = []
     - python version = 3.9.1
     - stonky version = 1.3.2
     - teletype version = 1.1.0
    
    --------------------------------- stack trace ----------------------------------
    
    Traceback (most recent call last):
      File "/Users/oiufsha/labs/venv/std3/lib/python3.9/site-packages/aiohttp/connector.py", line 969, in _wrap_create_connection
        return await self._loop.create_connection(*args, **kwargs)  # type: ignore  # noqa
      File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 1081, in create_connection
        transport, protocol = await self._create_connection_transport(
      File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 1111, in _create_connection_transport
        await waiter
      File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/sslproto.py", line 528, in data_received
        ssldata, appdata = self._sslpipe.feed_ssldata(data)
      File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/sslproto.py", line 188, in feed_ssldata
        self._sslobj.do_handshake()
      File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 944, in do_handshake
        self._sslobj.do_handshake()
    ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)
    
    The above exception was the direct cause of the following exception:
    
    Traceback (most recent call last):
      File "/Users/oiufsha/labs/venv/std3/lib/python3.9/site-packages/stonky/api.py", line 98, in _query
        async with self._session.get(url) as response:
      File "/Users/oiufsha/labs/venv/std3/lib/python3.9/site-packages/aiohttp/client.py", line 1117, in __aenter__
        self._resp = await self._coro
      File "/Users/oiufsha/labs/venv/std3/lib/python3.9/site-packages/aiohttp/client.py", line 520, in _request
        conn = await self._connector.connect(
      File "/Users/oiufsha/labs/venv/std3/lib/python3.9/site-packages/aiohttp/connector.py", line 535, in connect
        proto = await self._create_connection(req, traces, timeout)
      File "/Users/oiufsha/labs/venv/std3/lib/python3.9/site-packages/aiohttp/connector.py", line 892, in _create_connection
        _, proto = await self._create_direct_connection(req, traces, timeout)
      File "/Users/oiufsha/labs/venv/std3/lib/python3.9/site-packages/aiohttp/connector.py", line 1051, in _create_direct_connection
        raise last_exc
      File "/Users/oiufsha/labs/venv/std3/lib/python3.9/site-packages/aiohttp/connector.py", line 1020, in _create_direct_connection
        transp, proto = await self._wrap_create_connection(
      File "/Users/oiufsha/labs/venv/std3/lib/python3.9/site-packages/aiohttp/connector.py", line 971, in _wrap_create_connection
        raise ClientConnectorCertificateError(req.connection_key, exc) from exc
    aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host query1.finance.yahoo.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)')]
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/Users/oiufsha/labs/venv/std3/lib/python3.9/site-packages/stonky/__main__.py", line 13, in entrypoint
        loop.run_until_complete(main())
      File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
        return future.result()
      File "/Users/oiufsha/labs/venv/std3/lib/python3.9/site-packages/stonky/__main__.py", line 33, in main
        await tty.draw()
      File "/Users/oiufsha/labs/venv/std3/lib/python3.9/site-packages/stonky/tty.py", line 101, in draw
        await self.stock_store.update()
      File "/Users/oiufsha/labs/venv/std3/lib/python3.9/site-packages/stonky/stock_store.py", line 24, in update
        await self._update_quotes()
      File "/Users/oiufsha/labs/venv/std3/lib/python3.9/site-packages/stonky/stock_store.py", line 102, in _update_quotes
        stock.ticket: stock for stock in await asyncio.gather(*futures)
      File "/Users/oiufsha/labs/venv/std3/lib/python3.9/site-packages/stonky/api.py", line 28, in get_quote
        response = await self._query(url, params)
      File "/Users/oiufsha/labs/venv/std3/lib/python3.9/site-packages/stonky/api.py", line 103, in _query
        raise StonkyException("Could decode server response")
    stonky.exceptions.StonkyException: Could decode server response
    
    =============================== CRASH REPORT END ===============================
    
    question / problem 
    opened by empireshades 1
Releases(1.3.2)
A cd command that learns - easily navigate directories from the command line

NAME autojump - a faster way to navigate your filesystem DESCRIPTION autojump is a faster way to navigate your filesystem. It works by maintaining a d

William Ting 14.5k Jan 3, 2023
AML Command Transfer. A lightweight tool to transfer any command line to Azure Machine Learning Services

AML Command Transfer (ACT) ACT is a lightweight tool to transfer any command from the local machine to AML or ITP, both of which are Azure Machine Lea

Microsoft 11 Aug 10, 2022
Ros command - Unifying the ROS command line tools

Unifying the ROS command line tools One impairment to ROS 2 adoption is that all

null 37 Dec 15, 2022
A simple cli utility for importing or exporting dashboard json definitions using the Grafana HTTP API.

grafana-dashboard-manager A simple cli utility for importing or exporting dashboard json definitions using the Grafana HTTP API. This may be useful fo

Beam Connectivity 31 Jan 6, 2023
Tstock - Check stocks from the terminal

tstock - Check stocks from the terminal! ?? tstock is a tool to easily generate stock charts from the command line. Just type tstock aapl to get a 3 m

Gabe Banks 502 Dec 30, 2022
Simple command line tool for text to image generation using OpenAI's CLIP and Siren (Implicit neural representation network)

Simple command line tool for text to image generation using OpenAI's CLIP and Siren (Implicit neural representation network)

Phil Wang 4.4k Jan 9, 2023
A simple command line dumper written in Python 3.

A simple command line dumper written in Python 3.

ImFatF1sh 1 Oct 10, 2021
Simple command-line implementation of minesweeper

minesweeper This is a Python implementation of 2-D Minesweeper! Check out the tutorial here: https://youtu.be/Fjw7Lc9zlyU You start a game by running

Kylie 49 Dec 10, 2022
A simple command line tool written in python to manage a to-do list

A simple command line tool written in python to manage a to-do list Dependencies: python Commands: todolist (-a | --add) [(-p | --priority)] [(-l | --

edwloef 0 Nov 2, 2021
jrnl is a simple journal application for the command line.

jrnl To get help, submit an issue on Github. jrnl is a simple journal application for the command line. You can use it to easily create, search, and v

jrnl 5.7k Dec 31, 2022
A simple command-line tracert implementation in Python 3 using ICMP packets

Traceroute A simple command-line tracert implementation in Python 3 using ICMP packets Details Traceroute is a networking tool designed for tracing th

James 3 Jul 16, 2022
A simple command line tool for changing the icons of folders or files on MacOS.

Mac OS File Icon Changer Description A small and simple script to quickly change large amounts or a few files and folders icons to easily customize th

Eroxl 3 Jan 2, 2023
A simple command line chat app to communicate via the terminal.

A simple command line chat app to communicate via the terminal. I'm new to networking so sorry if some of my terminology or code is messed up.

PotNoodle 1 Oct 26, 2021
A very simple and lightweight ToDo app using python that can be used from the command line

A very simple and lightweight ToDo app using python that can be used from the command line

Nilesh Sengupta 2 Jul 20, 2022
Notion-cli-list-manager - A simple command-line tool for managing Notion databases

A simple command-line tool for managing Notion List databases. ✨

Giacomo Salici 75 Dec 4, 2022
🔖 Lemnos: A simple, light-weight command-line to-do list manager.

?? Lemnos: CLI To-do List Manager This is a simple program that allows one to manage a to-do list via the command-line. Example $ python3 todo.py add

Rohan Sikand 1 Dec 7, 2022
Zecwallet-Python is a simple wrapper around the Zecwallet Command Line LightClient written in Python

A wrapper around Zecwallet Command Line LightClient, written in Python Table of Contents About Installation Usage Examples About Zecw

Priveasy 2 Sep 6, 2022
This is a simple Termo application in command line style

my-termo This is a simple Termo application in command line style. This app run a Linux crontab task every day to get a new word. Type termo in your t

Gustavo Soares 1 Feb 14, 2022
Tidier - a simple command line tool that helps you make your files tidy up

Tidier - a simple command line tool that helps you make your files tidy up

AmirMohammad Hosseini Nasab 8 Aug 16, 2022