A Python script that converts currencies using real-time exchange rates from an online API. This tool allows you to convert between different currencies with ease.
- Real-Time Conversion: Converts currency values based on up-to-date exchange rates.
- Supports Multiple Currencies: Allows conversion between many commonly used currencies.
- API Integration: Fetches exchange rates from a currency API (e.g., ExchangeRate-API).
- Python 3.x
- API Key: You will need an API key from a currency exchange service (e.g., ExchangeRate-API).
-
Clone the repository:
git clone https://github.com/shahramsamar/Python_Currency_Converter_Scripts.git cd Python_Currency_Converter_Scripts -
Install Dependencies:
If you're using
pip, run:pip install -r requirements.txt
-
Get API Key:
Sign up for an API key at a currency exchange service provider such as ExchangeRate-API.
-
Set up the API Key:
In the script, replace the placeholder for the API key with your actual key.
api_key = 'your_api_key'
-
Run the Script:
python converter.py
- The script will prompt you to enter the source currency, target currency, and the amount to convert.
- It will then fetch the latest exchange rate and calculate the converted value.
converter.py: Main script that handles the conversion logic and interacts with the API.requirements.txt: Lists necessary libraries such asrequestsfor API calls.
Feel free to fork the project and submit pull requests for new features, improvements, or bug fixes.
This project is open-source and available for educational purposes.