Skip to main content

A command line tool for pulling crypto data

Project description

⚡️ Crypto CLI ⚡️

Ever felt the pressing need to lookup crypto data right from your shell? Now you can!

Installation

Note: requires Python 3, pipx recommended

TBD once I publish to PyPI.....

# download the python script file to a location on your $PATH
curl -L TBD > /usr/local/bin/crypto.py
# setup crypto command
echo "alias crypto='python /usr/local/bin/crypto.py'" >> ~/.bashrc
source ~/.bashrc

Build from source

git clone https://github.com/acrenwelge/cryptocli-python.git
python -m build
pipx install dist/*.whl

Usage

Please note: there is currently a rate limit of 50 calls / minute for the free API being used

👀 Search for a crypto

crypto search bit

ℹ️ Lookup info on a cryptocurrency

crypto --coin bitcoin

💰 Get price info only

crypto price --coin bitcoin

💶 Get price info for multiple coins in multiple currencies

crypto price -c bitcoin -c ethereum -c litecoin -cur USD -cur EUR

📈 Get price history by day, week, or month

crypto history -c bitcoin -d 10 # past 10 days of bitcoin price
crypto history -c bitcoin -d 10 --graph # add a graph
crypto history -c bitcoin -w 5 # past 5 weeks of bitcoin price
crypto history -c bitcoin -m 3 # past 3 months of bitcoin price

📖 Get USD price of bitcoin on May 1, 2015

crypto price -c bitcoin --date 2015-05-01

⏱ Watch the price (default: refresh every 15 seconds)

crypto price -c bitcoin --watch
crypto price -c bitcoin -w -i 10 -s 1 # interval of 10 seconds, stop after 1 minute

% See price gains over time

crypto gains -c bitcoin 2020-01-01 2021-01-01

Config

The default coin and currency to use will be stored in $HOME/.crypto/defaults.properties. If this file exists, these values will be used unless overridden with command line arguments. If no file exists and no command line arguments are provided, the program reverts to bitcoin and USD defaults, respectively.

⚙️ Set default crypto and currency

crypto config -c bitcoin
crypto config -cur USD
crypto config # displays current defaults if no args set

Crypto coin must be its id. Currency must follow ISO 4217 AND be supported by the API used.

📝 List possible coin and currency values

crypto list coins
crypto list currencies

Caching

A list of coins to search will be cached in $HOME/.crypto/coins.json for quick searching and lookup. By default, a TTL value of 7 days will be used.

Complex Queries & Examples 🧐

# find the number of cryptocurrencies with the word "chain" in their name
crypto list coins | grep chain | wc -l

# store the price of bitcoin for the last year
crypto history -c bitcoin -d 365 > btc-prices-last-year.txt

Built with...

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

cryptocli-0.0.1.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

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

cryptocli-0.0.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file cryptocli-0.0.1.tar.gz.

File metadata

  • Download URL: cryptocli-0.0.1.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for cryptocli-0.0.1.tar.gz
Algorithm Hash digest
SHA256 0f43af7a458e5de9bf0a5ad67ed70614df2fb0c722adaf75fb15fd1dfad75da0
MD5 9cde925e7e2e81f4c6b7f360860ddb51
BLAKE2b-256 4a40b1258de3be6b78144f8886e95cab7cd289f2546f157a9c0ce98f6db050b0

See more details on using hashes here.

File details

Details for the file cryptocli-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: cryptocli-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for cryptocli-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 292e2698c77b0d5e4b3b03d9a0aeef66da6e4fc5bdbd2f7a7de4d7b457562505
MD5 890f09972b603e8480223092fa73105d
BLAKE2b-256 0ce88545225f7e26e234a3a68c0aa0f6d9638cc56cdac1179f405c331a69693d

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