Spaces:
Runtime error
Runtime error
Currency Converter Web App
Author:
- Name: [Your Name]
- Student ID: [Your Student ID]
Project Description:
This project is a Currency Converter web app built using Python and Streamlit. It allows users to convert between different currencies using both the latest and historical exchange rates retrieved from the Frankfurter API.
Key Features:
- Convert an amount between two currencies using the latest conversion rate.
- Convert an amount using a historical exchange rate for a selected date.
- Display the conversion rate, converted amount, and inverse conversion rate.
Files in the Project:
- app.py: Main Streamlit Python script used for managing users’ inputs and displaying results.
- api.py: Python script that contains the code for making API calls to fetch available currencies.
- frankfurter.py: Python script containing functions for calling relevant Frankfurter endpoints and extracting information (latest and historical rates).
- currency.py: Python script used for formatting the results displayed in the Streamlit app.
- README.md: Project documentation with details, functions list, and instructions for running the web app.
Python Functions:
get_currencies()
: Fetches the list of available currencies from the Frankfurter API.get_latest_rate(from_currency, to_currency)
: Fetches the latest conversion rate from the Frankfurter API.get_historical_rate(from_currency, to_currency, date)
: Fetches the historical conversion rate for a specific date from the Frankfurter API.format_conversion_result(date, from_currency, to_currency, rate, from_amount, to_amount, inverse_rate)
: Formats the conversion results for display in the Streamlit app.
How to Run the Web App:
Install the required dependencies:
pip install streamlit requests
or
pip install -r requirements.txt
Run the Streamlit app:
streamlit run app.py