Production-grade Python SDK for SHIP Israel API
Project description
ship-il-sdk
Independent/community Python SDK for the SHIP Israel API.
This is not an official SHIP SDK. It is an independent/community project.
PyPI: https://pypi.org/project/ship-il-sdk/
Documentation
- Usage guide: how to use this Python SDK.
- SDK API reference: Python classes, methods, return values, and exceptions.
- OpenAPI contract: raw SHIP HTTP API contract for the endpoints currently wrapped by this SDK.
- SHIP Authentication wiki
- SHIP Shipments wiki
- SHIP Booking wiki
- Contributing guide
- Changelog
- Security policy
The OpenAPI file documents the vendor HTTP endpoints, 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 PyPI:
python -m pip install ship-il-sdk
From this repository:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install .
If you only want to run from a checkout without installing:
PYTHONPATH=src python -m pytest -q
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:
ship-il-sdk - Owner:
yair-ros - Repository name:
ship-il-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 ship_il_sdk import (
Environment,
ShipClient,
build_consignee_address,
build_pickup_shipment_request_from_point,
build_shipment_preparation,
)
client = ShipClient(
username="YOUR_USERNAME",
password="YOUR_PASSWORD",
customer_id="YOUR_CUSTOMER_ID",
environment=Environment.DEV,
)
points = client.points.get_closest_points(
city="Tel Aviv",
street="Herzl",
house_number="10",
)
consignee = build_consignee_address(
city_name="Tel Aviv",
street_name="Herzl",
house_number="10",
contact_person="Dana Cohen",
customer_name="Dana Cohen",
phone1="0501234567",
)
preparation = build_shipment_preparation(
consignee_address=consignee,
number_of_packages=1,
reference1="ORDER-123",
)
shipment = build_pickup_shipment_request_from_point(
preparation=preparation,
pickup_point=points.Points[0],
)
response = client.shipments.insert_pickup_shipment(shipment)
print(response.Result.TrackingNumber)
Additional shipment operations currently exposed by the SDK:
insert_standard_shipment(...)insert_pickup_shipment(...)insert_pickup_drop_shipment(...)insert_picking_list(...)print_wb_order_details(...)get_wb_status(...)get_pricing(...)
Booking operations currently exposed by the SDK:
get_pickup_dates(...)get_pickup_times(...)insert_domestic_booking(...)insert_export_booking(...)cancel_booking(...)
The repository no longer keeps standalone example scripts under examples/.
Use scripts/integration_test.py for real DEV verification and docs/usage.md
for copy-paste SDK usage patterns.
Supported Workflow
The SDK supports a generic flow that does not depend on any specific commerce platform:
- authenticate
- find closest pickup points
- build a shipment draft
- manually or heuristically choose a pickup point
- create the shipment
- download the label
For conservative automatic recommendation, use recommend_pickup_point(...).
If it returns None, require manual pickup selection.
Official API References
The SDK implementation should be reviewed against the official SHIP docs:
- Authentication: wiki.ship.co.il/en/api/Authentication
- Shipments: wiki.ship.co.il/en/api/Shipments
- Booking: wiki.ship.co.il/en/api/Booking
Error Handling
from ship_il_sdk import Environment, ShipClient
from ship_il_sdk.exceptions import AuthenticationError, ShipAPIError
client = ShipClient(
username="YOUR_USERNAME",
password="YOUR_PASSWORD",
customer_id="YOUR_CUSTOMER_ID",
environment=Environment.DEV,
)
try:
client.login()
except AuthenticationError as exc:
print(f"Authentication failed: {exc}")
try:
points = client.points.get_closest_points(
city="Tel Aviv",
street="Herzl",
house_number="10",
)
except ShipAPIError as exc:
print(f"API error: {exc}")
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 ship_il_sdk-0.2.3.tar.gz.
File metadata
- Download URL: ship_il_sdk-0.2.3.tar.gz
- Upload date:
- Size: 20.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6a12d6cb4d9b67a4d4f108dda4bb3c7b28768fa023e56128f4537fd1555bf0e
|
|
| MD5 |
7bb85326ed3b2fb5c02f37b806444182
|
|
| BLAKE2b-256 |
6b48a775ce7c2649a354434e32552fd0979b089b625a5043cb2ae2fb069f08f3
|
Provenance
The following attestation bundles were made for ship_il_sdk-0.2.3.tar.gz:
Publisher:
release.yml on yair-ros/ship-il-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ship_il_sdk-0.2.3.tar.gz -
Subject digest:
a6a12d6cb4d9b67a4d4f108dda4bb3c7b28768fa023e56128f4537fd1555bf0e - Sigstore transparency entry: 1591859178
- Sigstore integration time:
-
Permalink:
yair-ros/ship-il-sdk@13d83461572b6a85ff0abe90b172efd6b12499c7 -
Branch / Tag:
refs/tags/v0.2.3 - Owner: https://github.com/yair-ros
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@13d83461572b6a85ff0abe90b172efd6b12499c7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ship_il_sdk-0.2.3-py3-none-any.whl.
File metadata
- Download URL: ship_il_sdk-0.2.3-py3-none-any.whl
- Upload date:
- Size: 18.4 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 |
52851591059c728a603096b54340763179bdaf69e041422d944a72478165121a
|
|
| MD5 |
b7fc0ba2bfd08af637c21fdc0684774a
|
|
| BLAKE2b-256 |
6ad8040a4b338f35000e8d8d648c51ee19e3d435d133e3409d5bc8c52c771adc
|
Provenance
The following attestation bundles were made for ship_il_sdk-0.2.3-py3-none-any.whl:
Publisher:
release.yml on yair-ros/ship-il-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ship_il_sdk-0.2.3-py3-none-any.whl -
Subject digest:
52851591059c728a603096b54340763179bdaf69e041422d944a72478165121a - Sigstore transparency entry: 1591859191
- Sigstore integration time:
-
Permalink:
yair-ros/ship-il-sdk@13d83461572b6a85ff0abe90b172efd6b12499c7 -
Branch / Tag:
refs/tags/v0.2.3 - Owner: https://github.com/yair-ros
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@13d83461572b6a85ff0abe90b172efd6b12499c7 -
Trigger Event:
push
-
Statement type: