Python SDK for Datalogics shipping API
Project description
datalogic-sdk
Python SDK for the Datalogics shipping API.
Documentation
- Usage guide: how to use this Python SDK.
- SDK API reference: Python classes, methods, return values, and exceptions.
- OpenAPI contract: raw Datalogics HTTP API contract for
POST /rest/w_create_shipping.
The OpenAPI file documents the vendor HTTP endpoint, not the Python SDK itself. It is included as a reference for API tooling, contract review, mock servers, or future code generation. The SDK does not load it at runtime.
Installation
From this repository:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install .
This project currently has no third-party runtime dependencies. The
requirements.txt file is intentionally empty except for a comment.
If you only want to run from a checkout without installing:
PYTHONPATH=src python -m unittest discover -s tests
Development
Install the SDK and dev tooling inside a virtual environment:
make install
Available commands:
make format
make lint
make typecheck
make test
make package
make package builds the source distribution and wheel into dist/.
CI/CD
GitHub Actions workflows live in .github/workflows/.
ci.ymlruns on pushes tomain, pull requests tomain, and manual dispatch. It installs the package with dev tooling, then runs lint, typecheck, tests, and package build across Python 3.9 through 3.13.release.ymlruns on tags matchingv*and manual dispatch. It runs the same checks, buildsdist/, uploads the distribution files as a workflow artifact, creates a GitHub Release for tag builds, and publishes to PyPI through Trusted Publishing.- PyPI publishing does not use a stored API token. Configure a pending trusted
publisher in PyPI with these values:
- PyPI project name:
datalogic-sdk - Owner:
yair-ros - Repository name:
datalogic-sdk - Workflow name:
release.yml - Environment name:
pypi
- PyPI project name:
To create a GitHub Release, bump the version in pyproject.toml, then push a
matching tag:
git tag v0.1.0
git push origin v0.1.0
Usage
from datalogic_sdk import DatalogicClient, Order, Origin, ShippingDetails
client = DatalogicClient("YOUR_AUTHENTICATION_TOKEN")
response = client.create_shipping(
order=Order(
id=123,
number="ORD-123",
shipping=ShippingDetails(
street="Herzl",
city="Tel Aviv",
first_name="Dana",
last_name="Cohen",
postcode="6100000",
house="10",
apartment="3",
phone="0501234567",
# Use n_code only when the customer chose a pickup location.
n_code="PICKUP_LOCATION_ID",
),
comment="Leave at reception",
),
origin=Origin(
contract="1234",
company_name="Acme Ltd",
city="Jerusalem",
street="Jaffa",
house="1",
phone="021234567",
email="ops@example.com",
),
)
print(response.status_code)
print(response.data)
Validation
The SDK validates the request before sending it:
tokenis required.order.idandorder.numberare required.- Required shipping fields:
street,city,first_name,last_name,house,phone. - Optional shipping fields:
postcode,apartment,n_code. origin.contractmust be exactly 4 characters.- Required origin fields:
company_name,city,street,house,phone,email.
Error Handling
from datalogic_sdk import DatalogicAPIError, DatalogicValidationError
try:
response = client.create_shipping(order=order, origin=origin)
except DatalogicValidationError as exc:
print(f"Invalid request: {exc}")
except DatalogicAPIError as exc:
print(f"API error {exc.status_code}: {exc.response_body}")
Endpoint
By default the client calls:
https://connect.datalogics.co.il/rest/w_create_shipping
You can override the base URL for testing:
client = DatalogicClient("token", base_url="https://example.test")
Project details
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 datalogic_sdk-0.1.0.tar.gz.
File metadata
- Download URL: datalogic_sdk-0.1.0.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9fa63ab9fcfd290baa400f248b9abe1737e5436693d4320205db5b6b2b733e5d
|
|
| MD5 |
2e8ac974da46588b0f03238dd547f024
|
|
| BLAKE2b-256 |
8557ebd1fae18a844ca0acd195dc583b7032f5998aea7d02bb79df2533a44406
|
Provenance
The following attestation bundles were made for datalogic_sdk-0.1.0.tar.gz:
Publisher:
release.yml on yair-ros/datalogic-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
datalogic_sdk-0.1.0.tar.gz -
Subject digest:
9fa63ab9fcfd290baa400f248b9abe1737e5436693d4320205db5b6b2b733e5d - Sigstore transparency entry: 1448983455
- Sigstore integration time:
-
Permalink:
yair-ros/datalogic-sdk@5b29a0b4e63a99b454bbec2b1ec92fd9f38faa7e -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/yair-ros
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5b29a0b4e63a99b454bbec2b1ec92fd9f38faa7e -
Trigger Event:
push
-
Statement type:
File details
Details for the file datalogic_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: datalogic_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15d4bb655d35ad64383b983b9fff1b68019f5038c08a8cf089affb94b22d0153
|
|
| MD5 |
f0350817cccb726c7c96ca6c0a965d17
|
|
| BLAKE2b-256 |
dfc0ba061d17c5a2dce43e901c553fb51ceb113d54cc1e00175883dd683e2bc0
|
Provenance
The following attestation bundles were made for datalogic_sdk-0.1.0-py3-none-any.whl:
Publisher:
release.yml on yair-ros/datalogic-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
datalogic_sdk-0.1.0-py3-none-any.whl -
Subject digest:
15d4bb655d35ad64383b983b9fff1b68019f5038c08a8cf089affb94b22d0153 - Sigstore transparency entry: 1448983515
- Sigstore integration time:
-
Permalink:
yair-ros/datalogic-sdk@5b29a0b4e63a99b454bbec2b1ec92fd9f38faa7e -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/yair-ros
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5b29a0b4e63a99b454bbec2b1ec92fd9f38faa7e -
Trigger Event:
push
-
Statement type: