fakturownia package¶
Submodules¶
fakturownia.base module¶
fakturownia.cli module¶
fakturownia.core module¶
-
class
fakturownia.core.
ApiClient
(api_token, base_url=None, request_timeout=10)[source]¶ Bases:
object
Fakturownia API client
Here is an example of how to crete an invoice. But first make sure you have set FAKTUROWNIA_API_TOKEN environment variable.
>>> 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, ... }], ... )
This instance is only partially updated as create returns only subset of data properties, to get all we need to update our instance.
This shows payment_url but only if you have payments enabled.
>>> 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...>
-
base_url
¶
-
fakturownia.endpoints module¶
-
class
fakturownia.endpoints.
Client
(api_client, **kwargs)[source]¶ Bases:
fakturownia.base.BaseModel
-
class
fakturownia.endpoints.
Invoice
(api_client, **kwargs)[source]¶ Bases:
fakturownia.base.BaseModel
-
issue_date
¶
-
normalize_vat
(default_rate=None, intra_eu_vat_rate='np')[source]¶ This is a common business logic that maybe helpful in handling EU to EU invoicing
-
payment_to
¶
-
sell_date
¶
-
fakturownia.exceptions module¶
-
exception
fakturownia.exceptions.
ClientException
(message, data=None, *args)[source]¶ Bases:
fakturownia.exceptions.FakturowniaException
Base client exception with data attribute
fakturownia.factories module¶
fakturownia.settings module¶
Utilities for settings loading
Since envparse modifies os.environ on while loading .env files we need and alternate solution that wont’t touch os.environ by default.
-
fakturownia.settings.
get_default_env_file
()[source]¶ Returns secrets.env from project root, should not be used outside testing
Module contents¶
Top-level package for Fakturownia.