Skip to content

dobarkod/hnbex-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hnbex-python

Build Status

A Python package for accessing hnbex.eu service

Installation

Install the latest release of the package via pip:

pip install hnbex

Or install directly from GitHub repository:

git clone https://github.com/dobarkod/hnbex-python
cd hnbex-python
python setup.py install

Quickstart

Get exchange rates valid on given date:

from datetime import date, timedelta
from hnbex import Rate
yesterday = date.today() - timedelta(1)
yesterday_rates_dict = Rate.get_rates(yesterday)

Get exchange rates valid today:

from hnbex import Rate
rates_dict = Rate.get_rates()

Get specific currency exchange rate:

euro = rates_dict.get('EUR')

Use the rate for conversion:

amount_eur = euro.from_hrk(500)
amount_hrk = euro.to_hrk(10)

How to run tests

pip install tox
tox

License

Copyright (C) 2016. Dobar Kod. Please see LICENSE file for details.

About

A Python package for accessing hnbex.eu service

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages