GithubHelp home page GithubHelp logo

currency-tracker's Introduction

I am a codementor Donate

currency-tracker

Description : A currency exchange tracker based on Boursorama Website.

  1. The idea is to gather information is order to feed a dataset in a first step.
  2. Detect and study the algorithme that lead to influence each currency
  3. Produce a model.

HOW It WORKS

The exchange dict store the revelent value and condition to trigger a notification, ex when a currency is higher or lower than a certain value (bestrate)

exchange = [
    {'devise': 'EUR-MAD', 'condition': '>=', 'bestrate': '10.97', 'weight': 0},
    {'devise': 'EUR-USD', 'condition': '>=', 'bestrate': '1.1944', 'weight': 0},
     {'devise':'USD-MAD','condition':'<=','bestrate':'9.3529','weight':0},
      {'devise':'JPY-EUR','condition':'<', 'bestrate':'0.75166','weight':0},
      {'devise':'CNY-EUR','condition':'>', 'bestrate':'0.12832','weight':0}
]

Rotation : Random but the last one :

This algorithme avoid to check the same currency twice, so the idea is to rotate over other currency randomly.

        while index == last:
            index = random.randint(0, len(exchange) - 1)

The configuration is inside the python script :

Sleep between checks :

In order to do a clean check and not subcharge the server side, we do a sleep between every check the value is the modulo the variation, as the variation could be negative then the higher the shorter the sleep is , long when the variation is negative.

        while index == last:
            index = random.randint(0, len(exchange) - 1)

The configuration is inside the python script : Requierements

This code could be run on a linux machine :

this is systemD configuration to set it up as a deamon :

#####/etc/systemd/system/currency-tracker.service 
[Unit]
Description=Currency Tracker
Documentation=http://currency-0000----XXXXXXX.io/
After=network.target

[Service]
Type=simple
User=centos
Group=centos
WorkingDirectory=/home/centos/
ExecStart=/bin/python /home/centos/currency-tracker-v0.1.py

TimeoutStopSec=180
Restart=no

[Install]
WantedBy=multi-user.target

it also can be run on a docker container a aws lambda serverless or Amazon azure function

currency-tracker's People

Contributors

cloudevops101 avatar

Watchers

 avatar

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.