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 & entriescontenttype.py, entry.py, entryqueryable.py.
  • Queriesbasequery.py, query.py; chain methods align with CDA query parameters.
  • Assetsasset.py, assetquery.py.
  • Taxonomy, global fields, variants, image transformtaxonomy.py, globalfields.py, variants.py, image_transform.py.
  • SyncStack.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.pyrequests.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

brand-kit-assistant
contentstack
Advise users on Contentstack Brand Kit concepts, setup, governance, and on-brand AI generation. Route API-specific tasks to the right Brand Kit capability or…
official
cms-assets
contentstack
Advise developers on organizing, delivering, and transforming assets in Contentstack. Cover folder structure, Image Delivery API transformations, publishing…
official
cms-branches-aliases
contentstack
Advise developers on using Contentstack branches for isolated content development and aliases for zero-downtime content deployments. Cover branch strategy,…
official
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…
official
cms-entries
contentstack
Advise developers on querying, localizing, versioning, publishing, and structuring Contentstack entries for efficient delivery. Focus on CDA usage, reference…
official
cms-environments-publishing
contentstack
Advise developers on configuring environments, publishing content, using delivery and preview tokens, leveraging the Sync API, and understanding CDN and…
official
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…
official
cms-localization
contentstack
Advise developers on Contentstack localization: language setup, fallback chains, localized vs unlocalized entries, non-localizable fields, and multi-locale…
official