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.3 → tag py-v0.0.3 → GitHub Release → PyPI.

Metadata

Release files for block-style-cms-sdk 0.0.3

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.3
File Size Uploaded Provenance Actions
block_style_cms_sdk-0.0.3.tar.gz 34.1 kB With provenance Details for block_style_cms_sdk-0.0.3.tar.gz

Built distribution (wheel)

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

Total release size: 45.2 kB

Release files / block_style_cms_sdk-0.0.3.tar.gz

Download URL block_style_cms_sdk-0.0.3.tar.gz
Size 34.1 kB
Tags Source
SHA-256 checksum
How to use checksums
8cfde741bacf11d741cfd31b5d0a1547f5657bf0ce783777692a576b51869ac3
BLAKE2b-256 checksum
How to use checksums
eef9c703f6550563e4f9c12a8ffc43188ff3319955a2fd0e27b77a7f14c17b22
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 30, 2026.

Transparency log

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

Download URL block_style_cms_sdk-0.0.3-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f8258eeaaccd9b04c145cfda8d432f869645370dc7a60b7802bf088453703984
BLAKE2b-256 checksum
How to use checksums
83c102def7d7a552b7ee3447412b40fac20530c75153e4e599ee3a30e75307c8
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 30, 2026.

Transparency log

Security for block-style-cms-sdk 0.0.3

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.3.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 30, 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