This release is a pre-release and may not be stable for production use.
coho-management-sdk
The Python management SDK for Coho: accounts, projects, branches, content,
releases and delivery keys. It is the library under the
coho CLI, and what CI scripts and notebooks
import directly.
Management, not delivery. This is what authors, release managers and CI use to move content through the pipeline; it speaks to the authoring side with a person's credential. A website that only needs to read published content wants the delivery SDK instead, which takes a project's delivery key and cannot promote anything. Shipping one package that knows how to promote to production to every website is exactly what these two names exist to prevent.
from coho_management_sdk import Coho
coho = Coho.from_profile("staging") # or Coho(url=..., token=...)
site = coho.account("acme").project("0192…")
dev = site.ref("dev")
post = dev.entries.get("0192…")
post.fields["title"]["en-US"] = "New title"
dev.entries.put(post) # sends If-Match from post.etag
site.tags.create("v1.4.0", branch="v0.0.x", description="Q3 catalogue")
site.environments.promote("qa", "v1.4.0", wait=True)
Install
pip install coho-management-sdk
pip install 'coho-management-sdk[keyring]' # read tokens the CLI put in the OS keyring
# coho_management_sdk.testing.FakeBff, for your own tests:
pip install 'coho-management-sdk[testing]'
Python 3.11+. Synchronous, built on httpx. Typed, and
mypy --strict passes on it.
Three rules
- Errors are the
code. Every failure raisesCohoErrorwith.code,.statusand the problem's context fields. Subclasses exist for the codes a caller branches on (VersionConflict,MergeConflict,SnapshotNotReady,PlanLimit, …). Never match on status alone: the same code arrives with different statuses from different tiers. - The ETag is carried by the object. A
getreturns a value that remembers its ETag; aputof it sendsIf-Match. A caller who wants to overwrite blind saysforce=Trueand gets a refusal otherwise. - Every model keeps
.raw— the response exactly as the contract describes it, so nothing is lost between the wire and you.
Documentation
| Getting started | constructing a client, profiles, tokens |
| Object model | Coho → Account → Project → Ref, every method |
| Accounts and members | me, members, invitations, entitlements |
| Content | types, entries, ETags, pagination, history |
| Branches and releases | diff, merge, tags, promotion, rollback, export |
| Errors | the class per code, and what each means |
| Testing | FakeBff, a contract-shaped fake server |
What it talks to
Coho's BFF, as a bearer caller, exactly as a browser session does. The SDK never
sees an authoring credential: it holds no X-Coho-Actor, no externalId and no client
secret, and the BFF chooses the actor for the account in the URL. That is what makes
this repository safe to publish.
The contracts it implements are vendored in
contracts/ at a
pinned commit of the server repository.
Related
- coho-cli — the
cohocommand, a thin layer over this library, with the task-shaped guides (install, quickstart, authentication, configuration, concepts, content model, CI). coho-delivery-sdk— planned: the read-only client a customer's site installs, over the delivery contract, with a project key rather than a person's token.
Licence
Apache-2.0. See LICENSE.
Metadata
Release files for coho-management-sdk 2026.1.0a12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| coho_management_sdk-2026.1.0a12.tar.gz | 127.3 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| coho_management_sdk-2026.1.0a12-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 186.8 kB
Release files / coho_management_sdk-2026.1.0a12.tar.gz
| Download URL | coho_management_sdk-2026.1.0a12.tar.gz |
|---|---|
| Size | 127.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4f1ddee0a0fb9af825629bba86da4aadf050023ced19126743d754331b3f5063
|
|
BLAKE2b-256 checksum How to use checksums |
8254811f857dd91555845cbec1353f4ef7b4ce0e0dbd7caf23237a1de2915069
|
| 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 Oct 24, 2026.
Transparency logRelease files / coho_management_sdk-2026.1.0a12-py3-none-any.whl
| Download URL | coho_management_sdk-2026.1.0a12-py3-none-any.whl |
|---|---|
| Size | 59.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fdaa3f016ef48b44e29ac7a49630fd4d3c06aaaa88aa46d27d54e097334959d6
|
|
BLAKE2b-256 checksum How to use checksums |
9b93e89a454ebeec0efcda4623acc2ce61ce7f9d2e4c8c938a46292c89738ca6
|
| 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 Oct 24, 2026.
Transparency logSecurity for coho-management-sdk 2026.1.0a12
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
All 2 files in this release have been uploaded with provenance metadata.
Attestation for coho_management_sdk-2026.1.0a12.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 Oct 24, 2026.
Transparency logA 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.