Skip to content

Commit 27b8338

Browse files
Updated Syntax for contentstack client connection (#43) (#44)
* Updated Syntax for contentstack client connection * Make the code uniformity * Code uniformity * Updated Readme file
1 parent 87b4835 commit 27b8338

File tree

140 files changed

+710
-717
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+710
-717
lines changed

.talismanrc

+16-1
Original file line numberDiff line numberDiff line change
@@ -324,4 +324,19 @@ fileignoreconfig:
324324
- filename: tests/mock/extensions/test_extension_mock.py
325325
checksum: 88bf3b97761c880dc360e358018150e198117a2acef812d1f9ff4653708f8b5c
326326
version: ""
327-
327+
fileignoreconfig:
328+
- filename: contentstack_management/environments/environment.py
329+
checksum: f689b0564c0f35929d3a6f086d31baa6ea37c9a7fea3f6dec8988fcfc3a245e3
330+
- filename: tests/api/environments/test_environments_api.py
331+
checksum: 72490f48a6f3346db6a00d80ce78c2dbc55219999270c75dd80d6ab66a8ffb40
332+
- filename: tests/mock/environments/test_environments_mock.py
333+
checksum: b6a2c104b7296034064318c7c9c826bfe81aa84c511fffe8199393a4787f8306
334+
- filename: tests/unit/environments/test_environment_unit.py
335+
checksum: 3a8efa44ba5bfaf4e599d76a0da933cbe883df5a13c3b0edce9d383b50ea4bfe
336+
- filename: contentstack_management/aliases/aliases.py
337+
checksum: 96ebf3aa2256234997d5a50fa78310683b3eb8182f3904d95fa4b155ce0b6f94
338+
- filename: contentstack_management/branches/branches.py
339+
checksum: a02a5821d8dbf0a2e364bbae87ca25d182c6edf56fdceb2e8e7c68874c15f0e4
340+
- filename: contentstack_management/content_types/content_type.py
341+
checksum: 0a00803d139fef0b91ba6f2a38af41bd02e6a8a3390e74f9c8c2b85bf6162d9a
342+
version: ""

CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
---
66

7-
## v0.0.1
7+
## v1.0.0
88

9-
#### Date: December-23
9+
#### Date: October-23
1010

1111
### Initial Release
1212

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ pip install contentstack_management
2121
```
2222
To import the SDK, use the following command:
2323
```python
24-
from contentstack_management import contentstack
24+
import contentstack_management
2525

26-
client = contentstack.ContentstackClient()
26+
client = contentstack_management.Client(authtoken='your_authtoken')
2727
```
2828

2929
### Authentication
@@ -32,7 +32,7 @@ To use this SDK, you need to authenticate your users by using the Authtoken, cre
3232

3333
An **Authtoken** is a read-write token used to make authorized CMA requests, and it is a **user-specific** token.
3434
```python
35-
client = contentstack.ContentstackClient(authtoken= 'authtoken')
35+
client = contentstack_management.Client(authtoken= 'your_authtoken')
3636
```
3737
### Login
3838
To Login to Contentstack by using credentials, you can use the following lines of code:
@@ -54,9 +54,9 @@ print(result)
5454
To use the Python CMA SDK, you need to first initialize it. To do this, use the following code:
5555

5656
```python
57-
from contentstack_management import contentstack
57+
import contentstack_management
5858

59-
client = contentstack.ContentstackClient(authtoken= 'authtoken')
59+
client = contentstack_management.Client(authtoken= 'your_authtoken')
6060
```
6161
#### Fetch Stack Detail
6262
Use the following lines of code to fetch your stack detail using this SDK:

contentstack_management/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from .auditlogs.auditlog import Auditlog
1717
from .environments.environment import Environment
1818
from .entries.entry import Entry
19-
from .contentstack import ContentstackClient, Region
19+
from .contentstack import Client, Region
2020
from ._api_client import _APIClient
2121
from .common import Parameter
2222
from ._errors import ArgumentException
@@ -34,7 +34,7 @@
3434

3535

3636
__all__ = (
37-
"ContentstackClient",
37+
"Client",
3838
"Region",
3939
"_APIClient",
4040
"Parameter",
@@ -72,7 +72,7 @@
7272
__author__ = 'ishaileshmishra'
7373
__status__ = 'debug'
7474
__region__ = 'na'
75-
__version__ = '0.0.1'
75+
__version__ = '1.0.0'
7676
__host__ = 'api.contentstack.io'
7777
__protocol__ = 'https://'
7878
__api_version__ = 'v3'
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from contentstack_management import contentstack
1+
import contentstack_management

contentstack_management/aliases/aliases.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ def find(self):
2525
:return: Returns all the aliases
2626
--------------------------------
2727
[Example:]
28-
>>> from contentstack_management import contentstack
29-
>>> alias = contentstack.ContentstackClient().stack(api_key='api_key').alias()
28+
>>> import contentstack_management
29+
>>> alias = contentstack_management.Client(authtoken='your_authtoken').stack(api_key='api_key').alias()
3030
>>> response = alias.find()
3131
--------------------------------
3232
"""
@@ -41,8 +41,8 @@ def fetch(self):
4141
--------------------------------
4242
4343
[Example:]
44-
>>> from contentstack_management import contentstack
45-
>>> alias = contentstack.ContentstackClient().stack(api_key='api_key').alias('alias_uid')
44+
>>> import contentstack_management
45+
>>> alias = contentstack_management.Client(authtoken='your_authtoken').stack(api_key='api_key').alias('alias_uid')
4646
>>> response = alias.fetch()
4747
--------------------------------
4848
"""
@@ -67,7 +67,7 @@ def assign(self, data):
6767
>>> "target_branch": "test"
6868
>>> }
6969
>>> }
70-
>>> alias = contentstack.ContentstackClient().stack(api_key='api_key').alias("alias_uid")
70+
>>> alias = contentstack_management.Client(authtoken='your_authtoken').stack(api_key='api_key').alias("alias_uid")
7171
>>> response = alias.assign(data)
7272
--------------------------------
7373
"""
@@ -82,8 +82,8 @@ def delete(self):
8282
:return: Returns status code and message
8383
--------------------------------
8484
[Example:]
85-
>>> from contentstack_management import contentstack
86-
>>> alias = contentstack.ContentstackClient().stack(api_key='api_key').alias(alias_uid="alias_uid")
85+
>>> import contentstack_management
86+
>>> alias = contentstack_management.Client(authtoken='your_authtoken').stack(api_key='api_key').alias(alias_uid="alias_uid")
8787
>>> response = alias.delete()
8888
--------------------------------
8989
"""
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from contentstack_management import contentstack
1+
import contentstack_management

0 commit comments

Comments
 (0)