Moon is a Python script for querying current and historical cryptocurrency prices using the CoinGecko API.
To install the required dependencies, run:
pip install -r requirements.txt
To run the moon.py
script, use the following command:
python moon.py [OPTIONS]
-i
,--crypto_ids
: Cryptocurrency IDs (default: bitcoin). Examples: bitcoin ethereum litecoin.-c
,--currency
: Currency code (default: usd). Examples: usd, eur, gbp, jpy.-d
,--historical
: Number of days for historical data (default: 0).
Get the current price of Bitcoin in USD:
python moon.py -i bitcoin -c usd
Get the historical prices of Bitcoin for the past 7 days in USD:
python moon.py -i bitcoin -c usd -d 7
To run the tests in tests/test_moon.py
, use the following command:
python -m unittest discover