Tstock - Check stocks from the terminal

Related tags

CLI Tools tstock
Overview

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 month candlestick chart of $AAPL in your terminal!

Example:

tstockex

Dependencies

  • Python 3.6 or greater

Installation

AUR

tstock is available on the AUR. If you are on an Archlinux system, you can just install it using your AUR helper. Example using yay:

yay -S tstock

PyPI

tstock is also available as a Python package. You can install it using pip:

pip3 install tstock

Getting started

MarketStack API setup

After installing tstock, you will need a MarketStack API key to pull the market data.

  • Make a free MarketStack API account at https://marketstack.com/signup/free
  • Login and find your API Access Key on the Dashboard page
  • Run export MARKETSTACK_API_KEY= . You can make this permanent by adding that command to your .bashrc.

Usage

Run ./tstock TICKER to get the 3 month chart of $TICKER. Use -d DAYS to specify the number of days back you want to pull. Use -y LINES to specify the length of the chart's y axis.

You can get indexes by appending .INDX. for example, ./tstock DJI.INDX to get the Dow Jones Industrial Average. Find more information on how to specify special tickers on MarketWatch's API Docs: https://marketstack.com/documentation

Notes

  • The free tier of the API is limited to 100 API calls per month.
Comments
  • Error in launching tstock - no module name 'numpy'

    Error in launching tstock - no module name 'numpy'

    Launching tstock would produce error as shown :

    Traceback (most recent call last): File "/usr/bin/tstock", line 33, in sys.exit(load_entry_point('tstock==2.1.2', 'console_scripts', 'tstock')()) File "/usr/bin/tstock", line 25, in importlib_load_entry_point return next(matches).load() File "/usr/lib/python3.10/importlib/metadata/init.py", line 162, in load module = import_module(match.group('module')) File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/usr/lib/python3.10/site-packages/tstock/main.py", line 3, in from .core import main File "/usr/lib/python3.10/site-packages/tstock/core.py", line 7, in import numpy as np ModuleNotFoundError: No module named 'numpy'

    Installed from AUR package

    OS : EndeavourOS Kernel: 5.16.4-arch1-1

    opened by zer0exia 3
  • Added options to facilitate customization of chart colors

    Added options to facilitate customization of chart colors

    Not every market generally uses green for up and red for down. For instance, China (excluding Hong Kong) and Japan conventionally use red for up and green for down, and South Korea tends to use red for up and blue for down. Investors accustomed to the prevalent chart colors of those markets (including me) may find it difficult to adapt to the "green up, red down" style. Therefore it would be nice to allow users to customize chart colors.

    I've allowed users to set the colors of positive and negative candlesticks as green, red, or blue by adding options --upcolor and --downcolor. This caters to the needs of investors from China (excluding Hong Kong), Japan, and South Korea.

    opened by UeiWang 1
  • Terminal window with command closes immediately

    Terminal window with command closes immediately

    When I start something line alacritty -e tstock btc, new window with chart appears for half of a second and closes immediately. I use dwm + alalcritty. I did the same operation with st and got the same result.

    opened by Tinkerbells 1
  • Unable to detect the screen size if wrapped with 'watch'?

    Unable to detect the screen size if wrapped with 'watch'?

    When using with watch, like watch --interval 20 tstock btc, tstock seems to fail while detecting the screen size:

    Traceback (most recent call last):
      File "/Library/Frameworks/Python.framework/Versions/3.9/bin/tstock", line 8, in <module>
        sys.exit(main())
      File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/tstock/core.py", line 428, in main
        opts = parse_args(parser)
      File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/tstock/parse.py", line 47, in parse_args
        t = os.get_terminal_size()
    OSError: [Errno 25] Inappropriate ioctl for device
    
    opened by 097115 1
  • Put API key in a configuration file?

    Put API key in a configuration file?

    Maybe it would be better to use a config file ~/.config/tstock/config to put in the API key. This way it would work from every shell and I think it is simpler to edit a config file than to add an environment variable. Also the config could be used for other things in the future.

    opened by jaime10a 1
  • Support -c [lower case ticker]

    Support -c [lower case ticker]

    For example, $ tstock btc -c UYU works fine but $ tstock btc -c uyu doesn't. Output when trying to use the lowercase ticker:

      File "/home/mcbruno712/.local/bin/tstock", line 8, in <module>
        sys.exit(main())
      File "/home/mcbruno712/.local/lib/python3.8/site-packages/tstock/core.py", line 427, in main
        opts = parse_args(parser)
      File "/home/mcbruno712/.local/lib/python3.8/site-packages/tstock/parse.py", line 75, in parse_args
        opts['currency_symbol'] = currency_symbols[args.c]
    KeyError: 'uyu'
    opened by McBruno712 1
  • Cannot print the graph in Windows Bash

    Cannot print the graph in Windows Bash

    hi, I am using Git Bash and after installing tstock with pip and setting the Alphavantage API key (for anyone interested in how to do this see here) the program fails to print out the graph.

    I am getting UnicodeEncodeError: 'charmap' codec can't encode characters in position 7-8: character maps to <undefined> error. i have attached the screenshot below. Looks like the error is at line 379 from core.py and it might need fixing by forcing UTF-8 encoding ( I am not sure).

    image

    opened by rameshKrSah 1
  • Dockerfile for make

    Dockerfile for make

    Hey, could you make a Dockerfile that will run the make build? It would be much simpler for people to install without having to worry about required compiler, settings and libs.

    opened by turowicz 1
  • Add basic support for the curl C API

    Add basic support for the curl C API

    This commit switches from calling the curl binary on the command line to using the proper C API for curl.

    There are still a bunch of TODOs, but nothing seems to be broken as far as I can see

    opened by zeGolem 0
  • tstock command returns

    tstock command returns "Error: The API did not return data." when using non-premium AlphaVantage api key

    The simple command format tstock {stock name abbreviation} no longer works as AlphaVantage has made the TIME_SERIES_DAILYfunction premium only. The TIME_SERIES_DAILY_ADJUSTED function is not premium only and works fine as far as i can tell.

    To make tstock use TIME_SERIES_DAILY_ADJUSTED change line 148 of core.py from api_function = 'TIME_SERIES_DAILY' to api_function = 'TIME_SERIES_DAILY_ADJUSTED'

    opened by forestsmills 0
  • Price on Chart 10% lower

    Price on Chart 10% lower

    The candles on the chart seem to be about 10% lower on every stock. Probably the prices are right, but the y-axis labeling is somehow off. I have everything in USD, but it could also be that it somehow gets converted to EURO.(Cause the exchange is about 10% lower)

    opened by jaime10a 3
  • Add support for currencies besides USD

    Add support for currencies besides USD

    The currency will always be displayed as USD, even if the data is from a foreign market of a different currency. Additionally, it will be displayed as USD even if it is a unitless measure, like an index.

    opened by Gbox4 2
Owner
Gabe Banks
Gabe Banks
Interactive Redis: A Terminal Client for Redis with AutoCompletion and Syntax Highlighting.

Interactive Redis: A Cli for Redis with AutoCompletion and Syntax Highlighting. IRedis is a terminal client for redis with auto-completion and syntax

null 2.2k Dec 29, 2022
A Terminal Client for MySQL with AutoCompletion and Syntax Highlighting.

mycli A command line client for MySQL that can do auto-completion and syntax highlighting. HomePage: http://mycli.net Documentation: http://mycli.net/

dbcli 10.7k Jan 7, 2023
Python commandline tool for remembering linux/terminal commands

ehh Remember linux commands Commandline tool for remembering linux/terminal commands. It stores your favorite commands in ~/ehh.json in your homedir a

null 56 Nov 10, 2022
Open a file in your locally running Visual Studio Code instance from arbitrary terminal connections.

code-connect Open a file in your locally running Visual Studio Code instance from arbitrary terminal connections. Motivation VS Code supports opening

Christian Volkmann 56 Nov 19, 2022
Darkdump - Search The Deep Web Straight From Your Terminal

Darkdump - Search The Deep Web Straight From Your Terminal About Darkdump Darkdump is a simple script written in Python3.9 in which it allows users to

Josh Schiavone 264 Dec 30, 2022
Random scripts and other bits for interacting with the SpaceX Starlink user terminal hardware

starlink-grpc-tools This repository has a handful of tools for interacting with the gRPC service implemented on the Starlink user terminal (AKA "the d

null 270 Dec 29, 2022
asciinema - Terminal session recorder 📹

asciinema - Terminal session recorder ??

asciinema 11.1k Dec 27, 2022
Rich is a Python library for rich text and beautiful formatting in the terminal.

The Rich API makes it easy to add color and style to terminal output. Rich can also render pretty tables, progress bars, markdown, syntax highlighted source code, tracebacks, and more — out of the box.

Will McGugan 41.4k Jan 3, 2023
Lets you view, edit and execute Jupyter Notebooks in the terminal.

Lets you view, edit and execute Jupyter Notebooks in the terminal.

David Brochart 684 Dec 28, 2022
The project help you to quickly build layouts in terminal,cross-platform

The project help you to quickly build layouts in terminal,cross-platform

gojuukaze 133 Nov 30, 2022
GanTTY - Project planning from the terminal

GanTTY - Project planning from the terminal

Timeo Sam Pochin 161 Dec 26, 2022
Module for converting 2D Python lists to fancy ASCII tables. Table2Ascii lets you display pretty tables in the terminal and on Discord.

table2ascii Module for converting 2D Python lists to a fancy ASCII/Unicode tables table2ascii ?? Installation ??‍?? Usage Convert lists to ASCII table

Jonah Lawrence 40 Jan 3, 2023
Modern line-oriented terminal emulator without support for TUIs.

Modern line-oriented terminal emulator without support for TUIs.

null 10 Jun 12, 2022
A super simple wallet application for the NANO cryptocurrency that runs in the terminal

Nano Terminal Wallet A super simple wallet application for the NANO cryptocurrency that runs in the terminal Written in 2021 by NinjaSnail1080 (Discor

null 9 Jul 22, 2022
uploadgram uses your Telegram account to upload files up to 2GiB, from the Terminal.

uploadgram uploadgram uses your Telegram account to upload files up to 2GiB, from the Terminal. Heavily inspired by the telegram-upload Installing: pi

Shrimadhav U K 97 Jan 6, 2023
ddgr is a cmdline utility to search DuckDuckGo (html version) from the terminal

ddgr is a cmdline utility to search DuckDuckGo (html version) from the terminal. While googler is extremely popular among cmdline users, in many forums the need of a similar utility for privacy-aware DuckDuckGo came up. DuckDuckGo Bangs are super-cool too! So here's ddgr for you!

Piña Colada 2.5k Dec 25, 2022
This a simple tool to query the awesome ippsec.rocks website from your terminal

ippsec-cli This a simple tool to query the awesome ippsec.rocks website from your terminal Installation and usage cd /opt git clone https://github.com

stark0de 5 Nov 26, 2022
💥 Share files easily over your local network from the terminal!

Fileshare ?? Share files easily over your local network from the terminal! ?? Installation # clone the repo $ git clone https://github.com/dopevog/fil

Dopevog 11 Sep 10, 2021
A terminal UI dashboard to monitor requests for code review across Github and Gitlab repositories.

A terminal UI dashboard to monitor requests for code review across Github and Gitlab repositories.

Kyle Harrison 150 Dec 14, 2022