contentstack-utils 1.1.0__py3-none-any.whl → 1.2.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- Copyright 2021 Contentstack
1
+ Copyright 2023 Contentstack
2
2
 
3
3
  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:
4
4
 
@@ -1,11 +1,10 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: contentstack-utils
3
- Version: 1.1.0
3
+ Version: 1.2.2
4
4
  Summary: contentstack_utils is a Utility package for Contentstack headless CMS with an API-first approach.
5
5
  Home-page: https://github.com/contentstack/contentstack-utils-python
6
6
  Author: contentstack
7
7
  License: MIT
8
- Platform: UNKNOWN
9
8
  Classifier: License :: OSI Approved :: MIT License
10
9
  Classifier: Operating System :: OS Independent
11
10
  Classifier: Intended Audience :: Developers
@@ -51,7 +50,7 @@ If you are using Contentstack Python SDK in your project by running the followin
51
50
  ## For the specific version
52
51
 
53
52
  ```python
54
- pip install Contentstack==1.4.0
53
+ pip install Contentstack==1.5.1
55
54
  ```
56
55
 
57
56
  ## Usage
@@ -66,11 +65,9 @@ To render embedded items on the front-end, use the renderContents function, and
66
65
  from contentstack_utils.utils import Utils
67
66
  from contentstack_utils.render.options import Options
68
67
 
69
- json_array # should be type of dictionary or list
70
- rte_content = "html_string"
71
-
72
- callback = Options()
73
- response = Utils.render_content(rte_content, json_array, callback)
68
+ json_array = {} # should be type of dictionary or list
69
+ option = Options()
70
+ response = Utils.render_content('html_string', json_array, option)
74
71
  print(response)
75
72
 
76
73
  ```
@@ -126,9 +123,24 @@ query = stack.content_type("content_type_uid").query()
126
123
  result = query.find()
127
124
  if result is not None and 'entries' in result:
128
125
  entry = result['entries']
129
- for item in range:
126
+ for item in entry:
130
127
  option = Option()
131
128
  Utils.json_to_html(item, ['paragraph_text'], option)
132
129
  ```
133
130
 
131
+ ## GraphQL SRTE
132
+
133
+ To get supercharged items from multiple entries, you need to provide the stack API key, delivery token, environment name, and content type’s UID.
134
+
135
+ ```python
136
+ import contentstack
134
137
 
138
+ stack = contentstack.Stack('api_key','delivery_token','environment')
139
+ query = stack.content_type("content_type_uid").query()
140
+ result = query.find()
141
+ if result is not None and 'entries' in result:
142
+ entry = result['entries']
143
+ for item in entry:
144
+ option = Option()
145
+ GQL.json_to_html(item, ['paragraph_text'], option)
146
+ ```
@@ -0,0 +1,5 @@
1
+ contentstack_utils-1.2.2.dist-info/LICENSE,sha256=R_LrTgIRqwLf2eMDMxOiSWPCarr7IofJWsg6NlRqRtk,1051
2
+ contentstack_utils-1.2.2.dist-info/METADATA,sha256=wY-HLRrO6Qd34SA0CAJmFqDyoUjJvjYkcFVxxKzFNcI,4906
3
+ contentstack_utils-1.2.2.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
4
+ contentstack_utils-1.2.2.dist-info/top_level.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
5
+ contentstack_utils-1.2.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.36.2)
2
+ Generator: bdist_wheel (0.42.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,5 +0,0 @@
1
- contentstack_utils-1.1.0.dist-info/LICENSE,sha256=ItWIeIAApbjtN-CR8exObyxhGpnfkmNgs8UqfU9Ib7c,1051
2
- contentstack_utils-1.1.0.dist-info/METADATA,sha256=Vapva9V0qWc1aiK8EYk0q-8dGrs4pDvq4NWHsjj0w4A,4430
3
- contentstack_utils-1.1.0.dist-info/WHEEL,sha256=OqRkF0eY5GHssMorFjlbTIq072vpHpF60fIQA6lS9xA,92
4
- contentstack_utils-1.1.0.dist-info/top_level.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
5
- contentstack_utils-1.1.0.dist-info/RECORD,,