Skip to main content

block-style-cms-sdk

Python SDK for Block Style CMS.

Install

pip install block-style-cms-sdk
# or: uv add block-style-cms-sdk

Auth

Create an API token in the CMS admin UI. Pass it when constructing the client:

  • Header: x-api-key: <token> (default), or
  • Authorization: Bearer <token>

Publish from Markdown

  1. Collect relative images from markdown (e.g. ./assets/foo.png)
  2. Resolve files under the required assetsDir
  3. Upload via POST /api/m/images
  4. Rewrite paths to /images/{filename}
  5. Submit via POST /api/m/articles/from-markdown
from block_style_cms_sdk import BlockStyleCmsClient

client = BlockStyleCmsClient(
    base_url="https://cms.example.com",
    api_key="bsc_...",
)

client.articles.publish_from_markdown(
    title="Hello",
    slug="hello-article-slug",
    summary="A short summary of at least ten chars",
    tags=["demo"],
    language="en-US",
    md_file="./posts/hello.md",
    assets_dir="./posts/assets",
    published=False,
)

Content metadata

Before publishing, discover site configuration:

  • GET /api/m/locales — site-supported article languages (deployment-specific)
  • GET /api/m/channels — site channels from CMS settings
locales = client.content.list_locales()
channels = client.content.list_channels()

List filter published is a status token — "published" | "draft" | "all" — not a boolean. Do not pass "true" / "false".

client.articles.list(published="published", page_size=20)

Develop

From packages/python:

uv sync --extra dev
uv run ruff check .
uv run ruff format .

Remote API check with the shared sample fixture (samples/):

cd packages/python
BSC_BASE_URL=https://your-cms.example.com \
BSC_API_KEY=bsc_... \
uv run python tests/publish_sample_article.py

Release

  1. Bump version in pyproject.toml.
  2. Tag py-vX.Y.Z, push, and Publish a GitHub Release for that tag.
  3. GitHub Actions uploads to PyPI via Trusted Publishing (OIDC; no PYPI_TOKEN secret).

Example: version 0.0.4 → tag py-v0.0.4 → GitHub Release → PyPI.

Metadata

Release files for block-style-cms-sdk 0.0.4

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

Source distribution (sdist)

Source distribution for block-style-cms-sdk 0.0.4
File Size Uploaded Provenance Actions
block_style_cms_sdk-0.0.4.tar.gz 34.1 kB With provenance Details for block_style_cms_sdk-0.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for block-style-cms-sdk 0.0.4
File Interpreter ABI Platform Actions
block_style_cms_sdk-0.0.4-py3-none-any.whl Python 3 none any Details for block_style_cms_sdk-0.0.4-py3-none-any.whl

Total release size: 45.2 kB

Release files / block_style_cms_sdk-0.0.4.tar.gz

Download URL block_style_cms_sdk-0.0.4.tar.gz
Size 34.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1d15b58a8c8d781b6676c928b6f6acf1681f10bcb305121a7dab73903e511613
BLAKE2b-256 checksum
How to use checksums
841eba85be16bed26aed1b46e79c4b1f014b70acacb2c64760b9c52844c5fd61
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 2, 2026.

Transparency log

Release files / block_style_cms_sdk-0.0.4-py3-none-any.whl

Download URL block_style_cms_sdk-0.0.4-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
72435504921e8f834d76009d1a80af7e102defe9cc0840ec2d332b3b603f2f36
BLAKE2b-256 checksum
How to use checksums
cf4d481e676ebb6dd43443215e4837cb8e104c67d187a69ef6d042ab3b57a170
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 2, 2026.

Transparency log

Security for block-style-cms-sdk 0.0.4

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.

Select from 2 files

Attestation for block_style_cms_sdk-0.0.4.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 2, 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.

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