Skip to main content

Shared API contract (auth, api-fetch, request/response types) for CCP4i2 and consumers

Project description

@ccp4/ccp4i2-api / ccp4i2-api

Shared API contract for CCP4i2 and consumers (CCP4i2 Compounds, third-party integrators) — auth handshake, api-fetch helpers, and request/response types. One package, two language artifacts: TypeScript on the client side (browser, Electron) and Python on the server side (Django middleware, DRF authentication). Both halves agree on the canonical bearer-token format, 401 response shape, and the typed payloads carried over the authenticated channel.

Status

Draft v0 — published to npm + PyPI from the in-tree workspace. Source of truth lives at packages/ccp4i2-api/ inside the ccp4/ccp4i2 monorepo on the django-sliced branch. The npm scope @ccp4 and the PyPI name ccp4i2-api are CCP4-owned (claimed April 2026); a dedicated ccp4/ccp4i2-api GitHub repo may follow later but is not required while the monorepo hosts the source.

Versions 0.1.00.3.0 were published under the previous name @ccp4/ccp4i2-auth / ccp4i2-auth; the package was renamed at 0.3.0 because its scope had grown beyond auth to cover the broader API contract. The old name is unpublished/yanked; consumers should depend on @ccp4/ccp4i2-api and ccp4i2-api from 0.3.0 onward.

Versioning follows semver from 0.x.y onwards. The v0 contract is documented in docs/CCP4I2_SERVICE_CONTRACT.md; field stability promises take effect from this version.

Layout

Path Purpose
src/ TypeScript source. Built to lib/ via npm run build.
lib/ Built TypeScript output. Generated; gitignored.
dist/ Python distribution output (python -m build). Generated; gitignored. Kept distinct from lib/ so twine upload dist/* doesn't accidentally pick up TypeScript artefacts.
ccp4i2_api/ Python source. Installed editable via pip install -e ..
tests/js/ TypeScript tests (vitest, when added).
tests/python/ Python tests (pytest, when added).

Consumer wiring

In-monorepo consumers can reference this package by local path for fast iteration; out-of-monorepo consumers pull the published versions.

TypeScript — in-monorepo (client/package.json):

"dependencies": {
  "@ccp4/ccp4i2-api": "file:../packages/ccp4i2-api"
}

(Path depth varies by consumer location.) Out-of-monorepo consumers use the published range, e.g. "@ccp4/ccp4i2-api": "^0.3.0".

Python — in-monorepo (Docker/server/Dockerfile, local dev setup):

pip install -e packages/ccp4i2-api/

Out-of-monorepo consumers pip install ccp4i2-api>=0.3.

Development

# TypeScript
cd packages/ccp4i2-api
npm install
npm run build       # produces lib/
npm run watch       # rebuilds on change

# Python
cd packages/ccp4i2-api
ccp4-python -m pip install -e .
ccp4-python -c "import ccp4i2_api; print(ccp4i2_api.__version__)"

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

ccp4i2_api-0.3.4.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

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

ccp4i2_api-0.3.4-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file ccp4i2_api-0.3.4.tar.gz.

File metadata

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

File hashes

Hashes for ccp4i2_api-0.3.4.tar.gz
Algorithm Hash digest
SHA256 f1c945c1bda9988e00626fdd50a90d5c6c98eec5abd6dbe46de8502e8b93bdd1
MD5 dc41a17a57221c422b2ca51321b142e5
BLAKE2b-256 d2ef1cf0a5f683ebdb76a35274d74d1b5887a5e6e909ef71e3780bb31940a49e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ccp4i2_api-0.3.4.tar.gz:

Publisher: publish-ccp4i2-api.yml on ccp4/ccp4i2

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

File details

Details for the file ccp4i2_api-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: ccp4i2_api-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ccp4i2_api-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b1896686f311b3bfd3d2c9e081eb181b5b0540726ce9221c2a72540797aed714
MD5 86199fef10d76f24148048a2fc6b6d4e
BLAKE2b-256 9beab65b5d2dd431bc8d7ff55631d90a8f49b6b1bbfc2dd3d1c13a09bec1f08e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ccp4i2_api-0.3.4-py3-none-any.whl:

Publisher: publish-ccp4i2-api.yml on ccp4/ccp4i2

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