diff --git a/.travis.yml b/.travis.yml index c9303f7..0b66813 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,10 +4,6 @@ cache: "pip" python: - "2.7" - "3.5" -addons: - apt: - packages: - - pandoc env: global: - PYPI_USERNAME=honzajavorek diff --git a/README.md b/README.md deleted file mode 100644 index 30b9f42..0000000 --- a/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# fiobank - -[![PyPI version](https://badge.fury.io/py/fiobank.svg)](https://badge.fury.io/py/fiobank) -[![Build Status](https://travis-ci.org/honzajavorek/fiobank.svg?branch=master)](https://travis-ci.org/honzajavorek/fiobank) - -[Fio Bank API](http://www.fio.cz/bank-services/internetbanking-api) in Python. - -## Installation - -```sh -$ pip install fiobank -``` - -## Usage - -First, [get your API token](https://www.fio.cz/ib2/wicket/page/NastaveniPage?3). Initialization of the client: - -```python ->>> from fiobank import FioBank ->>> client = FioBank(token='...') -``` - -Account information: - -```python ->>> client.info() -{'currency': 'CZK', 'account_number_full': 'XXXXXXXXXX/2010', 'balance': 42.00, 'account_number': 'XXXXXXXXXX', 'bank_code': '2010'} -``` - -Listing transactions within a time period: - -```python ->>> gen = client.period('2013-01-20', '2013-03-20') ->>> list(gen)[0] -{'comment': u'N\xe1kup: IKEA CR, BRNO, CZ, dne 17.1.2013, \u010d\xe1stka 2769.00 CZK', 'recipient_message': u'N\xe1kup: IKEA CR, BRNO, CZ, dne 17.1.2013, \u010d\xe1stka 2769.00 CZK', 'user_identifiaction': u'N\xe1kup: IKEA CR, BRNO, CZ, dne 17.1.2013, \u010d\xe1stka 2769.00 CZK', 'currency': 'CZK', 'amount': -2769.0, 'instruction_id': 'XXXXXXXXXX', 'executor': u'Vilém Fusek', 'date': datetime.date(2013, 1, 20), 'type': u'Platba kartou', 'transaction_id': 'XXXXXXXXXX'} -``` - -Listing transactions from a single account statement: - -```python ->>> client.statement(2013, 1) # 1 is January only by coincidence - arguments mean 'first statement of 2013' -``` - -Listing latest transactions: - -```python ->>> client.last() # return transactions added from last listing ->>> client.last(from_id='...') # sets cursor to given transaction_id and returns following transactions ->>> client.last(from_date='2013-03-01') # sets cursor to given date and returns following transactions -``` - -## Conflict Error -[Fio API documentation](http://www.fio.cz/docs/cz/API_Bankovnictvi.pdf) (Section 8.2) states that a single token should be used only once per 30s. Otherwise a HTTP 409 Conflict will be returned and `fiobank.ThrottlingError` will be raised. - -## License: ISC - -© 2013-? Honza Javorek - -This work is licensed under [ISC license](https://en.wikipedia.org/wiki/ISC_license). diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..7ead047 --- /dev/null +++ b/README.rst @@ -0,0 +1,78 @@ +fiobank +======= + +|PyPI version| |Build Status| + +`Fio Bank API `__ +in Python. + +Installation +------------ + +.. code:: sh + + $ pip install fiobank + +Usage +----- + +First, `get your API +token `__. +Initialization of the client: + +.. code:: python + + >>> from fiobank import FioBank + >>> client = FioBank(token='...') + +Account information: + +.. code:: python + + >>> client.info() + {'currency': 'CZK', 'account_number_full': 'XXXXXXXXXX/2010', 'balance': 42.00, 'account_number': 'XXXXXXXXXX', 'bank_code': '2010'} + +Listing transactions within a time period: + +.. code:: python + + >>> gen = client.period('2013-01-20', '2013-03-20') + >>> list(gen)[0] + {'comment': u'N\xe1kup: IKEA CR, BRNO, CZ, dne 17.1.2013, \u010d\xe1stka 2769.00 CZK', 'recipient_message': u'N\xe1kup: IKEA CR, BRNO, CZ, dne 17.1.2013, \u010d\xe1stka 2769.00 CZK', 'user_identifiaction': u'N\xe1kup: IKEA CR, BRNO, CZ, dne 17.1.2013, \u010d\xe1stka 2769.00 CZK', 'currency': 'CZK', 'amount': -2769.0, 'instruction_id': 'XXXXXXXXXX', 'executor': u'Vilém Fusek', 'date': datetime.date(2013, 1, 20), 'type': u'Platba kartou', 'transaction_id': 'XXXXXXXXXX'} + +Listing transactions from a single account statement: + +.. code:: python + + >>> client.statement(2013, 1) # 1 is January only by coincidence - arguments mean 'first statement of 2013' + +Listing latest transactions: + +.. code:: python + + >>> client.last() # return transactions added from last listing + >>> client.last(from_id='...') # sets cursor to given transaction_id and returns following transactions + >>> client.last(from_date='2013-03-01') # sets cursor to given date and returns following transactions + +Conflict Error +-------------- + +`Fio API +documentation `__ +(Section 8.2) states that a single token should be used only once per +30s. Otherwise a HTTP 409 Conflict will be returned and +``fiobank.ThrottlingError`` will be raised. + +License: ISC +------------ + +© 2013-? Honza Javorek mail@honzajavorek.cz + +This work is licensed under `ISC +license `__. + +.. |PyPI version| image:: https://badge.fury.io/py/fiobank.svg + :target: https://badge.fury.io/py/fiobank +.. |Build Status| image:: https://travis-ci.org/honzajavorek/fiobank.svg?branch=master + :target: https://travis-ci.org/honzajavorek/fiobank + diff --git a/setup.py b/setup.py index b0cf320..cbb3f15 100644 --- a/setup.py +++ b/setup.py @@ -13,31 +13,20 @@ message = "Unable to locate 'semantic_release', releasing won't work" print(message, file=sys.stderr) -try: - import pypandoc - long_description = pypandoc.convert_file('README.md', 'rst') -except ImportError: - message = ( - "Unable to locate 'pypandoc', long description of the 'fiobank'" - "package won't be available in reStructuredText" - ) - print(message, file=sys.stderr) - long_description = open('README.md').read() - version = '1.2.0' install_requires = ['requests', 'six'] tests_require = ['pytest-runner', 'pytest', 'flake8', 'responses', 'mock'] -release_requires = ['pypandoc', 'python-semantic-release'] +release_requires = ['python-semantic-release'] setup( name='fiobank', version=version, description='Fio Bank API in Python', - long_description=long_description, + long_description=open('README.rst').read(), author='Honza Javorek', author_email='mail@honzajavorek.cz', url='https://github.com/honzajavorek/fiobank',