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.5 - standalone service, Python client, Appliku deployment signoff, and PyPI publishing setup.

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/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.5"
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.5.tar.gz (642.6 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.5-py3-none-any.whl (58.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: supply_chain_monkey-2026.6.5.tar.gz
  • Upload date:
  • Size: 642.6 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.5.tar.gz
Algorithm Hash digest
SHA256 51fe81e632feb4c4655ce2262ecffdb1d9eafd45c68855842a71f3a52cefd2a3
MD5 aeb92a0650e247fab93f7e332f09404d
BLAKE2b-256 de0b5f35fd0e87c59ca3f89d490c3c0f87843c6017f26f3571eaddb71b8e7581

See more details on using hashes here.

Provenance

The following attestation bundles were made for supply_chain_monkey-2026.6.5.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.5-py3-none-any.whl.

File metadata

File hashes

Hashes for supply_chain_monkey-2026.6.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c852a18e794909195d36660c176e70f37d35995ebe356b181c32449edd146b84
MD5 45d7e5eaa043f42aa25a0f23c755b25d
BLAKE2b-256 60f828dfdca967b2f072ceefad09f4428ac9e09da4e88bf75c620ed8fce78c11

See more details on using hashes here.

Provenance

The following attestation bundles were made for supply_chain_monkey-2026.6.5-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