{"id":37072359,"url":"https://github.com/contentstack/contentstack-python","last_synced_at":"2026-01-14T08:29:42.594Z","repository":{"id":42067032,"uuid":"189940282","full_name":"contentstack/contentstack-python","owner":"contentstack","description":"Python SDK for Contentstack's Content Delivery API","archived":false,"fork":false,"pushed_at":"2025-11-26T22:15:00.000Z","size":7052,"stargazers_count":4,"open_issues_count":2,"forks_count":3,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-11-29T16:38:23.449Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/contentstack.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-06-03T05:30:04.000Z","updated_at":"2025-11-12T11:11:00.000Z","dependencies_parsed_at":"2023-01-30T19:15:40.619Z","dependency_job_id":"bf751609-c0a6-43ea-9d55-680fcb9aa96f","html_url":"https://github.com/contentstack/contentstack-python","commit_stats":{"total_commits":178,"total_committers":6,"mean_commits":"29.666666666666668","dds":0.5112359550561798,"last_synced_commit":"2f211623c2de21f707f5f7eff55214f4b71b16fb"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/contentstack/contentstack-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contentstack%2Fcontentstack-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contentstack%2Fcontentstack-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contentstack%2Fcontentstack-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contentstack%2Fcontentstack-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/contentstack","download_url":"https://codeload.github.com/contentstack/contentstack-python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contentstack%2Fcontentstack-python/sbom","scorecard":{"id":303465,"data":{"date":"2025-08-11","repo":{"name":"github.com/contentstack/contentstack-python","commit":"9ed229a176a53de449eb3065125aa44206d8782a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":7.1,"checks":[{"name":"Code-Review","score":10,"reason":"all changesets reviewed","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":10,"reason":"23 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:24","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:25","Warn: no topLevel permission defined: .github/workflows/check-branch.yml:1","Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Warn: no topLevel permission defined: .github/workflows/issues-jira.yml:1","Warn: no topLevel permission defined: .github/workflows/policy-scan.yml:1","Info: topLevel 'contents' permission set to 'read': .github/workflows/python-publish.yml:16","Warn: no topLevel permission defined: .github/workflows/sca-scan.yml:1","Warn: no topLevel permission defined: .github/workflows/secrets-scan.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/check-branch.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/contentstack/contentstack-python/check-branch.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/contentstack/contentstack-python/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/contentstack/contentstack-python/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:55: update your workflow using https://app.stepsecurity.io/secureworkflow/contentstack/contentstack-python/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:68: update your workflow using https://app.stepsecurity.io/secureworkflow/contentstack/contentstack-python/codeql-analysis.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/issues-jira.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/contentstack/contentstack-python/issues-jira.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/issues-jira.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/contentstack/contentstack-python/issues-jira.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/policy-scan.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/contentstack/contentstack-python/policy-scan.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/policy-scan.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/contentstack/contentstack-python/policy-scan.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/contentstack/contentstack-python/python-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/contentstack/contentstack-python/python-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/sca-scan.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/contentstack/contentstack-python/sca-scan.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/sca-scan.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/contentstack/contentstack-python/sca-scan.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/secrets-scan.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/contentstack/contentstack-python/secrets-scan.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:31","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:32","Warn: downloadThenRun not pinned by hash: .github/workflows/secrets-scan.yml:29","Info:   0 out of  10 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   5 third-party GitHubAction dependencies pinned","Info:   0 out of   2 pipCommand dependencies pinned","Info:   0 out of   1 downloadThenRun dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/python-publish.yml:19"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":7,"reason":"3 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-cpwx-vrp4-4pq7","Warn: Project is vulnerable to: GHSA-gmj6-6f8f-6699","Warn: Project is vulnerable to: GHSA-q2x7-8rv6-6q7h"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":10,"reason":"SAST tool detected","details":["Info: SAST configuration detected: CodeQL","Info: SAST configuration detected: Snyk","Info: all commits (30) are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T21:21:53.163Z","repository_id":42067032,"created_at":"2025-08-17T21:21:53.163Z","updated_at":"2025-08-17T21:21:53.163Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414074,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:16:59.381Z","status":"ssl_error","status_checked_at":"2026-01-14T08:13:45.490Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-14T08:29:41.951Z","updated_at":"2026-01-14T08:29:42.583Z","avatar_url":"https://github.com/contentstack.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"#[![Contentstack](https://www.contentstack.com/docs/static/images/contentstack.png)](https://www.contentstack.com/)\n\n\u003c!-- ![Python package](https://github.com/contentstack/contentstack-python/workflows/Python%20package/badge.svg?branch=master) --\u003e\n\n![build](https://img.shields.io/badge/build-passing-green?style=plastic)\n![Coverage](https://raw.githubusercontent.com/contentstack/contentstack-python/b4edf799276f586dce3e57fa5502036cd5fd8da3/coverage.svg) ![pip](https://img.shields.io/badge/pip-v1.8.0-blue?style=plastic) ![python](https://img.shields.io/badge/python-3.5|3.6|3.7|3.8-blue?style=plastic) [![GitHub license](https://img.shields.io/github/license/contentstack/contentstack-python?style=plastic)](https://github.com/contentstack/contentstack-python/blob/master/LICENSE) [![GitHub stars](https://img.shields.io/github/stars/contentstack/contentstack-python?style=plastic)](https://github.com/contentstack/contentstack-python/stargazers)\n\n## Python SDK for Contentstack\n\nContentstack is a headless CMS with an API-first approach. It is a CMS that developers can use to build powerful\ncross-platform applications in their favorite languages. Build your application frontend, and Contentstack will take\ncare of the rest. [Read More](https://www.contentstack.com/).\n\nContentstack provides Python SDK to build application on top of Python. Given below is the detailed guide and helpful\nresources to get started with our Python SDK.\n\n### Prerequisite\n\nYou will need python 3 installed on your machine. You can install it\nfrom [here](https://www.python.org/ftp/python/3.7.4/python-3.7.4-macosx10.9.pkg).\n\n### Setup and Installation\n\nTo use the Contentstack Python SDK to your existing project, perform the steps given below:\n\n### Install contentstack pip\n\n```pyhton\npip install contentstack\n```\n\nInstall latest [contentstack](https://pypi.org/project/Contentstack) package from the [PyPI](https://pypi.org)\n\nThis is the preferred method to install contentstack, as it will always install the most recent stable release. If you\ndon't have [pip](https://pip.pypa.io/) installed,\nthis [Python installation guide](http://docs.python-guide.org/en/latest/starting/installation/) can guide you through\nthe process\n\n### Key Concepts for using Contentstack\n\n#### Stack\n\nA stack is like a container that holds the content of your app. Learn more\nabout [Stacks](https://www.contentstack.com/docs/developers/set-up-stack).\n\n#### Content Type\n\nContent type lets you define the structure or blueprint of a page or a section of your digital property. It is a\nform-like page that gives Content Managers an interface to input and upload\ncontent. [Read more](https://www.contentstack.com/docs/developers/create-content-types).\n\n#### Entry\n\nAn entry is the actual piece of content created using one of the defined content types. Learn more\nabout [Entries](https://www.contentstack.com/docs/content-managers/work-with-entries).\n\n#### Asset\n\nAssets refer to all the media files (images, videos, PDFs, audio files, and so on) uploaded to Contentstack. These files\ncan be used in multiple entries. Read more\nabout [Assets](https://www.contentstack.com/docs/content-managers/work-with-assets).\n\n#### Environment\n\nA publishing environment corresponds to one or more deployment servers or a content delivery destination where the\nentries need to be published. Learn how to work\nwith [Environments](https://www.contentstack.com/docs/developers/set-up-environments).\n\n### Contentstack Python SDK: 5-minute Quickstart\n\n#### Initializing your SDK\n\nTo initialize the SDK, specify application API key, access token, and environment name of the stack as shown in the\nsnippet given below, You can provide optional parameters for config:\n\n```python\nstack = contentstack.Stack('api_key', 'delivery_token', 'environment')\n```\n\nTo get the API credentials mentioned above, log in to your Contentstack account and then in your top panel navigation,\ngo to Settings \u0026gt; Stack to view the API Key and Access Token.\n\n#### Querying content from your stack\n\nTo retrieve a single entry from a content type use the code snippet given below:\n\n```python\nstack = contentstack.Stack('api_key', 'delivery_token', 'environment')\ncontent_type = stack.content_type(\"content_type_uid\")\nentry = content_type.entry(\"entry_uid\")\nresult = entry.fetch()\n```\n\n##### Get Multiple Entries\n\nTo retrieve multiple entries of a particular content type, use the code snippet given below:\n\n```python\nstack = contentstack.Stack('api_key', 'delivery_token', 'environment')\nquery = stack.content_type(\"content_type_uid\").query()\nresult = query.find()\n```\n\n### Advanced Queries\n\nYou can query for content types, entries, assets and more using our Python API Reference.\n\n[Python API Reference Doc](https://www.contentstack.com/docs/platforms/python/api-reference/)\n\n### Working with Images\n\nWe have introduced Image Delivery APIs that let you retrieve images and then manipulate and optimize them for your\ndigital properties. It lets you perform a host of other actions such as crop, trim, resize, rotate, overlay, and so on.\n\nFor example, if you want to crop an image (with width as 300 and height as 400), you simply need to append query\nparameters at the end of the image URL, such as, `https://images.contentstack.io/v3/assets/download?crop=300,400`. There\nare several more parameters that you can use for your images.\n\n[Read Image Delivery API documentation](https://www.contentstack.com/docs/platforms/python/api-reference/).\n\nYou can use the Image Delivery API functions in this SDK as well. Here are a few examples of its usage in the SDK.\n\n```python\nimage = stack.image_transform(url, {'quality': 100}).get_url()\nimage = stack.image_transform(url, {'width': 100, 'height': 100}).get_url()\nimage = stack.image_transform(url, {'auto': 'webp'}).get_url()\n```\n\n### Using the Sync API with Python SDK\n\nThe Sync API takes care of syncing your Contentstack data with your application and ensures that the data is always\nup-to-date by providing delta updates. Contentstack’s Python SDK supports Sync API, which you can use to build powerful\napplications.\n\n```python\nstack = contentstack.Stack('api_key', 'delivery_token', 'environment')  # initialize sync\nresponse = stack.sync_init()  # sycn using sync token\nresponse = stack.sync_token('sync_token')  # sycn using pagination token\nresponse = stack.pagination('pagination_token')  # sync using multiple parameters\nresponse = stack.sync_init(publish_type='entry_published', content_type_uid='content_type_uid')\n```\n\nRead through to understand how to use the Sync API with Contentstack Python SDK.\n\n[Using the Sync API with Python SDK](https://www.contentstack.com/docs/developers/python/using-the-sync-api-with-python-sdk)\n\n### Helpful Links\n\n- [Contentstack Website](https://www.contentstack.com)\n- [Official Documentation](https://contentstack.com/docs)\n- [Content Delivery API Docs](https://www.contentstack.com/docs/developers/apis/content-delivery-api/)\n\n### The MIT License (MIT)\n\nCopyright © 2012-2026 [Contentstack](https://www.contentstack.com/). All Rights Reserved\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the\nrights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit\npersons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the\nSoftware.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\nWARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\nOTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n- [Content Delivery API Docs](https://contentstack.com/docs/apis/content-delivery-api/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontentstack%2Fcontentstack-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcontentstack%2Fcontentstack-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontentstack%2Fcontentstack-python/lists"}