GithubHelp home page GithubHelp logo

nbp-exchange's Introduction

NBP Exchange Rates

This is a Flask web application that presents exchange rates of 5 currency pairs:

  • USD/PLN
  • EUR/PLN
  • CHF/PLN
  • GBP/PLN
  • JPY/PLN

using the data avaliable from NBP API in form of a table and a graph (using Plotly).

Installation

  1. Install Docker

  2. Clone this repository

  3. In repository's main directory execute :

    $ docker-compose up
    

    This command will build any missing images and run 2 containers: one with the MongoDB server and one with the Flask sever.

  4. Access the app from http://localhost:5000.

    If you have troubles with connection check the IP address of your docker-machine by running: $ docker-machine ip and use the shown IP instead of the 'localhost'

Important! The Flask server will not start until it finishes updating the database. Be patient, it shouldn't take longer than 1 minute.

Features

  • On startup: USD/PLN graph and table with data from the last 7 days
  • 5 currency pairs to choose from
  • Adjustable time period
  • 3 views: graph+table / graph only / table only
  • Caching exchange rate records in the database (MongoDB)
  • Caching generated graphs in the database
  • Clear database option

Additionally:

  • User's choice is remembered when changing the webpage between /home, /graph and /table
  • Manual update option
  • Information about the success/failure of the manual update and delete operations visible on the /delete page

What could be changed/added:

  • Changing the style of WTForms
  • Daily automatic updates from the NBP
  • Asynchronous behaviour when making a manual update
  • In case of any response errors on startup: as many tries as needed until the database contains all the records
  • More currencies (perhaps downloading all the possible pairs from NBP API)

Additional information

The app tries to download all the necessary data from NBP servers on the first run. Because the received responses are sometimes in a wrong mimetype or the connection errors might occur there is an option to force-update the database on the /delete subpage by pressing the right button. The errors are occurring probably due to flooding the api server with too many requests at once.

You can try to induce more errors and test the behaviour of the app by changing the constants TIMEOUT and SLEEP_TIME in app/models.py

Used technologies

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.