idi-sanmar-sdk
A typed Python SDK for SanMar: its own web services, its PromoStandards web services, and the data and order files on its SFTP server.
- Strict in, typed out. Orders and lookups are validated Pydantic models, so a bad
address or a comma in a PO number fails before anything is sent. Responses come back as
typed records, with prices as
Decimal. - No SOAP or file layouts to learn. Each call is shaped into SanMar's payload in one place, including the PromoStandards fields SanMar requires and then ignores.
- Streams. SFTP files are parsed row by row as they download, zip archives included.
Documentation: https://impressdesigns.dev/sanmar-sdk/
Install
uv add idi-sanmar-sdk
Python 3.14 or newer. SanMar's web services listen on port 8080, and its SFTP server on port 2200; some networks block both.
Quick start
from sanmar_sdk import SanMar, ShipMethod, ShipTo
from sanmar_sdk.promostandards import PromoStandardsOrder, PromoStandardsOrderLine
sanmar = SanMar(123456, "sanmar-username", "sanmar-password")
# Look a style up, and check stock for one of its parts.
product = sanmar.promostandards.product_data.get("K500")
[stock] = sanmar.promostandards.inventory.get("K500", part_ids=["208284"])
# Place an order.
order = PromoStandardsOrder(
po_number="85496",
ship_to=ShipTo(address1="1404 W MAIN ST", city="CARROLLTON", state="TX", zip_code="75006"),
ship_method=ShipMethod.UPS_GROUND,
lines=[PromoStandardsOrderLine(part_id="208284", quantity=12)],
)
transaction_id = sanmar.promostandards.purchase_orders.send(order)
Reading the catalog over SFTP:
from sanmar_sdk.ftp import SanMarFTP
with SanMarFTP(123456, "ftp-password", host_key="ssh-rsa AAAA...") as ftp, ftp.catalog() as products:
for product in products:
print(product.style, product.catalog_color, product.size, product.unique_key)
Colors in requests and orders are SanMar's catalog colors (SANMAR_MAINFRAME_COLOR),
not the display names in COLOR_NAME. The SDK calls them catalog_color everywhere; see
Identifiers.
Sources
Written against these revisions of SanMar's integration guides:
| Guide | Version | Updated |
|---|---|---|
| SanMar Web Services Integration Guide | 24.6 | August 2026 |
| SanMar Purchase Order Integration Guide | 24.5 | August 2026 |
| SanMar FTP Integration Guide | 23.6 | August 2026 |
Where the guides contradict themselves, the SDK follows SanMar's own WSDLs and file
headers, recorded in tests/. The
Sources page lists each case.
Development
uv sync --all-groups
uv run nox -s lints tests
The live suite calls SanMar's real services, read-only:
SANMAR_LIVE=1 SANMAR_CUSTOMER_NUMBER=... SANMAR_USERNAME=... SANMAR_PASSWORD=... \
uv run pytest tests/live
Metadata
Release files for idi-sanmar-sdk 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| idi_sanmar_sdk-1.0.0.tar.gz | 57.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| idi_sanmar_sdk-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 137.1 kB
Release files / idi_sanmar_sdk-1.0.0.tar.gz
| Download URL | idi_sanmar_sdk-1.0.0.tar.gz |
|---|---|
| Size | 57.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
48d8b6f7eef9f01f701a519c95b36f659e0c172aec24ab4ca682170edb4468b9
|
|
BLAKE2b-256 checksum How to use checksums |
b8f73339b1b9c58805127369953e844e58f52831506cb031c6ebe295120ed2e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency logRelease files / idi_sanmar_sdk-1.0.0-py3-none-any.whl
| Download URL | idi_sanmar_sdk-1.0.0-py3-none-any.whl |
|---|---|
| Size | 79.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ded44c1b27334093c6c5abf80e6ac39a6b63ba31ca0d3c8da8dd534bbf5a450e
|
|
BLAKE2b-256 checksum How to use checksums |
45e6bed6157a27281ffd633cb73e0c63b8bf914ff1cc951f729f98d2b75930ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency log