Git Product home page Git Product logo

gold-digger's Introduction

Gold-digger (Exchange rates service)

Used technologies

Development setup

python -m venv .env
. ./.env/bin/activate  # or for BFU .env\Scripts\activate.bat
pip install -U pip wheel
pip install --use-wheel -r requirements-dev.txt

Now you can run test by command py.test or start watchdog that run the tests after every save of Python file by command ptw.

Create PostgreSQL database and user named gold-digger.

Create local configuration file called gold_digger/config/params_local.py with configuration for local machine. For development purposes there is no configuration required so file may look like the below one:

# -*- coding: utf-8 -*-

LOCAL_CONFIG_PARAMS = {

}

Usage

Create local database and update connection parameters.

  • python -m gold_digger initialize-db to create tables
  • python -m gold_digger update [--date="yyyy-mm-dd"] to update rates of specified date (default today)
  • python -m gold_digger update-all [--origin-date="yyyy-mm-dd"] to update rates since specified origin date
  • python -m gold_digger serve starts API server

API endpoints

Docker

Ensure you have created local params file according to Development setup section. Then build docker image.

docker build -t gold-digger-ubuntu .

If you are connecting to local database on the host (outside the container) run the container with --net=host option.

docker run --name gold-digger --net=host -t -i -p 8000:8000 gold-digger-ubuntu

Run production container as daemon (production).

docker run --name gold-digger -d -p 8000:8000 gold-digger-ubuntu

Docker container starts the Gunicorn server. Web server is kept alive by supervisor. Cron performs daily updates at 00:05.

gold-digger's People

Contributors

martinvy avatar artimi avatar miso-belica avatar

Watchers

Tomáš Daniel avatar

Forkers

n0081k

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.