Skip to content

πŸ“…πŸ“ˆ Web application for viewing currency rates

Notifications You must be signed in to change notification settings

nsstnc/currency_rates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Currency Rates Web Application

Overview

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.

Table View Plot View

Features

  • 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

Tech Stack

  • Backend: Python, SQLite, SQLAlchemy
  • Data Processing: Pandas, BeautifulSoup
  • Frontend: Streamlit

Installation

  1. Clone the repository:

    git clone https://github.com/nsstnc/currency_rates.git
    cd currency_rates
  2. Run the setup script to configure the virtual environment and start the project:

    sh setup.sh  # Use `setup.bat` on Windows

Usage

  1. After running the setup, the browser page should open automatically. If it does not, open your web browser and navigate to http://localhost:8501.

Application Workflow

  1. Initial Setup:

    • On the first request, exchange rates are parsed from Finmarket and saved to an SQLite database.
    • The list of countries and their main currencies is fetched from IBAN and updated in the database if there are new or modified records.
  2. 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.
  3. 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.

File Structure

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

About

πŸ“…πŸ“ˆ Web application for viewing currency rates

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages