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)
Sink is a CLI tool that allows users to synchronize their local folders to their Google Drives. It is similar to the Git CLI and allows fast and reliable syncs with the drive.

Sink is a CLI synchronisation tool that enables a user to synchronise local system files and folders with their Google Drives. It follows a git C

Yash Thakre 16 May 29, 2022
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 03, 2023
Run an FFmpeg command and see the percentage progress and ETA.

Run an FFmpeg command and see the percentage progress and ETA.

25 Dec 22, 2022
Python implementation of SSH file transfer across servers.

SSH Transfer Python implementation of SSH file transfer across servers. Requirements paramiko=2.7.2 Usage Config Preparation Configure some informatio

Zhe Kong 1 Nov 23, 2021
A simple terminal-based localhost chat application written in python

Chat House A simple terminal-based localhost chat application written in python How to Use? Clone the repo git clone https://github.com/heksadecimal/c

Heks 10 Nov 09, 2021
Openstack bucket retention cli

Openstack bucket retention cli

Fatih Sarhan 3 Apr 03, 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
A startpage configured aesthetically with terminal-esque link formatting

Terminal-y Startpage Setup Clone the repository, then make an unformatted.txt file following the specifications in example.txt. Run format.py Open ind

belkarx 13 May 01, 2022
PyArmor is a command line tool used to obfuscate python scripts

PyArmor is a command line tool used to obfuscate python scripts, bind obfuscated scripts to fixed machine or expire obfuscated scripts.

Dashingsoft 2k Jan 07, 2023
3DigitDev 29 Jan 17, 2022
CLabel is a terminal-based cluster labeling tool that allows you to explore text data interactively and label clusters based on reviewing that data.

CLabel is a terminal-based cluster labeling tool that allows you to explore text data interactively and label clusters based on reviewing that

Peter Baumgartner 29 Aug 09, 2022
Library and command-line utility for rendering projects templates.

A library for rendering project templates. Works with local paths and git URLs. Your project can include any file and Copier can dynamically replace v

808 Jan 04, 2023
Convert ACSM files to DRM-free EPUB files with one command on Linux

Knock Convert ACSM files to DRM-free EPUB files using one command. This software does not utilize Adobe Digital Editions nor Wine. It is completely fr

Benton Edmondson 622 Dec 09, 2022
RSS reader client for CLI (Command Line Interface),

rReader is RSS reader client for CLI(Command Line Interface)

Lee JunHaeng 10 Dec 24, 2022
CLI tool to fix linked references for dates.

Fix Logseq dates This is a CLI tool to fix the date references following a change in date format since the current version (0.4.4) of Logseq does not

Isaac Dadzie 5 May 18, 2022
Magma is a NeoVim plugin for running code interactively with Jupyter.

Magma Magma is a NeoVim plugin for running code interactively with Jupyter. Requirements NeoVim 0.5+ Python 3.8+ Required Python packages: pynvim (for

Daniel Csillag 372 Dec 26, 2022
Command-line tool for downloading and extending the RedCaps dataset.

Command-line tool for downloading and extending the RedCaps dataset.

RedCaps dataset 33 Dec 14, 2022
CLTools provides various tools and command to use in the terminal.

CLTools provides various tools and command to use in the terminal. As of date, CLTools is only able to generate temporary email addresses and receive emails. There are plans to integrate more tools a

Ashwin Chugh 2 Feb 14, 2022
A Neat Application To Manage Your To-Do Lists.

WTD - What To Do? A Neat Application To Manage Your To-Do Lists. One folder can only have one to-do file. Running wth without any subcommands executes

Adam Vajda 1 Oct 24, 2021
Dead simple CLI tool to try Python packages - It's never been easier! :package:

try - It's never been easier to try Python packages try is an easy-to-use cli tool to try out Python packages. Features Install specific package versi

Timo Furrer 659 Dec 28, 2022