Skip to main content

Supply Chain Monkey contract, client, and server

Project description

Supply Chain Monkey

          ▓▓▓▓▓▓▓▓▓▓
        ▓▓▓▓▓▓▓▓▓▓▓▓▓▓
      ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
    ▓▓▓▓░░░░░░▓▓░░░░░░▓▓▓▓
░░░░▓▓░░░░░░░░░░░░░░░░░░▓▓░░░░
░░░░▓▓░░██  ░░░░░░██  ░░▓▓░░░░
  ░░▓▓░░████░░░░░░████░░▓▓░░
    ▓▓░░░░░░░░░░░░░░░░░░▓▓
      ▓▓░░░░░░░░░░░░░░▓▓
        ▓▓▓▓░░░░░░▓▓▓▓
            ▓▓▓▓▓▓          ░░
          ▓▓▓▓▓▓▓▓▓▓      ▓▓
          ▓▓▓▓▓▓▓▓▓▓    ▓▓▓▓
        ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
        ▓▓▓▓░░▓▓░░▓▓▓▓

Internal service for querying electronic component suppliers. It provides a unified HTTP API that centralizes vendor credentials and provider routing.

Status

2026.6.16 - SPN lookup API, supplier capability metadata, JLCPCB/LCSC search updates, and live supplier validation.

The PyPI distribution is supply-chain-monkey. The Python import package is scm.

Architecture

The repo contains three layers:

  • scm.models: shared contract with Pydantic models, enums, and supplier constants.
  • scm.client: HTTP client library for consumers.
  • scm.server: FastAPI server with provider adapters and the status page.

Providers

Supplier Backend Credentials Required
JLCPCB Hybrid official API plus scraper Optional; scraper works without credentials
LCSC Internal JSON API None
Digikey Official REST API v4 OAuth2 Yes
Mouser Official REST API v1 Yes

API

All endpoints except health require a bearer token.

GET  /v1/health
GET  /v1/providers/status
GET  /v1/search?supplier=jlcpcb&mpn=TPS543620RPYR
GET  /v1/detail?supplier=jlcpcb&part=C2870085
GET  /v1/spn?supplier=jlcpcb&spn=C2870085
POST /v1/spn/batch
GET  /v1/search/stream?mpn=X&token=Y

The streaming endpoint pushes results per provider as they complete via Server-Sent Events. It supports max_results and per-provider timeout.

The root URL serves a status page with an interactive test panel.

Client Library

Install the consumer client from PyPI:

python -m pip install "supply-chain-monkey[client]==2026.6.16"
from scm.client import SCMClient
from scm.models import PARAMETER_FIELD_NAMES, SUPPLIERS, SupplierType

client = SCMClient(url="https://your-scm.example.com", token="...")

result = client.search("jlcpcb", "TPS543620RPYR")
all_results = client.search_all("TPS543620RPYR")
detail = client.detail("jlcpcb", "C2870085")
print(SUPPLIERS)

Local Development

cp .env.template .env
# fill in SCM_SERVICE_TOKEN and any provider credentials

uv sync --group dev
PYTHONPATH=src/py uv run uvicorn scm.server.main:app --reload --env-file .env

Testing

uv run pytest -q
uv run rack run L99_signoff
uv run python tests/scripts/scm_test_cli.py --token YOUR_TOKEN
uv run python tests/scripts/scm_test_cli.py --url https://your-scm.example.com --token YOUR_TOKEN

Deployment

The included appliku.yml uses Appliku's managed python-3.13-uv build image. Pushing production can trigger deployment.

git checkout dev
# merge through PRs; do not develop directly on production

pyproject.toml must keep [tool.uv] package = false and default-groups = []. The Dockerfile is inactive unless appliku.yml changes to build_image: dockerfile. See CLAUDE.md for deployment constraints.

dev is the integration branch. main is the public source branch. production is the Wavenumber deployment branch and must be updated only by protected PR/merge flow.

Consumer Integration

Consumers should depend on the supply-chain-monkey[client] distribution and import scm. Configure service URL and token outside source control.

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

supply_chain_monkey-2026.6.16.tar.gz (639.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

supply_chain_monkey-2026.6.16-py3-none-any.whl (65.3 kB view details)

Uploaded Python 3

File details

Details for the file supply_chain_monkey-2026.6.16.tar.gz.

File metadata

  • Download URL: supply_chain_monkey-2026.6.16.tar.gz
  • Upload date:
  • Size: 639.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for supply_chain_monkey-2026.6.16.tar.gz
Algorithm Hash digest
SHA256 ddf36b9e2247204ed8e4c4e558063f427f49587d25ce35c88284e5cdc70ac26a
MD5 4c3b11113df1c1a8ae97698387737a72
BLAKE2b-256 3b434b2edfdd1860c9554e1c03146d4135c4516deaf86fca95946812708fd50f

See more details on using hashes here.

Provenance

The following attestation bundles were made for supply_chain_monkey-2026.6.16.tar.gz:

Publisher: release.yml on wavenumber-eng/supply-chain-monkey

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file supply_chain_monkey-2026.6.16-py3-none-any.whl.

File metadata

File hashes

Hashes for supply_chain_monkey-2026.6.16-py3-none-any.whl
Algorithm Hash digest
SHA256 bb1656bcc9f6a7e2f96388a032df35d586e071bbef8adfa1b853a475804b5c48
MD5 6ab12c3b0fd65c728b1ee3d8eaa9cc05
BLAKE2b-256 35e3b0a8070b18bf51d8053ff55ce40fba577424591fb2882371ddfcfccfa10c

See more details on using hashes here.

Provenance

The following attestation bundles were made for supply_chain_monkey-2026.6.16-py3-none-any.whl:

Publisher: release.yml on wavenumber-eng/supply-chain-monkey

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page