Skip to main content

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.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for idi-sanmar-sdk 1.0.1
File Size Uploaded Provenance Actions
idi_sanmar_sdk-1.0.1.tar.gz 60.8 kB With provenance Details for idi_sanmar_sdk-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for idi-sanmar-sdk 1.0.1
File Interpreter ABI Platform Actions
idi_sanmar_sdk-1.0.1-py3-none-any.whl Python 3 none any Details for idi_sanmar_sdk-1.0.1-py3-none-any.whl

Total release size: 140.6 kB

Release files / idi_sanmar_sdk-1.0.1.tar.gz

Download URL idi_sanmar_sdk-1.0.1.tar.gz
Size 60.8 kB
Tags Source
SHA-256 checksum
How to use checksums
bc294a27da54c937eb7ce293765d743167407cf86d7fa783d08947c1fbf077bb
BLAKE2b-256 checksum
How to use checksums
96da9c7be02294182530cf8fe1e1939b8bc9a358a23e9a713857000de3737912
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 29, 2026.

Transparency log

Release files / idi_sanmar_sdk-1.0.1-py3-none-any.whl

Download URL idi_sanmar_sdk-1.0.1-py3-none-any.whl
Size 79.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e830a979729d0ab8d3762ce030cad5e3ab2a16382f976b5234412ffa91e7b31b
BLAKE2b-256 checksum
How to use checksums
27d51aad3b2fc0e698a2852725f6a17ae838df78ad6a91b27836fdfe0563583b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 29, 2026.

Transparency log

Security for idi-sanmar-sdk 1.0.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for idi_sanmar_sdk-1.0.1.tar.gz

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 Nov 29, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page