This project is a web application that displays exchange rates for various countries. Users can select a date range and the desired way of displaying information. When selecting "Plot," the application generates a graph showing the relative changes in exchange rates compared to the default date specified in the database.
- Display exchange rates in a tabular format
- View changes in exchange rates as a graph
- Select a date range for historical data
- Data is fetched from Finmarket on the first request and cached in an SQLite database
- The list of countries and their main currencies is parsed from IBAN when the application page is refreshed, with only new or modified records being added to the database
- Backend: Python, SQLite, SQLAlchemy
- Data Processing: Pandas, BeautifulSoup
- Frontend: Streamlit
-
Clone the repository:
git clone https://github.com/nsstnc/currency_rates.git cd currency_rates
-
Run the setup script to configure the virtual environment and start the project:
sh setup.sh # Use `setup.bat` on Windows
- After running the setup, the browser page should open automatically. If it does not, open your web browser and navigate to
http://localhost:8501
.
-
Initial Setup:
-
User Interaction:
- The user selects a date range within 2 years for which they want to view exchange rates.
- The user selects the countries whose main currencies they want to see.
- The user chooses how to display the data: in a table or as a graph.
-
Data Display:
- If the requested data is already in the database, it is retrieved and displayed.
- If the data is not in the database, it is fetched from Finmarket, saved to the database, and then displayed.
currency_rates/
βββ markdown-images/ # Directory for storing documentation images
βββ data_manager.py # Class for data management
βββ database.db # SQLite database file (created after the first application run)
βββ database.py # Database setup class
βββ main.py # Main application file - Streamlit interface
βββ models.py # Database table models
βββ parser.py # Class implementing data parsing functions
βββ README.md # Project documentation
βββ requirements.txt # List of dependencies
βββ setup.bat # Script to set up the virtual environment and start the project for Windows systems
βββ setup.sh # Script to set up the virtual environment and start the project for UNIX systems