contentstack-utils
by contentstack
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-utilsContentstack 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
Stackincontentstack/stack.py: validatesapi_key,delivery_token,environment; resolvesregion → hostviaContentstackRegion; buildsendpoint; wiresHTTPSConnectionwithheaders,timeout,urllib3.Retry, and optionallive_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/syncvia__sync_request.
Live preview
live_previewdict (enable,host,authorization, etc.) merged indeep_merge_lp.py/ stack setup; keep behavior aligned withtests/test_live_preview.py.
HTTP layer
https_connection.py—requests.Session,HTTPAdapter,get_requestfromcontroller.py; user-agent usescontentstack.__title__/__version__.
Extending
- Add query or stack methods consistent with CDA query parameters.
- Keep transport logic in
HTTPSConnection/controllerrather than duplicatingrequestssetup.
Dependencies
requests,urllib3(Retry),python-dateutil