Skip to content

Example loading currencies from bitfinex.com using their API

Notifications You must be signed in to change notification settings

uliantsev-a/currencies-log

Repository files navigation

Currencies log and analyser on API interfaces

This app is example load currencies from bitfinex.com using their API
API endpoints
  • Getting rate info by currency with average between last 10 days, by default
    /api/rate/<id_currency>

  • Getting list currencies with the option paginate
    /api/currencies?page=<num>&perPage=<num>


Install
pip install -r requirements.txt
export FLASK_APP=app.py
Configure:

Use the config.py or instance/config.cfg how instance config.
Fill SQLALCHEMY_DATABASE_URI or set next environment variables:

export DATABASE_NAME='' DATABASE_USER='' DATABASE_HOST='' DATABASE_PASSWORD=''

for connect to your DB. Uses PostgreSQL by default.

DB migrate:
flask db init
flask db upgrade

if you will change models need use migrate with next upgrade

flask db migrate
flask db upgrade
Loading first data from fixtures:

If you want add anything currency you should fill fixtures in make_default_currency inside project/fixtures.py.
Currency should be available on bitfinex.com.

flask first-filling
flask test-user

User for testing have next login and password test:test

Crawl & write rates

Loading the rates from bitfinex.com by all currency from database

flask load
Get start
flask run

Releases

No releases published

Packages

No packages published

Languages