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 — supported article languages (zh-CN, zh-TW, en-US)
  • GET /api/m/channels — site channels from CMS settings
locales = client.content.list_locales()
channels = client.content.list_channels()

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

Metadata

Release files for block-style-cms-sdk 0.0.1

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.1
File Size Uploaded Provenance Actions
block_style_cms_sdk-0.0.1.tar.gz 24.9 kB With provenance Details for block_style_cms_sdk-0.0.1.tar.gz

Built distribution (wheel)

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

Total release size: 34.3 kB

Release files / block_style_cms_sdk-0.0.1.tar.gz

Download URL block_style_cms_sdk-0.0.1.tar.gz
Size 24.9 kB
Tags Source
SHA-256 checksum
How to use checksums
07b078ad6fa6f84fbf8d61cfd4e4696a9b0b0f321bd0a65ca74b223682cdcf56
BLAKE2b-256 checksum
How to use checksums
281a88229f9250320cbb812b86ffd69e7dc2e4514ba1a42b84a0b7dceb5b1f29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 23, 2026.

Transparency log

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

Download URL block_style_cms_sdk-0.0.1-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
586cc73772d3abdf2f9d0d120b9f7272f4d6aa19d67062db5ab433be7cf26315
BLAKE2b-256 checksum
How to use checksums
1e6e2bf5879c82f4a3b6cd3cf7d97d495cbc633c62f005b07041b56dc9d99d54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 23, 2026.

Transparency log

Security for block-style-cms-sdk 0.0.1

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.1.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 Aug 23, 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