This Python script fetches and displays real-time cryptocurrency prices for a list of popular cryptocurrencies in various currencies (BTC, USD, EUR, and INR). The data is presented in a visually appealing table using the rich
library.
- Fetch Cryptocurrency Data: Retrieves the latest prices for multiple cryptocurrencies using the CryptoCompare API.
- Multi-Currency Support: Displays prices in Bitcoin (BTC), US Dollars (USD), Euros (EUR), and Indian Rupees (INR).
- Rich Table Display: Utilizes the
rich
library to format and display data in a styled table with clear visuals.
- Python 3.7 or higher
- Install the required libraries using:
pip install requests rich
- Clone or download the script.
- Replace the
key
variable with your own API key from CryptoCompare. - Run the script:
python crypto_tracker.py
- View the cryptocurrency prices in a formatted table output.
A visually styled table of cryptocurrency prices with columns for:
- Cryptocurrency name
- Prices in BTC, USD, EUR, and INR
- Ensure your API key has sufficient access to fetch data.
- Modify the
cryptos
andcurrencies
variables as needed to customize the list of cryptocurrencies and target currencies.
- API Source: CryptoCompare
- Libraries Used:
requests
for API callsrich
for table styling and console output