{"id":19335701,"url":"https://github.com/buttercms/buttercms-python","last_synced_at":"2025-04-12T08:26:41.026Z","repository":{"id":47410387,"uuid":"63463114","full_name":"ButterCMS/buttercms-python","owner":"ButterCMS","description":"Python API client for ButterCMS (https://buttercms.com)","archived":false,"fork":false,"pushed_at":"2024-07-09T19:25:21.000Z","size":92,"stargazers_count":36,"open_issues_count":5,"forks_count":11,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-12T03:15:55.219Z","etag":null,"topics":["api","api-client","cms","django","flask","python"],"latest_commit_sha":null,"homepage":"","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/ButterCMS.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-16T03:15:11.000Z","updated_at":"2025-04-01T01:29:32.000Z","dependencies_parsed_at":"2024-04-26T19:27:47.289Z","dependency_job_id":"3d20b65e-e327-4cb5-9831-20a84fc261b5","html_url":"https://github.com/ButterCMS/buttercms-python","commit_stats":{"total_commits":29,"total_committers":5,"mean_commits":5.8,"dds":0.5172413793103448,"last_synced_commit":"46d9b0fd5dcde8a386ea22142e1ff50991be7d4b"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ButterCMS%2Fbuttercms-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ButterCMS%2Fbuttercms-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ButterCMS%2Fbuttercms-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ButterCMS%2Fbuttercms-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ButterCMS","download_url":"https://codeload.github.com/ButterCMS/buttercms-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248538776,"owners_count":21121037,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["api","api-client","cms","django","flask","python"],"created_at":"2024-11-10T03:08:32.374Z","updated_at":"2025-04-12T08:26:40.994Z","avatar_url":"https://github.com/ButterCMS.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# buttercms-python - 2.1.1 \u003c!-- {x-release-please-version} --\u003e\n\n[![PyPI version](https://badge.fury.io/py/buttercms-python.svg)](https://badge.fury.io/py/buttercms-python)\n[![TestPyPI version](https://img.shields.io/pypi/v/buttercms-python?label=TestPyPI)](https://test.pypi.org/project/buttercms-python/)\n[![Downloads](https://pepy.tech/badge/buttercms-python)](https://pepy.tech/project/buttercms-python)\n[![Downloads](https://pepy.tech/badge/buttercms-python/month)](https://pepy.tech/project/buttercms-python)\n[![Downloads](https://pepy.tech/badge/buttercms-python/week)](https://pepy.tech/project/buttercms-python)\n\nPython Library for ButterCMS API. \n\n\u003e [!IMPORTANT]\n\u003e We officially support Python versions 3.8 to 3.12. While compatibility with other Python 3.x versions is possible, as we currently do not utilize any version-specific features, it is not guaranteed.\n\n## Documentation\n\nFor a comprehensive list of examples, check out the [API documentation](https://buttercms.com/docs/api/).\n\n## Jump to:\n\n* [Pages](#pages)\n* [Collections](#collections)\n* [Posts](#posts)\n* [Authors](#authors)\n* [Categories](#categories)\n* [Feeds](#feeds)\n\n## Installation\n\nInstall from PyPi using [pip](http://www.pip-installer.org/en/latest/), a\npackage manager for Python.\n\n    pip install buttercms-python\n\n\n## Usage\n\nGetting started with the ButterCMS API couldn't be easier. Use your authorization token to create a ButterCMS client.\n\n```python\nfrom butter_cms import ButterCMS\n\nauth_token = \"XXXXXXXXXXXXXXXXXXX\"\nclient = ButterCMS(auth_token)\n```\n\nAll methods return dictionaries. The data can be navigated using keys and indexes like the example below.\n\n```python\nresponse = client.posts.all()\n\nposts = response['data'] \n# posts now contains a list of post dictionaries\n\nmy_post = posts[0]\n# my_post contains the first returned post\n\nprint(my_post)\n# {\n#   \"url\": \"http://www.example.com/blog/this-is-a-blog-post\",\n#   \"created\": \"2015-06-12T13:59:32.441289Z\",\n#   \"published\": \"2015-06-12T00:00:00Z\",\n#   ...\n# }\n```\n\n### Pages\n\nThe Page's `.all()`, `.get()` and `.search()` methods accept an optional `params` to add additional data to the response.\n\n```python\nclient.pages.all('news')\n\n# Optional params\nclient.pages.all('news', {'foo': 'bar'})\n```\n\n\n```python\nclient.pages.get('news', 'hello-world')\n\n# Optional params\nclient.pages.get('news', 'hello-world', {'foo': 'bar'})\n```\n\n```python\nclient.pages.search('enter search query', {'page': 1, 'page_size': 10})\n```\n\n[To Top](#buttercms-python)\n\n\n### Collections\n\nFor a list of params see the [API documentation](https://buttercms.com/docs/api/?python#collections)\n\n.get() method accepts an optional `params` dict to add additional data to the response.\n\n```python\nclient.content_fields.get(['collection_key'], {'locale': 'en'})\n```\n\n[To Top](#buttercms-python)\n\n\n### Blog Engine\n\n#### Posts\n\n```python\nclient.posts.all({'page_size': 3, 'page': 1, 'exclude_body': 'true'})\n```\n\n\n```python\nclient.posts.get('hello-world')\n```\n\n\n```python\nclient.posts.search('query', {'page': 1, 'page_size': 10})\n```\n\n#### Authors\n\nThe Author's `.all()` and `.get()` methods accept an optional `params` to add additional data to the response.\n\n* `{'include':'recent_posts'}`: Adds each author's posts under the `recent_posts` key in that author's returned dictionary\n\n```python\nclient.authors.all()\nclient.authors.all({'include':'recent_posts'})\n```\n\n\n```python\nclient.authors.get('jennifer-smith')\nclient.authors.get('jennifer-smith', {'include':'recent_posts'})\n```\n\n\n[To Top](#buttercms-python)\n\n#### Categories\n\nThe Category's `.all()` and `.get()` methods accept an optional `params` to add additional data to the response.\n\n* `{'include':'recent_posts'}`: Adds posts tagged with that category under the `recent_posts` key in that category's returned dictionary\n\n```python\nclient.categories.all()\nclient.categories.all({'include':'recent_posts'})\n```\n\n\n```python\nclient.categories.get('product-updates')\nclient.categories.get('product-updates', {'include':'recent_posts'})\n```\n\n\n[To Top](#buttercms-python)\n\n\n#### Tags\n\nThe Tag's `.all()` and `.get()` methods accept an optional `params` to add additional data to the response.\n\n* `{'include':'recent_posts'}`: Adds posts tagged with that tag under the `recent_posts` key in that tag's returned dictionary\n\n```python\nclient.tags.all()\nclient.tags.all({'include':'recent_posts'})\n```\n\n\n```python\nclient.tags.get('product-updates')\nclient.tags.get('product-updates', {'include':'recent_posts'})\n```\n\n\n[To Top](#buttercms-python)\n\n#### Feeds\n\n```python\nclient.feeds.get('rss')\n```\n\n\n```python\nclient.feeds.get('atom')\n```\n\n\n```python\nclient.feeds.get('sitemap')\n```\n\n\n[To Top](#buttercms-python)\n\n\n\n### Other\n\nView Python [Blog engine](https://buttercms.com/python-blog-engine/) and [Full CMS](https://buttercms.com/python-cms/) for other examples of using ButterCMS with Python.\n\n### Tests\n\nTo run tests:\n\n```python\npython -m unittest butter_cms/unit_tests.py\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuttercms%2Fbuttercms-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuttercms%2Fbuttercms-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuttercms%2Fbuttercms-python/lists"}