contentstack-utils

Use for Stack initialization, queries, entries, assets, live preview, taxonomy, and variants in contentstack-python.

npx skills add https://github.com/contentstack/contentstack-python --skill contentstack-utils

Contentstack CDA SDK – Contentstack Python CDA SDK

When to use

  • Implementing or changing Stack, content-type, query, entry, or asset behavior.
  • Working with live preview, taxonomy, global fields, variants, or image transforms.
  • Assessing CDA API alignment or extending the public SDK surface.

Instructions

Stack entry

  • Stack in contentstack/stack.py: validates api_key, delivery_token, environment; resolves region → host via ContentstackRegion; builds endpoint; wires HTTPSConnection with headers, timeout, urllib3.Retry, and optional live_preview / branch / early_access.

Features

  • Content types & entries — contenttype.py, entry.py, entryqueryable.py.
  • Queries — basequery.py, query.py; chain methods align with CDA query parameters.
  • Assets — asset.py, assetquery.py.
  • Taxonomy, global fields, variants, image transform — taxonomy.py, globalfields.py, variants.py, image_transform.py.
  • Sync — Stack.sync_init, pagination, sync_token → /stacks/sync via __sync_request.

Live preview

  • live_preview dict (enable, host, authorization, etc.) merged in deep_merge_lp.py / stack setup; keep behavior aligned with tests/test_live_preview.py.

HTTP layer

  • https_connection.py — requests.Session, HTTPAdapter, get_request from controller.py; user-agent uses contentstack.__title__ / __version__.

Extending

  • Add query or stack methods consistent with CDA query parameters.
  • Keep transport logic in HTTPSConnection / controller rather than duplicating requests setup.

Dependencies

  • requests, urllib3 (Retry), python-dateutil

More skills from contentstack

cms-assets
contentstack
Advise developers on organizing, delivering, and transforming assets in Contentstack. Cover folder structure, Image Delivery API transformations, publishing…
cms-branches-aliases
contentstack
Advise developers on using Contentstack branches for isolated content development and aliases for zero-downtime content deployments. Cover branch strategy,…
cms-data-modeling-best-practices
contentstack
Guide developers to model content in Contentstack using the simplest reusable structure. The skill explains when to use content types, references, global…
cms-live-preview-visual-builder-support-assistant
contentstack
Diagnose and guide Contentstack Live Preview and Visual Builder implementations. Trace preview context, identify the broken contract, and recommend the…
cms-releases
contentstack
Advise developers on using Contentstack Releases for coordinated, atomic content deployment. Cover release creation, item management, staged deployment,…
cms-roles-permissions
contentstack
Advise developers on designing roles, permissions, teams, and token access in Contentstack. Explain built-in roles, custom roles, permission merging,…
cms-taxonomy
contentstack
Advise developers on using Contentstack Taxonomy for structured, hierarchical content classification and delivery-side filtering. Covers taxonomy vs tags,…
cms-tokens-authentication
contentstack
Advise developers on choosing the right Contentstack authentication method and token type for frontend, backend, automation, and third-party app use cases.…