📦📦 pplmyapi (Python PPL myAPI wrapper)
Czech PPL (Professional Parcel Logistic) API wrapper written in Python. Helps you to communicate with PPL myAPI without worring about fetching access tokens and constructing your own requests. All (hopefully) done for you in the background.
Install it from PyPI
pip install pplmyapi
Usage
This is still a work in progress, so the API might change in the future. However, the basic usage is as follows:
- Create a
PPLinstance with your credentials - obtain a
RESTConnectorinstance from thePPLinstance. - use the
RESTConnectorinstance to communicate with the PPL REST API (myAPI2)
Send a package
# Create Package instance with all the required data and 6 packages in the set
package = Package(
reference_id="123456789",
package_product_type=Product.PPL_PARCEL_CZ_PRIVATE_COD,
note = "test",
recipient=Recipient(
name="John Doe",
city="Hradec Králové",
street="Hlavní 1",
zip_code="50001",
phone="123456789",
email="j.doe@example.com",
country = 'CZ'
),
sender=Sender(
name="Test s.r.o.",
street="Testovací 55/36",
city="Praha",
zip_code="11000",
country="CZ",
),
payment_info=PaymentInfo(
cod_price=100,
cod_currency='CZK',
cod_vs='123456789',
insurance_price=100,
insurance_currency='CZK',
specific_symbol='123456',
bank_account='123456789',
bank_code='0300'
),
weighted_package_info=WeightedPackageInfo(
weight=10.22,
),
package_set=(
PackageSet(
total_packages = 6,
)
),
flags=[
PackageFlag(
code=Flag.CL,
value=True
)
],
)
# create packages
packages = [package]
# create rest_connector
rest_con = ppl.connector()
# create rest_action
response = rest_con.post_shipments(
packages=packages,
file_path = './out_test',
file_name = 'test_010223.pdf',
)
Response from the API is a dictionary containing the following keys:
labels: base64 encoded labels from the API (all together)packages: list ofPackageinstances (initionaly passed to thepost_shipmentsfunction) with extendedshipment_numberattribute,label_base64attribute (with single label) and extendedpackage_setattribute (withrelated_packagesattribute containing list ofPackageinstances related to the current package with the samereference_idattribute but differentshipment_numberattribute)
Get label for a package
# TODO
Development
If you're keen on contributing to this project, you can do so by forking this repository and creating a pull request. Please make sure to follow the PEP8 style guide.
Metadata
Release files for pplmyapi 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pplmyapi-0.0.7.tar.gz | 23.0 kB | Without provenance | Details for pplmyapi-0.0.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pplmyapi-0.0.7-py3-none-any.whl | Python 3 | none | any | Details for pplmyapi-0.0.7-py3-none-any.whl |
Total release size: 54.1 kB
Release files / pplmyapi-0.0.7.tar.gz
| Download URL | pplmyapi-0.0.7.tar.gz |
|---|---|
| Size | 23.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a68dc22c0b8af6e3b148b78124b91ea1c6e13a46050c6314287d4ddd5381dbc5
|
|
BLAKE2b-256 checksum How to use checksums |
b8688df50eef6ef35927969e4fa4190ae2e0085b354f46a9982bb1de8c2b6cc5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.10
|
Release files / pplmyapi-0.0.7-py3-none-any.whl
| Download URL | pplmyapi-0.0.7-py3-none-any.whl |
|---|---|
| Size | 31.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
54d9cfa5834a85bf8ec67031f724ea4170d64ac76685d6dd87bc84f8159cbf5b
|
|
BLAKE2b-256 checksum How to use checksums |
3a2951fba991c0fe1eefbc70f0e973b62df111ff1c2b9fd3db1ccbfe472833bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.10
|
Security for pplmyapi 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.