Package: fakturownia
Python client library for the Fakturownia APIIf you don’t know it yet be sure to check it out:Table of ContentsFeaturesQuickstartRunning TestsHelp wantedCreditsHistory0.1.0 (2018-01-03)0.1.2 (2018-01-10)0.2.1 (2018-01-12)0.2.2 (2018-01-18)Features☑ Invoice CRUD plussend_by_emailand ‘mark_paid`☑ EU member states VAT rate helpers for B2C transactions☑ ApiClient CRUD☐ Payments CRUD☐ Products CRUD☐ Warehouse documents CRUD☐ Accounts managementPlease refer to thefakturownia APIsfor full API featuresQuickstartInstall Fakturowniapip install fakturownia
pythonPlay withfakturownia APIsin python interpreter:>>> import os
>>> os.environ.get('FAKTUROWNIA_API_TOKEN', 'Missing key')
'...'
>>> from fakturownia import get_api_client
>>> api = get_api_client()
>>> invoice = api.invoices.create(
...     seller_name='Kabaret Starszych Panów',
...     buyer_name='Odrażający drab',
...     positions=[{
...         'name': 'Smolna szczapa',
...         'quantity': 5,
...         'total_price_gross': 7.33,
...     }],
... )
>>> invoice.view_url
'...'This instance is only partially updated as create returns only subset of
data properties, to get all we need to update our instance.If you have payments enabled you can call get to fetch all data and check payment_url:>>> invoice.get()
<fakturownia.endpoints.Invoice object at 0x...>
>>> invoice.payment_url
'...'We can mark this invoice as paid:>>> invoice.mark_paid()
<fakturownia.endpoints.Invoice object at 0x...>You can chain your calls:>>> invoice.put(buyer_email='kominek@niepodam.pl').send_by_email()
<fakturownia.endpoints.Invoice object at 0x...>You can play and test your scenarios wih factories:pip install fakturownia[factories]
pythonNow you can do this:>>> from fakturownia.factories import InvoiceFactory
>>> InvoiceFactory(api_client='<your api key here>', kind='proforma').post().get().payment_url # doctest: +SKIP
'...'Also checkout VAT tax normalization based onEU country specific VAT rates:>>> InvoiceFactory(
...     api_client=api,
...     seller_country='PL',
...     buyer_country='DE',
...     buyer_tax_no=None,
... ).normalize_vat().post().view_url
'...'Neat! :)Running TestsDoes the code actually work?pipenvinstall--devpipenvshelltoxWe recommend usingpipenvbut a legacy approach to creating virtualenv and installing requirements should also work.
Please installrequirements/base.txtandrequirements/development.txtto setup virtual env for testing and development.Help wantedThis library is not yet complete. It does what was needed by up to date contributors, but more can be done.
You can implement new api endpoints and write test for them, it’s actually straightforward and new classes will be simple,
but tests need some effort. We are lazy test writers and because we don’t want to compromise coverage so we
postponed new apis until someone would want to write test.If want to help please refer to thecontributing sectionin the docs for more info.CreditsThis package was created withCookiecutterand thewooyek/cookiecutter-pylibproject template.History0.1.0 (2018-01-03)First release on PyPI.0.1.2 (2018-01-10)endpoints indexingRobust testing with mocked and real interchangeable backeds .0.2.1 (2018-01-12)EU member states VAT rate helpers for B2C transactionsFAKTUROWNIA_TIMEOUT setting for request timeout0.2.2 (2018-01-18)Payload data cleanup from readonly fields so get().put() is possible