Independent/community Python SDK for the Datalogics shipping API
Project description
datalogic-sdk
Independent/community Python SDK for the Datalogics shipping API.
This is not an official Datalogics SDK. It is an independent/community project.
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. - Contributing guide
- Changelog
- Security policy
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 check
make integration-test
make package
make release
make package builds the source distribution and wheel into dist/.
make release increments the latest vX.Y.Z tag by one patch version, updates
pyproject.toml, runs verification, commits the version bump, creates an
annotated tag, pushes the branch, and pushes the tag.
make check runs lint, typecheck, and tests.
make integration-test runs the real API integration script.
CI/CD
GitHub Actions workflows live in .github/workflows/.
ci.ymlruns on pull requests tomainand manual dispatch. It installs the package with dev tooling, then runs lint, typecheck, and tests across Python 3.9 through 3.13, and builds the package once on Python 3.13.release.ymlruns only on tags matchingv*. It runs the same checks, buildsdist/, uploads the distribution files as a workflow artifact, creates a GitHub Release, 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 and trigger PyPI publishing:
make release
If your virtual environment is not activated, pass the interpreter explicitly:
make release PYTHON=.venv/bin/python
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,
DatalogicClient,
DatalogicValidationError,
Order,
Origin,
ShippingDetails,
)
client = DatalogicClient("YOUR_AUTHENTICATION_TOKEN")
order = Order(
id=123,
number="ORD-123",
shipping=ShippingDetails(
street="Herzl",
city="Tel Aviv",
first_name="Dana",
last_name="Cohen",
house="10",
phone="0501234567",
),
)
origin = Origin(
contract="1234",
company_name="Acme Ltd",
city="Jerusalem",
street="Jaffa",
house="1",
phone="021234567",
email="ops@example.com",
)
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:
from datalogic_sdk import DatalogicClient
client = DatalogicClient("token", base_url="https://example.test")
Real API Test
The repository includes a local integration-test script:
PYTHONPATH=src python scripts/integration_test.py
The test reads local secrets and addresses from:
scripts/integration_test.env
That file is gitignored. The repository only includes:
scripts/integration_test.env.example
To use it:
- Copy
scripts/integration_test.env.exampletoscripts/integration_test.env. - Fill your real token and address data in
scripts/integration_test.env. - Set
DATALOGIC_CONFIRM_REAL_API_CALL=yesin that file. - Run
make integration-testorPYTHONPATH=src python scripts/integration_test.py. - Read the warning in the terminal and type
yesto approve the real shipment creation.
This can create a real shipment. Use a sandbox/test token if Datalogics provides one, and do not commit real tokens, customer phones, or real addresses.
The script fails fast if:
scripts/integration_test.envdoes not existDATALOGIC_CONFIRM_REAL_API_CALLis notyes- a required value is missing
- a required value is still one of the example placeholders such as
YOUR_TOKEN - the terminal confirmation is not explicitly approved
License
This project is licensed under the MIT license. See LICENSE.
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.3.tar.gz.
File metadata
- Download URL: datalogic_sdk-0.1.3.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b1055e65b2991c56d0032cefb3d47e92d2e7e92c41812ca19865ebbc81f582f
|
|
| MD5 |
54e5eaa2fcc0bba569579d194d072c52
|
|
| BLAKE2b-256 |
6e1941c0ead49cf304d841459d1d093b511afc99b8282cc69fdd560641d66ebd
|
Provenance
The following attestation bundles were made for datalogic_sdk-0.1.3.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.3.tar.gz -
Subject digest:
0b1055e65b2991c56d0032cefb3d47e92d2e7e92c41812ca19865ebbc81f582f - Sigstore transparency entry: 1547165185
- Sigstore integration time:
-
Permalink:
yair-ros/datalogic-sdk@d72bd3642fd8ec305ed3b18d4e98abb58cd473b5 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/yair-ros
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d72bd3642fd8ec305ed3b18d4e98abb58cd473b5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file datalogic_sdk-0.1.3-py3-none-any.whl.
File metadata
- Download URL: datalogic_sdk-0.1.3-py3-none-any.whl
- Upload date:
- Size: 8.6 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 |
bb60ade291c04f7b5910d49bbadc73613e1ea6af605aeba4e0981dbaf7724ef9
|
|
| MD5 |
54667a8159a24e0b773e6018217c784e
|
|
| BLAKE2b-256 |
32855e2ab82730ac9fc3c4eace3945bc73c33d3380f1209dd08419c9eb8dc689
|
Provenance
The following attestation bundles were made for datalogic_sdk-0.1.3-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.3-py3-none-any.whl -
Subject digest:
bb60ade291c04f7b5910d49bbadc73613e1ea6af605aeba4e0981dbaf7724ef9 - Sigstore transparency entry: 1547165210
- Sigstore integration time:
-
Permalink:
yair-ros/datalogic-sdk@d72bd3642fd8ec305ed3b18d4e98abb58cd473b5 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/yair-ros
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d72bd3642fd8ec305ed3b18d4e98abb58cd473b5 -
Trigger Event:
push
-
Statement type: