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)
👻 Ghoul is an easy to use information service, allowing you to get/add information on someone or something directly from your terminal.

👻 Ghoul is an easy to use information service, allowing you to get/add information on someone or something directly from your terminal. It c

Billy 11 Nov 10, 2021
Command Line For Truecaller Written In Python

Truecaller-CLI Command Line Version For Truecaller Written In Python Never Login With A Number Over And Over Or It Will Be Banned Because Program Is S

Sandaru Ashen Fernando 16 Nov 08, 2022
A command line tool to remove background from video and image

A command line tool to remove background from video and image, brought to you by BackgroundRemover.app which is an app made by nadermx powered by this tool

Johnathan Nader 1.7k Jan 01, 2023
Quickly open any path on your terminal window in your $EDITOR of choice!

Tmux fpp Plugin wrapper around Facebook PathPicker. Quickly open any path on your terminal window in your $EDITOR of choice! Demo Dependencies fpp - F

257 Dec 28, 2022
Access hacksec.in from your command-line

Access hacksec.in from your command-line

hacksec.in 3 Oct 26, 2022
Color preview command-line tool written in python

Color preview command-line tool written in python

Arnau 1 Dec 27, 2021
Declarative CLIs with argparse and dataclasses

argparse_dataclass Declarative CLIs with argparse and dataclasses. Features Features marked with a ✓ are currently implemented; features marked with a

Mike DePalatis 29 Dec 06, 2022
TermPair lets developers securely share and control terminals in real time🔒

View and control terminals from your browser with end-to-end encryption 🔒

Chad Smith 1.5k Jan 05, 2023
Loading animation; a progress bar

Loading animation; a progress bar. When you know the remaining time or task completion percentage, then you’re able to show an animated progress bar:

Goldy 1 Jan 23, 2022
Display Images in your terminal with python

Term-Img Display Images in your terminal with python NOTE: This project is a work in progress and not everything on here has actually been implemented

My avatar ;D 118 Jan 05, 2023
Convert markdown to HTML using the GitHub API and some additional tweaks with Python.

Convert markdown to HTML using the GitHub API and some additional tweaks with Python. Comes with full formula support and image compression.

phseiff 70 Dec 23, 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
img-proof (IPA) provides a command line utility to test images in the Public Cloud

overview img-proof (IPA) provides a command line utility to test images in the Public Cloud (AWS, Azure, GCE, etc.). With img-proof you can now test c

13 Jan 07, 2022
cmdpxl: a totally practical command-line image editor

cmdpxl: a totally practical command-line image editor

Jieruei Chang 476 Jan 07, 2023
Dark powered asynchronous completion framework for neovim/Vim8

deoplete.nvim Dark powered asynchronous completion framework for neovim/Vim8 Note: The development of this plugin is finished. Accepts minor patches a

Shougo 5.9k Dec 30, 2022
spid-sp-test is a SAML2 SPID/CIE Service Provider validation tool that can be executed from the command line.

spid-sp-test spid-sp-test is a SAML2 SPID/CIE Service Provider validation tool that can be executed from the command line. This tool was born by separ

Developers Italia 30 Nov 08, 2022
🎮 An easy to use tool to change the mapping of your input device buttons.

Input Remapper Formerly Key Mapper An easy to use tool to change the mapping of your input device buttons. Supports mice, keyboards, gamepads, X11, Wa

Tobi 1.9k Jan 05, 2023
This tool is a free and unlimited python CLI for google translate. based on google_trans_new.

GoTransPy A free and unlimited python CLI for google translate based on google_trans_new. It's very easy to use and solve the problem that the old api

Youssef Mohamed 2 Jan 10, 2022
Command line interface for unasync

CLI for unasync Command line interface for unasync Getting started Install Run the following command to install the package with pip: pip install unas

Leynier Gutiérrez González 3 Apr 04, 2022
⌨ Toward a more useful keyboard

Toward a more useful keyboard Steve Losh's Modern Space Cadet is an inspiration. It opened my eyes to the fact that there's a more useful keyboard hid

Jason Rudolph 1.7k Jan 01, 2023