Skip to main content

cascade-cms

A typed, async REST client for Hannon Hill Cascade CMS.

Full Documentation

Usage

from cascade_cms.cmstypes import Asset, IdentifierType
from cascade_cms.wrapper import CascadeWrapperBase

environment_variables = {
    "API_KEY": "...",
    "CASCADE_URL": "...",
    "SERVER": "prod",  # label used for logfile naming
}
configuration_variables = {
    "cache_name": "./cache/cache.sqlite",
    "allowed_codes": (200,),
    "allowed_methods": ("GET",),
}

with CascadeWrapperBase(environment_variables, configuration_variables) as cascade:
    identifier = IdentifierType(identifier="e868f539ac1001062cfa029c4c5df4d0", asset_type="folder")
    cascade.operations.read(identifier)
    results = cascade.submit_requests(Asset)

Operations that take an identifier (read, delete, copy, move, publish, checkIn, checkOut, listSubscribers, readAccessRights, readWorkflowSettings, readWorkflowInformation, performWorkflowTransition) accept either an IdentifierType (asset type + UUID) or a Path (asset type + site name + site-relative path) — see cascade_cms.cmstypes.resolve_identifier.

See examples/read_and_update_asset.py for a fuller walkthrough.

Logging

CascadeWrapperBase accepts an optional third debug argument. Leaving it as None (the default) runs in normal mode: a minimal console ([INIT]/[RUNNING]/Processed: n/N/ [DONE]/[EXIT]) plus a simple logfile at ./logs/{SERVER}_{timestamp}.log. Passing a dict switches to debug mode: a quiet console and a verbose, nested logfile at ./logs/{SERVER}_debug_{timestamp}.log describing every request, response, callback, and error.

debug_config = {
    "log_dir": "./logs",
    "log_operations": True,
    "log_callbacks": True,
    "log_responses": True,
    "show_payload_data": True,
    "show_network_headers": False,
    "show_error_variables": True,
    "response_line_limit": 8,   # -1 = dump full response body
}

with CascadeWrapperBase(environment_variables, configuration_variables, debug=debug_config) as cascade:
    ...

All keys are required in debug mode — there are no inferred defaults, so you always know what you opted into.

Development

pip install -e ".[dev]"
pytest

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cascade_cms_rest-2.0.2.tar.gz (27.3 kB view details)

Uploaded Source

Built Distribution

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

cascade_cms_rest-2.0.2-py3-none-any.whl (25.6 kB view details)

Uploaded Python 3

File details

Details for the file cascade_cms_rest-2.0.2.tar.gz.

File metadata

  • Download URL: cascade_cms_rest-2.0.2.tar.gz
  • Upload date:
  • Size: 27.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for cascade_cms_rest-2.0.2.tar.gz
Algorithm Hash digest
SHA256 baffaf2b089b960b04fcc093741a05b123615a81a69dd32c815bb5e46f375b68
MD5 bf6553033f09a08b95ce07ec7d5d9a8c
BLAKE2b-256 e08607e425f756f67d31d07e7458f1b3bca8775b89903c35006a84d0c39725ab

See more details on using hashes here.

File details

Details for the file cascade_cms_rest-2.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for cascade_cms_rest-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5d85dc7c3e950d56906aca4fe8af101f77e5cd9956fad690f790955d938c694c
MD5 d8b23f6368430bd8b7ffda4a5d5f6d06
BLAKE2b-256 900e13d7ae0a70e1c177e1cb2e19eb3e130a1943bf058924e728ea7691b9df77

See more details on using hashes here.

Release history Release notifications | RSS feed

3.1.3

2 files

3.1.1

2 files

3.0.2

2 files

3.0.1

2 files

3.0.0

2 files

2.0.3

2 files

This release

2.0.2 This release

2 files

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