A sleek, real-time desktop application that fetches and displays the live price of Bitcoin using the CoinMarketCap API. The application features a clean interface built with Python and PyQt6, showing the current price in both US Dollars (USD) and an estimated Iranian Rial (IRR) equivalent, along with key performance metrics.
| Feature | Description |
|---|---|
| 💸 Live USD Price | Displays the most up-to-date price of Bitcoin in US Dollars. |
| 🇮🇷 IRR Conversion | Automatically calculates the USD price to Iranian Rial (IRR) based on a predefined rate. |
| 📊 Performance Metrics | Tracks and displays percentage price changes over the last 24 hours, 7 days, and 30 days. |
| 🔄 Manual Refresh | Includes a dedicated "Update!" button to fetch the latest data from the API on demand. |
| 🕒 Timestamp | Shows the exact time of the last successful data fetch so you know how current the info is. |
| 🔐 Secure API Handling | Manages the secret CoinMarketCap API key securely using a .env file. |
- Python 3: Application logic.
- PyQt6: Graphical User Interface (GUI).
- Requests: For making HTTP calls to the CoinMarketCap API.
- Python-dotenv: For securely loading environment variables and credentials.
To run this application, you need Python 3.x and a free CoinMarketCap API Key.
-
Clone the Repository:
git clone <your-repository-url> cd <repository-folder>
-
Get a CoinMarketCap API Key:
- Go to the CoinMarketCap API website.
- Sign up for a free plan and copy your API key.
-
Set Up Your Environment File: In the root directory of the project, create a file named
.envand add your key:API_KEY=your_api_key_here
-
Install Dependencies: It is highly recommended to use a virtual environment (
.venv).pip install -r requirements.txt
(Ensure
btc.pngis located inside thesrcfolder). -
Run the Application: Execute the main script from the
srcdirectory:python src/main.py
- Upon launch or when the Update! button is clicked, the
update_pricefunction runs. - It constructs a secure request to the CoinMarketCap API using the key loaded from the
.envfile. - Once a successful JSON response is received, the app parses the Bitcoin price (USD) and its percentage changes.
- It calculates the IRR equivalent and updates all the corresponding GUI labels to display the fresh data.
If you found this project helpful or interesting, please consider giving it a Star ⭐️ on GitHub! Feel free to open an issue or leave a comment if you have any suggestions, feedback, or found a bug. Your input helps make this project better.
Let's connect! You can find my links and reach out to me through my GitHub profile bio:
- Check out my GitHub Profile for Email, Telegram, LinkedIn, and Instagram links.
This project is licensed under the MIT License - see the LICENSE file for details.