Skip to content

pinely-international/frankfurter-rates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rates

Project is designed to retrieve formatted data from the FrankFurter. In case of FrankFurter not accessible fallback to local stored data.

Prerequisites

  • Ubuntu 22.04.5 or higher
  • python 3.10.*

Setup

Create virtual environment.

virtualenv venv

Install necessary libs

pip install -r requirements.txt

Create .env file

cd configs
create .env file. # put the same keys defined in .env_example

Create the static saved info in data. Later real data will be kept in production, not in version control. Expected data structure defined in data/example_static_rates.json .

cd data
create a file, with a name defined in .env file.

Run the app. If the port 8000 is already in use, it's possible to use any other port

uvicorn app.main:app --reload --port 8000

Usage

2 endpoints are available health and summary

  • health propose is just system health status checking. Do not expect any data from the request
  • summary propose is formated rate info collecting (EUR->USD). Expect 3query params
    • start_date required
    • end_date required
    • breakdown not required. Single expected value is day.

Examples

Get data with daily rates info

curl --location 'http://127.0.0.1:8000/summary?start_date=2025-01-01&end_date=2025-01-03&breakdown=day'

Get only total data, without daily rates info, data table will be visible in app running terminal

curl --location 'http://127.0.0.1:8005/summary?start_date=2025-01-01&end_date=2025-01-03'

Get health status

curl --location 'http://127.0.0.1:8005/health'

And of course ✅ !

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages