Skip to content

Commit f25d5ca

Browse files
Merge pull request #37 from contentstack/next
Next: AZURE_EU Region, Live Preview support added
2 parents 746e157 + 8bbaefe commit f25d5ca

34 files changed

+801
-509
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package
10+
11+
on:
12+
release:
13+
types: [ published ]
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
deploy:
20+
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v3
25+
- name: Set up Python
26+
uses: actions/setup-python@v3
27+
with:
28+
python-version: '3.x'
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install build
33+
- name: Build package
34+
run: python -m build
35+
- name: Publish package
36+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
37+
with:
38+
user: __token__
39+
password: ${{ secrets.PYPI_PASSWORD }}

.talismanrc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
threshold: medium
22

33
fileignoreconfig:
4-
54
- filename: README.md
6-
checksum: d9d20b2badbf1aa62649bb174db47a9e491d8687e33ac69fee62568efa23fc56
5+
checksum: b9cad0b376230ea7079fef3459f233b2c61f3d5e48d6d5d03a6bf3e2d39117a8

CHANGELOG.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# CHANGELOG
22

3+
## _v1.8.0_
4+
5+
### **Date: 26-MAY-2023**
6+
7+
- AZURE_EU, Region support added
8+
- Include Metadata support added to asset, entry and query
9+
- General code improvement clean up
10+
- Updated code for Live Preview
11+
312
---
413

514
## _v1.7.0_
@@ -67,13 +76,13 @@ Date: 08-Dec-2020
6776
- Timeout support included
6877

6978
- Entry
70-
- added support for include_fallback.
79+
- added support for include_fallback.
7180
- Asset
72-
- added support for include_fallback.
81+
- added support for include_fallback.
7382
- AssetQueryable
74-
- added support for include_fallback.
83+
- added support for include_fallback.
7584
- Query
76-
- added support for include_fallback.
85+
- added support for include_fallback.
7786

7887
---
7988

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2012 - 2021 Contentstack. All rights reserved.
3+
Copyright (c) 2012 - 2023 Contentstack. All rights reserved.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 56 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1-
#
2-
3-
[![Contentstack](https://www.contentstack.com/docs/static/images/contentstack.png)](https://www.contentstack.com/)
1+
#[![Contentstack](https://www.contentstack.com/docs/static/images/contentstack.png)](https://www.contentstack.com/)
42

53
<!-- ![Python package](https://github.com/contentstack/contentstack-python/workflows/Python%20package/badge.svg?branch=master) -->
64

75
![build](https://img.shields.io/badge/build-passing-green?style=plastic)
8-
![Coverage](https://raw.githubusercontent.com/contentstack/contentstack-python/b4edf799276f586dce3e57fa5502036cd5fd8da3/coverage.svg) ![pip](https://img.shields.io/badge/pip-v1.7.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)
6+
![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)
97

108
## Python SDK for Contentstack
119

12-
Contentstack is a headless CMS with an API-first approach. It is a CMS that developers can use to build powerful cross-platform applications in their favorite languages. Build your application frontend, and Contentstack will take care of the rest. [Read More](https://www.contentstack.com/).
10+
Contentstack is a headless CMS with an API-first approach. It is a CMS that developers can use to build powerful
11+
cross-platform applications in their favorite languages. Build your application frontend, and Contentstack will take
12+
care of the rest. [Read More](https://www.contentstack.com/).
1313

14-
Contentstack provides Python SDK to build application on top of Python. Given below is the detailed guide and helpful resources to get started with our Python SDK.
14+
Contentstack provides Python SDK to build application on top of Python. Given below is the detailed guide and helpful
15+
resources to get started with our Python SDK.
1516

1617
### Prerequisite
1718

18-
You will need python 3 installed on your machine. You can install it from [here](https://www.python.org/ftp/python/3.7.4/python-3.7.4-macosx10.9.pkg).
19+
You will need python 3 installed on your machine. You can install it
20+
from [here](https://www.python.org/ftp/python/3.7.4/python-3.7.4-macosx10.9.pkg).
1921

2022
### Setup and Installation
2123

@@ -29,48 +31,61 @@ pip install contentstack
2931

3032
Install latest [contentstack](https://pypi.org/project/Contentstack) package from the [PyPI](https://pypi.org)
3133

32-
This is the preferred method to install contentstack, as it will always install the most recent stable release. If you don't have [pip](https://pip.pypa.io/) installed, this [Python installation guide](http://docs.python-guide.org/en/latest/starting/installation/) can guide you through the process
34+
This is the preferred method to install contentstack, as it will always install the most recent stable release. If you
35+
don't have [pip](https://pip.pypa.io/) installed,
36+
this [Python installation guide](http://docs.python-guide.org/en/latest/starting/installation/) can guide you through
37+
the process
3338

3439
### Key Concepts for using Contentstack
3540

3641
#### Stack
3742

38-
A stack is like a container that holds the content of your app. Learn more about [Stacks](https://www.contentstack.com/docs/developers/set-up-stack).
43+
A stack is like a container that holds the content of your app. Learn more
44+
about [Stacks](https://www.contentstack.com/docs/developers/set-up-stack).
3945

4046
#### Content Type
4147

42-
Content type lets you define the structure or blueprint of a page or a section of your digital property. It is a form-like page that gives Content Managers an interface to input and upload content. [Read more](https://www.contentstack.com/docs/developers/create-content-types).
48+
Content type lets you define the structure or blueprint of a page or a section of your digital property. It is a
49+
form-like page that gives Content Managers an interface to input and upload
50+
content. [Read more](https://www.contentstack.com/docs/developers/create-content-types).
4351

4452
#### Entry
4553

46-
An entry is the actual piece of content created using one of the defined content types. Learn more about [Entries](https://www.contentstack.com/docs/content-managers/work-with-entries).
54+
An entry is the actual piece of content created using one of the defined content types. Learn more
55+
about [Entries](https://www.contentstack.com/docs/content-managers/work-with-entries).
4756

4857
#### Asset
4958

50-
Assets refer to all the media files (images, videos, PDFs, audio files, and so on) uploaded to Contentstack. These files can be used in multiple entries. Read more about [Assets](https://www.contentstack.com/docs/content-managers/work-with-assets).
59+
Assets refer to all the media files (images, videos, PDFs, audio files, and so on) uploaded to Contentstack. These files
60+
can be used in multiple entries. Read more
61+
about [Assets](https://www.contentstack.com/docs/content-managers/work-with-assets).
5162

5263
#### Environment
5364

54-
A publishing environment corresponds to one or more deployment servers or a content delivery destination where the entries need to be published. Learn how to work with [Environments](https://www.contentstack.com/docs/developers/set-up-environments).
65+
A publishing environment corresponds to one or more deployment servers or a content delivery destination where the
66+
entries need to be published. Learn how to work
67+
with [Environments](https://www.contentstack.com/docs/developers/set-up-environments).
5568

5669
### Contentstack Python SDK: 5-minute Quickstart
5770

5871
#### Initializing your SDK
5972

60-
To initialize the SDK, specify application API key, access token, and environment name of the stack as shown in the snippet given below, You can provide optional parameters for config:
73+
To initialize the SDK, specify application API key, access token, and environment name of the stack as shown in the
74+
snippet given below, You can provide optional parameters for config:
6175

6276
```python
63-
stack = contentstack.Stack('api_key','delivery_token','environment')
77+
stack = contentstack.Stack('api_key', 'delivery_token', 'environment')
6478
```
6579

66-
To get the API credentials mentioned above, log in to your Contentstack account and then in your top panel navigation, go to Settings &gt; Stack to view the API Key and Access Token.
80+
To get the API credentials mentioned above, log in to your Contentstack account and then in your top panel navigation,
81+
go to Settings &gt; Stack to view the API Key and Access Token.
6782

6883
#### Querying content from your stack
6984

7085
To retrieve a single entry from a content type use the code snippet given below:
7186

7287
```python
73-
stack = contentstack.Stack('api_key','delivery_token','environment')
88+
stack = contentstack.Stack('api_key', 'delivery_token', 'environment')
7489
content_type = stack.content_type("content_type_uid")
7590
entry = content_type.entry("entry_uid")
7691
result = entry.fetch()
@@ -81,7 +96,7 @@ result = entry.fetch()
8196
To retrieve multiple entries of a particular content type, use the code snippet given below:
8297

8398
```python
84-
stack = contentstack.Stack('api_key','delivery_token','environment')
99+
stack = contentstack.Stack('api_key', 'delivery_token', 'environment')
85100
query = stack.content_type("content_type_uid").query()
86101
result = query.find()
87102
```
@@ -94,9 +109,12 @@ You can query for content types, entries, assets and more using our Python API R
94109

95110
### Working with Images
96111

97-
We have introduced Image Delivery APIs that let you retrieve images and then manipulate and optimize them for your digital properties. It lets you perform a host of other actions such as crop, trim, resize, rotate, overlay, and so on.
112+
We have introduced Image Delivery APIs that let you retrieve images and then manipulate and optimize them for your
113+
digital properties. It lets you perform a host of other actions such as crop, trim, resize, rotate, overlay, and so on.
98114

99-
For example, if you want to crop an image (with width as 300 and height as 400), you simply need to append query parameters at the end of the image URL, such as, `https://images.contentstack.io/v3/assets/download?crop=300,400`. There are several more parameters that you can use for your images.
115+
For example, if you want to crop an image (with width as 300 and height as 400), you simply need to append query
116+
parameters at the end of the image URL, such as, `https://images.contentstack.io/v3/assets/download?crop=300,400`. There
117+
are several more parameters that you can use for your images.
100118

101119
[Read Image Delivery API documentation](https://www.contentstack.com/docs/platforms/python/api-reference/).
102120

@@ -110,13 +128,15 @@ image = stack.image_transform(url, {'auto': 'webp'}).get_url()
110128

111129
### Using the Sync API with Python SDK
112130

113-
The Sync API takes care of syncing your Contentstack data with your application and ensures that the data is always up-to-date by providing delta updates. Contentstack’s Python SDK supports Sync API, which you can use to build powerful applications.
131+
The Sync API takes care of syncing your Contentstack data with your application and ensures that the data is always
132+
up-to-date by providing delta updates. Contentstack’s Python SDK supports Sync API, which you can use to build powerful
133+
applications.
114134

115135
```python
116-
stack = contentstack.Stack('api_key','delivery_token','environment') #initialize sync
117-
response = stack.sync_init() #sycn using sync token
118-
response = stack.sync_token('sync_token') #sycn using pagination token
119-
response = stack.pagination('pagination_token') #sync using multiple parameters
136+
stack = contentstack.Stack('api_key', 'delivery_token', 'environment') # initialize sync
137+
response = stack.sync_init() # sycn using sync token
138+
response = stack.sync_token('sync_token') # sycn using pagination token
139+
response = stack.pagination('pagination_token') # sync using multiple parameters
120140
response = stack.sync_init(publish_type='entry_published', content_type_uid='content_type_uid')
121141
```
122142

@@ -132,12 +152,19 @@ Read through to understand how to use the Sync API with Contentstack Python SDK.
132152

133153
### The MIT License (MIT)
134154

135-
Copyright © 2012-2021 [Contentstack](https://www.contentstack.com/). All Rights Reserved
155+
Copyright © 2012-2023 [Contentstack](https://www.contentstack.com/). All Rights Reserved
136156

137-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
157+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
158+
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
159+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
160+
persons to whom the Software is furnished to do so, subject to the following conditions:
138161

139-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
162+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
163+
Software.
140164

141-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
165+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
166+
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
167+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
168+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
142169

143170
- [Content Delivery API Docs](https://contentstack.com/docs/apis/content-delivery-api/)

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ Read through to understand how to use the Sync API with Contentstack Python SDK.
137137
The MIT License (MIT)
138138
^^^^^^^^^^^^^^^^^^^^^
139139

140-
Copyright © 2012-2020 Contentstack. All Rights Reserved Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
140+
Copyright © 2012-2023 Contentstack. All Rights Reserved Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
141141

142142
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
143143

SECURITY.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Security
2+
3+
Contentstack takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations.
4+
5+
If you believe you have found a security vulnerability in any Contentstack-owned repository, please report it to us as described below.
6+
7+
## Reporting Security Issues
8+
9+
**Please do not report security vulnerabilities through public GitHub issues.**
10+
11+
Send email to [[email protected]](mailto:[email protected]).
12+
13+
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message.
14+
15+
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
16+
17+
- Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
18+
- Full paths of source file(s) related to the manifestation of the issue
19+
- The location of the affected source code (tag/branch/commit or direct URL)
20+
- Any special configuration required to reproduce the issue
21+
- Step-by-step instructions to reproduce the issue
22+
- Proof-of-concept or exploit code (if possible)
23+
- Impact of the issue, including how an attacker might exploit the issue
24+
25+
This information will help us triage your report more quickly.
26+
27+
[https://www.contentstack.com/trust/](https://www.contentstack.com/trust/)

changelog.rst

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,21 @@
22
**CHANGELOG**
33
================
44

5-
*v1.7.0*
5+
*v1.8.0*
6+
============
7+
8+
**Date: 26-MAY-2023**
69

10+
- AZURE_EU, Region support added
11+
- Include Metadata support added to asset, entry and query
12+
- General code improvement clean up
13+
- Updated code for Live Preview
14+
15+
16+
*v1.7.0*
717
============
818

9-
**Date: 8-APR-2022**
19+
**Date: 08-APR-2022**
1020

1121
Region support added.
1222
- AZURE_NA support added

contentstack/__init__.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
The __init__.py files are required to make Python treat the directories as containing
33
packages; this is done to prevent directories with a common name, such as string,
44
from unintentionally hiding valid modules that occur later on the module search path
5-
6-
Used: Safety checks your installed dependencies for known security vulnerabilities
7-
file __init__.py contains package information like
8-
__author__, __status__, __version__, __endpoint__ and __email__
9-
105
"""
116
from .entry import Entry
127
from .asset import Asset
@@ -16,8 +11,9 @@
1611
from .utility import Utils
1712

1813
__title__ = 'contentstack-python'
19-
__author__ = 'Contentstack'
14+
__author__ = 'contentstack'
2015
__status__ = 'debug'
21-
__version__ = '1.7.0'
16+
__version__ = 'v1.8.0'
2217
__endpoint__ = 'cdn.contentstack.io'
23-
__email__ = '[email protected]'
18+
__email__ = '[email protected]'
19+
__developer_email__ = '[email protected]'

0 commit comments

Comments
 (0)