Skip to main content

i4u

Latest Release i4u on pypi MIT License unittests Status Coverage Status

Python package to interact with Invoice4U API

Invoice4U API natively uses wsdl soap, so to interact with it this package is built based on zeep with additional data structures that allow easier interaction

Installation

i4u on pypi

pip install i4u

Or to use as source

git clone https://github.com/ofersadan85/i4u.git
cd i4u
pip install -r requirements.txt

Requirements

Tested with python 3.6-3.10, on both Windows 10 and Ubuntu 20.04. Should (in theory) work on other operating systems. If you wish to create a pull request to add tests / modifications that verify it is able to work on other python versions or operating systems, see the Contributing section below

If you want to install this package from source you need to run pip install zeep first and pip install requests if you need to have download functionality for files. For everything, simply use:

pip install -r requirements.txt

See requirements.txt

Python 3.6 only also requires dataclasses (pip install dataclasses)

Usage Examples

To connect and authenticate you must first create an Invoice4U instance with your username and password provided (this assumes you have an account set up on Invoice4U)

from i4u import Invoice4U
i4u_api = Invoice4U('your_user', 'your_password')

If you don't have API access yet, or you just want to test out the code, you may test the API usage with these test credentials

from i4u import Invoice4U
i4u_api = Invoice4U('Test@test.com', '123456')

To verify that you're logged in correctly, check that you received a token

if i4u_api.token is None:
    print('Username or password are incorrect')
else:
    print('Login success')

To get a list of all customers belonging to your organisation:

customers = i4u_api.get_all_customers()

You can edit and save customer details:

customers = i4u_api.customers()
c = customers[6]
c.Email = 'some_other_email@mail.com'
c.Fax = '1800123456789'
i4u_api.update_customer(c)

You can also create a new customer:

from i4u.classes import Customer

new_customer = Customer('Elon Musk', City='Jerusalem')
created = i4u_api.create_customer(new_customer)
print(created.ID)  # Check the system generated ID of the new customer if needed

Similarly, you can create new documents along with new customers in the same call:

from i4u.classes import InvoiceOrder, DocumentItem, Customer

customer = Customer('Joe Smith')  # Create a new client while creating the document
products = [
    DocumentItem(Price=30, Name='Chair', Qunatity=2),
    DocumentItem(Price=50, Name='Table', Qunatity=1),
]
new_invoice_order = InvoiceOrder(Subject='Furniture', Items=products, NewCustomer=customer)
created_doc = i4u_api.create_document(new_invoice_order)
print(created_doc.Total)  # Will print 110 (30 * 2 + 50)

Alternatively, create the same document for an existing customer:

new_invoice_order = InvoiceOrder(Subject='Furniture', Items=products, ClientID=customer.ID)
created_doc = i4u_api.create_document(new_invoice_order)

You can also download the document:

i4u_api.download_document(doc=created_doc, destination='/some/folder')

More examples of document types you can create will be added here soon!

The basic API exposed by zeep can be reached via the service property, usually including the token. This allows you to access API functions that are not yet available with this package, and can also help if you need to get the raw data returned by zeep. For example:

raw_document = i4u_api.service.GetDocumentByNumber(doc.DocumentNumber, doc.DocumentType, i4u_api.token)

Contributing

For bugs / feature requests please submit issues

Open Issues Closed Issues

If you would like to contribute to this project, you are welcome to submit a pull request

Open Pull Requests Closed Pull Requests

In order to add features not yet available in this package but that are possible with Invoice4U API in principle, please refer to the official Invoice4U API documentation

Warranty / Liability / Official support

This project is being developed independently of Invoice4U and not supported officially by them, we provide the package "as-is" without any implied warranty or liability, usage is your own responsibility

Additional info

Just because I like badges

Pypi downloads per month Pypi downloads per week Pypi downloads per day

Metadata

Release files for i4u 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for i4u 0.0.7
File Size Uploaded Provenance Actions
i4u-0.0.7.tar.gz 7.3 kB Without provenance Details for i4u-0.0.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for i4u 0.0.7
File Interpreter ABI Platform Actions
i4u-0.0.7-py3-none-any.whl Python 3 none any Details for i4u-0.0.7-py3-none-any.whl

Total release size: 14.9 kB

Release files / i4u-0.0.7.tar.gz

Download URL i4u-0.0.7.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2cb6e57909f10386328773f0b72e1a36604c5f99db3addc8171df3b237ab9b10
BLAKE2b-256 checksum
How to use checksums
be1d6148ac84f03814dff5171ee9d8dfd900b04cc1d04a91c1b3bae80f1e8377
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

Release files / i4u-0.0.7-py3-none-any.whl

Download URL i4u-0.0.7-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
497842a1ec808d1210868aa891ed1a0197cc8ce0a21b9dc157360a283601000d
BLAKE2b-256 checksum
How to use checksums
ddb35f7a9f4b4d7fea1f97d48b9890338f2adbd3154cbb47b437675fca7a489e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

Security for i4u 0.0.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page