Andreani SDK for python
Project description
andreani
This is a Python module that provides a class called SDK for interacting with the Andreani API. The SDK class has several methods that allow users to login, estimate shipping fees, retrieve shipping labels, and submit shipments to Andreani.
SDK class:
-
login(username: str, password: str) -> typing.Optional[LoginResponse]: This method logs in to the Andreani API using the provided username and password. It returns a LoginResponse object if the login was successful, or raises an AndreaniException if there was an error. -
estimate_price(postalcode: str, contract: str, client: str, office: str, order: Order) -> typing.Optional[FeesResponse]: This method estimates the shipping fees for a given postalcode, contract, client, office, and order. It returns a FeesResponse object if the request was successful, or raises an AndreaniException if there was an error. -
submit_shipment(shipment: Shipment) -> typing.Optional[SubmitShipmentResponse]: This method submits a shipment to Andreani. It returns a SubmitShipmentResponse object if the request was successful, or raises an AndreaniException if there was an error. -
get_shipment_status(shipment_number: str) -> typing.Optional[SubmitShipmentResponse] -
get_label(url:str, save: bool = False, filename: str = None): This method fetches the label for a shipment in pdf format. If thesaveparameter isTrue, the method writes the content of the response to a file with the specifiedfilename. Ifsaveis not provided or isFalse, the method returns the content of the response as bytes.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
This software is distributed under the MIT licence. See LICENCE for details.
Copyright (c) 2021-2022 Juan Pablo Senn juanpsenn@gmail.com
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file andreani-1.0.0.tar.gz.
File metadata
- Download URL: andreani-1.0.0.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9954695d2642cb68de1c141cd4c039142dfe4668360cd31a9d076cbe7e60d2d3
|
|
| MD5 |
781baa223598122d601f608e31f9dba2
|
|
| BLAKE2b-256 |
eb8f04ff1dca6e067efaf0df690856137179a8109c6da1b05f006ad99c1656de
|
File details
Details for the file andreani-1.0.0-py3-none-any.whl.
File metadata
- Download URL: andreani-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed5599ddba841d68a7c85a4a924786154fa823073e1a6381e261166508a4b4ce
|
|
| MD5 |
874bc0fa45be0ac5e4b3277957c45695
|
|
| BLAKE2b-256 |
88347a625cc9317b9a50fe8728f2abf085fb5d44c7dfe8e01a56daaea4e21d42
|