Skip to content

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Asset tracker with NBP exchange rates

A small Flask application for keeping track of what you own and what it is worth in złoty. Assets are stored with their own currency, and the value in PLN is computed from the National Bank of Poland's daily rate table.

Written as a recruitment exercise, so the scope is deliberately narrow: CRUD over one table, one external API, no accounts and no authentication.

How the rates work

NBP publishes one table per working day, so fetching it per request would be 193 identical HTTP calls to serve one page. get_todays_rates() in app.py checks the rates table first and only calls https://api.nbp.pl/api/exchangerates/tables/a/last/1/ when today's table is not already stored. The asset list then converts against the newest date it holds, which means the app keeps working when the API is unreachable, showing the last rates it saw rather than an error page.

Assets marked is_pln skip conversion entirely.

Running it

python -m venv .venv
source .venv/bin/activate      # Windows: .venv\Scripts\activate
pip install -r requirements.txt
flask --app app run

The SQLite file is created on first start under instance/, which is not tracked.

Routes

Route Does
/assets list everything, with a PLN column and the rate date used
/assets/create add an asset
/asset/<id> detail
/asset/<id>/edit edit
/asset/<id>/delete delete, with a confirmation step

Data model

Asset carries name, value, currency, an is_pln flag and created/updated timestamps in Europe/Warsaw. Rate is one row per currency per publication date, which is what makes the cache a lookup rather than a single overwritten row.

Licence

MIT, see LICENSE.

About

Flask asset tracker: CRUD over assets held in any currency, valued in PLN from the NBP daily rate table, with the table cached per publication date so the API is called once a day. Recruitment exercise.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages