diff --git a/superfaktura/bank_account.py b/superfaktura/bank_account.py index fb188f6..bba7633 100644 --- a/superfaktura/bank_account.py +++ b/superfaktura/bank_account.py @@ -15,20 +15,16 @@ Functions: - (none) Usage: - import superfaktura.bank_account - - # Create an instance of BankAccount - bank = superfaktura.bank_account.BankAccount() - - # Retrieve a list of bank accounts - accounts = bank.list() - - # Get the default bank account - default_account = bank.default() - - # Create or update a bank account - data = {"account": "1234567890", "bank_code": "1234567890", "default": True} - bank.post(data) + >>> import superfaktura.bank_account + >>> # Create an instance of BankAccount + >>> bank = superfaktura.bank_account.BankAccount() + >>> # Retrieve a list of bank accounts + >>> accounts = bank.list() + >>> # Get the default bank account + >>> default_account = bank.default() + >>> # Create or update a bank account + >>> data = {"account": "1234567890", "bank_code": "1234567890", "default": True} + >>> bank.post(data) """ import json @@ -84,11 +80,11 @@ class BankAccount(SuperFakturaAPI): - post: Creates or updates a bank account. Usage: - bank = BankAccount() - accounts = bank.list() - default_account = bank.default() - data = {"account": "1234567890", "bank_code": "1234567890", "default": True} - bank.post(data) + >>> bank = BankAccount() + >>> accounts = bank.list() + >>> default_account = bank.default() + >>> data = {"account": "1234567890", "bank_code": "1234567890", "default": True} + >>> bank.post(data) """ def __init__(self): diff --git a/superfaktura/invoice.py b/superfaktura/invoice.py index 56d4c79..da1caea 100644 --- a/superfaktura/invoice.py +++ b/superfaktura/invoice.py @@ -16,38 +16,35 @@ Functions: - (none) Usage: - import superfaktura.invoice - - # Create an instance of Invoice - invoice = superfaktura.invoice.Invoice() - - # Create an invoice - invoice.add( - invoice=superfaktura.invoice.InvoiceModel( - type=superfaktura.invoice.InvoiceType.PROFORMA, - name="Invoice 3", - due=superfaktura.invoice.Date("2025-02-01"), - invoice_currency=superfaktura.invoice.Currencies.CZK, + >>> import superfaktura.invoice + >>> # Create an instance of Invoice + >>> invoice = superfaktura.invoice.Invoice() + >>> # Create an invoice + >>> invoice.add( + invoice_model=InvoiceModel( + type=InvoiceType.INVOICE, + name="My First Invoice", + due=Date("2025-04-01"), + invoice_currency=Currencies.EUR, header_comment="We invoice you for services", bank_accounts=[bank.default().as_dict()], ), items=[ - superfaktura.invoice.InvoiceItem(name="Services", unit_price=100, quantity=1, - unit="ks", tax=21), - superfaktura.invoice.InvoiceItem(name="SIM card", unit_price=50, quantity=1, - tax=21, unit="ks"), - superfaktura.invoice.InvoiceItem( - name="SIM card 2", unit_price=75, quantity=1, tax=21, unit="ks" + InvoiceItem( + name="Website Development", unit_price=1000.0, quantity=1, tax=20 + ), + InvoiceItem( + name="Hosting Service (1 year)", unit_price=500.0, quantity=1, tax=20 ), ], - contact=superfaktura.client_contacts.ClientContactModel( - name="Richard Kubíček", - email="kubicekr@eledio.com", - phone="+420 123 456 789", - address="Jaroslava Foglara 861/1", - ico="123", + contact=ClientContactModel( + name="John Doe", + email="john.doe@examle.com", + phone="+1 555-1234", + address="123 Main Street, New York", + ico="987654321", update=True, - country_id=57, + country_id=225, ), ) """ @@ -217,31 +214,32 @@ class Invoice(SuperFakturaAPI): - update: Updates an existing invoice. Usage: - invoice = Invoice() - invoice.add( - invoice=InvoiceModel( - type=InvoiceType.PROFORMA, - name="Invoice 3", - due=Date("2025-02-01"), - invoice_currency=Currencies.CZK, + >>> invoice = Invoice() + >>> invoice.add( + invoice_model=InvoiceModel( + type=InvoiceType.INVOICE, + name="My First Invoice", + due=Date("2025-04-01"), + invoice_currency=Currencies.EUR, header_comment="We invoice you for services", bank_accounts=[bank.default().as_dict()], ), items=[ - InvoiceItem(name="Services", unit_price=100, quantity=1, unit="ks", tax=21), - InvoiceItem(name="SIM card", unit_price=50, quantity=1, tax=21, unit="ks"), InvoiceItem( - name="SIM card 2", unit_price=75, quantity=1, tax=21, unit="ks" + name="Website Development", unit_price=1000.0, quantity=1, tax=20 + ), + InvoiceItem( + name="Hosting Service (1 year)", unit_price=500.0, quantity=1, tax=20 ), ], contact=ClientContactModel( - name="Richard Kubíček", - email="kubicekr@eledio.com", - phone="+420 123 456 789", - address="Jaroslava Foglara 861/1", - ico="123", + name="John Doe", + email="john.doe@examle.com", + phone="+1 555-1234", + address="123 Main Street, New York", + ico="987654321", update=True, - country_id=57, + country_id=225, ), ) """ diff --git a/superfaktura/superfaktura_api.py b/superfaktura/superfaktura_api.py index 40636b0..5de564f 100644 --- a/superfaktura/superfaktura_api.py +++ b/superfaktura/superfaktura_api.py @@ -14,16 +14,13 @@ Functions: - post: Creates or updates data in the SuperFaktura API. Usage: - import superfaktura.superfaktura_api - - # Create an instance of SuperFakturaAPI - api = superfaktura.superfaktura_api.SuperFakturaAPI() - - # Retrieve data from the SuperFaktura API - data = api.get('endpoint') - - # Create or update data in the SuperFaktura API - api.post('endpoint', data) + >>> import superfaktura.superfaktura_api + >>> # Create an instance of SuperFakturaAPI + >>> api = superfaktura.superfaktura_api.SuperFakturaAPI() + >>> # Retrieve data from the SuperFaktura API + >>> incoming_data = api.get('endpoint') + >>> # Create or update data in the SuperFaktura API + >>> api.post('endpoint', outgoing_data) """ import os