cjapy 0.2.2.post2__tar.gz → 0.2.2.post4__tar.gz

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.
Files changed (32) hide show
  1. {cjapy-0.2.2.post2 → cjapy-0.2.2.post4}/PKG-INFO +1 -1
  2. cjapy-0.2.2.post4/cjapy/__version__.py +1 -0
  3. {cjapy-0.2.2.post2 → cjapy-0.2.2.post4}/cjapy/cjapy.py +1 -1
  4. {cjapy-0.2.2.post2 → cjapy-0.2.2.post4}/cjapy/requestCreator.py +29 -7
  5. {cjapy-0.2.2.post2 → cjapy-0.2.2.post4}/cjapy.egg-info/PKG-INFO +1 -1
  6. {cjapy-0.2.2.post2 → cjapy-0.2.2.post4}/docs/authenticating_without_config_json.md +3 -9
  7. {cjapy-0.2.2.post2 → cjapy-0.2.2.post4}/docs/main.md +13 -5
  8. {cjapy-0.2.2.post2 → cjapy-0.2.2.post4}/docs/releases.md +3 -1
  9. cjapy-0.2.2.post2/cjapy/__version__.py +0 -1
  10. {cjapy-0.2.2.post2 → cjapy-0.2.2.post4}/LICENSE +0 -0
  11. {cjapy-0.2.2.post2 → cjapy-0.2.2.post4}/README.md +0 -0
  12. {cjapy-0.2.2.post2 → cjapy-0.2.2.post4}/cjapy/__init__.py +0 -0
  13. {cjapy-0.2.2.post2 → cjapy-0.2.2.post4}/cjapy/config.py +0 -0
  14. {cjapy-0.2.2.post2 → cjapy-0.2.2.post4}/cjapy/configs.py +0 -0
  15. {cjapy-0.2.2.post2 → cjapy-0.2.2.post4}/cjapy/connector.py +0 -0
  16. {cjapy-0.2.2.post2 → cjapy-0.2.2.post4}/cjapy/projects.py +0 -0
  17. {cjapy-0.2.2.post2 → cjapy-0.2.2.post4}/cjapy/token_provider.py +0 -0
  18. {cjapy-0.2.2.post2 → cjapy-0.2.2.post4}/cjapy/workspace.py +0 -0
  19. {cjapy-0.2.2.post2 → cjapy-0.2.2.post4}/cjapy.egg-info/SOURCES.txt +0 -0
  20. {cjapy-0.2.2.post2 → cjapy-0.2.2.post4}/cjapy.egg-info/dependency_links.txt +0 -0
  21. {cjapy-0.2.2.post2 → cjapy-0.2.2.post4}/cjapy.egg-info/requires.txt +0 -0
  22. {cjapy-0.2.2.post2 → cjapy-0.2.2.post4}/cjapy.egg-info/top_level.txt +0 -0
  23. {cjapy-0.2.2.post2 → cjapy-0.2.2.post4}/docs/cja.md +0 -0
  24. {cjapy-0.2.2.post2 → cjapy-0.2.2.post4}/docs/getting_started.md +0 -0
  25. {cjapy-0.2.2.post2 → cjapy-0.2.2.post4}/docs/logging.md +0 -0
  26. {cjapy-0.2.2.post2 → cjapy-0.2.2.post4}/docs/projects.md +0 -0
  27. {cjapy-0.2.2.post2 → cjapy-0.2.2.post4}/docs/requestCreator.md +0 -0
  28. {cjapy-0.2.2.post2 → cjapy-0.2.2.post4}/docs/workspace.md +0 -0
  29. {cjapy-0.2.2.post2 → cjapy-0.2.2.post4}/pyproject.toml +0 -0
  30. {cjapy-0.2.2.post2 → cjapy-0.2.2.post4}/requirements.txt +0 -0
  31. {cjapy-0.2.2.post2 → cjapy-0.2.2.post4}/setup.cfg +0 -0
  32. {cjapy-0.2.2.post2 → cjapy-0.2.2.post4}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cjapy
3
- Version: 0.2.2.post2
3
+ Version: 0.2.2.post4
4
4
  Summary: Adobe Customer Journey Analytics (CJA) wrapper
5
5
  Home-page: https://github.com/pitchmuc/cjapy
6
6
  Author: Julien Piccini
@@ -0,0 +1 @@
1
+ __version__ = "0.2.2-4"
@@ -245,7 +245,7 @@ class CJA:
245
245
  """
246
246
  if calcId is None:
247
247
  raise ValueError("Require a calculated metrics")
248
- if data is None or type(data) == dict:
248
+ if data is None or type(data) != dict:
249
249
  raise ValueError("Require a dictionary to create the calculated metrics")
250
250
  if self.loggingEnabled:
251
251
  self.logger.debug(f"updateCalculatedMetrics start, id: {calcId}")
@@ -212,17 +212,39 @@ class RequestCreator:
212
212
  """
213
213
  self.__request["settings"]["limit"] = limit
214
214
 
215
- def setSearch(self,itemIds:list=None)-> None:
215
+ def setSearch(self,itemIds:list=None,clause:str=None,reset:bool=True)-> None:
216
216
  """
217
217
  Set the items ID search in the specified dimension
218
218
  Arguments :
219
- itemIds : REQUIRED : The list of itemId to be searched in the dimension
220
- """
221
- if type(itemIds) != list:
222
- raise TypeError("itemIds should be a list of values")
223
- self.__request["search"]["itemIds"] = itemIds
219
+ itemIds : OPTIONAL : The list of itemId to be searched in the dimension
220
+ clause : OPTIONAL : If you want to set a specific clause such as:
221
+ "( CONTAINS 'Python' ) AND ( CONTAINS 'Platform' )"
222
+ "( CONTAINS 'Python' ) OR ( CONTAINS 'Platform' )"
223
+ "( MATCH 'Python' )" : Equals
224
+ "( BEGINS-WITH 'Python' )"
225
+ "( NOT CONTAINS 'Python' )"
226
+ reset : OPTIONAL : automatically reset the search from your request
227
+ """
228
+ if reset:
229
+ self.__request['search']={}
230
+ if itemIds is not None:
231
+ self.__request["search"]["itemIds"] = itemIds
232
+ elif clause is not None:
233
+ self.__request["search"]["clause"] = clause
224
234
  self.search = True
225
-
235
+
236
+ # def addDimensions(self,dimensionIds:list=None)->None:
237
+ # """
238
+ # In case you want to pass a list of dimensions to the report API.
239
+ # Arguments:
240
+ # dimensionIds : REQUIRED : The list of dimensions IDs you want to use
241
+ # """
242
+ # if dimensionIds is None:
243
+ # raise ValueError("dimensionIds parameters should be used")
244
+ # if type(dimensionIds) != list:
245
+ # raise TypeError("dimensionIds should be a list")
246
+ # self.__request["dimension"] = dimensionIds
247
+
226
248
  def removeSearch(self)->None:
227
249
  """
228
250
  Remove the search capability in the request.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cjapy
3
- Version: 0.2.2.post2
3
+ Version: 0.2.2.post4
4
4
  Summary: Adobe Customer Journey Analytics (CJA) wrapper
5
5
  Home-page: https://github.com/pitchmuc/cjapy
6
6
  Author: Julien Piccini
@@ -35,31 +35,25 @@ import os
35
35
 
36
36
  USER = os.getenv('API_USER')
37
37
  PASSWORD = os.environ.get('API_PASSWORD')
38
+ ...
38
39
  ```
39
40
 
40
41
  ## 3. using the configure method
41
42
 
42
43
  The `cjapy` module provide a configure method that will set the correct value to be used in the module.
43
44
 
44
- **Note** : Be careful there is a possibility to pass the `path_to_key` or `private_key` to the configure method.\
45
- Select the correct method:
46
-
47
- * path_to_key : the element is a path to a file containing your key.
48
- * private_key : the element is the key as a string directly.
49
-
50
45
  ```python
51
46
  import os
52
47
 
53
48
  my_org_id = os.getenv('org_id')
54
49
  my_tech_id = os.environ.get('tech_id')
55
50
  my_secret = os.environ.get('secret')
56
- my_path_to_key = os.environ.get('path_to_key')
57
51
  my_client_id = os.environ.get('client_id')
58
-
52
+ my_scopes = os.environ.get('scopes')
59
53
 
60
54
  import cjapy
61
55
 
62
- cjapy.configure(org_id=my_org_id,tech_id=my_tech_id, secret=my_secret,path_to_key=my_path_to_key,client_id=my_client_id)
56
+ cjapy.configure(org_id=my_org_id,tech_id=my_tech_id, secret=my_secret,client_id=my_client_id,scopes=my_scopes)
63
57
 
64
58
  ```
65
59
 
@@ -13,14 +13,18 @@ The methods available directly from the module are the following:
13
13
  ### createConfigFile
14
14
 
15
15
  This methods allows you to create JSON file that will host the different information required for your connection to Adobe IO and to retrieve the token.\
16
- It usually is like this.
16
+ It has 2 possible parameters:
17
+ * filename : OPTIONAL : If you want to create your config file from a specific name
18
+ * auth_type : OPTIONAL : By default using OauthV2 (Server-to-Server) but can be changed to `jwt`. JWT will be discontinue in 2025.
19
+
20
+ It usually looks like this.
17
21
 
18
22
  ```python
19
23
  import aanalytics2 as api2
20
24
  api2.createConfigFile()
21
25
  ```
22
26
 
23
- As you can see, it takes no argument and the output of the file will look like this :
27
+ As you can see, it no arguments are required and the output of the file will look like this :
24
28
 
25
29
  ```JavaScript
26
30
  {
@@ -28,12 +32,13 @@ As you can see, it takes no argument and the output of the file will look like t
28
32
  'client_id': "<clientId>",
29
33
  'tech_id': "<something>@techacct.adobe.com",
30
34
  'secret': "<YourSecret>",
31
- 'pathToKey': '<path/to/your/privatekey.key>',
35
+ 'scopes': '<scopesServerToServer>',
32
36
  }
33
37
  ```
34
38
 
35
39
  You update the information from the Adobe IO account that you have setup.
36
40
 
41
+
37
42
  ### importConfigFile
38
43
 
39
44
  As you have created your JSON config file, you will need to import it before realizing any request to the Analytics API.\
@@ -63,8 +68,11 @@ The different arguments are:
63
68
  * tech_id : REQUIRED : Technical Account ID
64
69
  * secret : REQUIRED : secret generated for your connection
65
70
  * client_id : REQUIRED : The client_id (old api_key) provided by the JWT connection.
66
- * path_to_key : REQUIRED : If you have a file containing your private key value.
67
- * private_key : REQUIRED : If you do not use a file but pass a variable directly.
71
+ * scopes : REQUIRED : Require if using the oauth Server to Server
72
+ * path_to_key : REQUIRED : If you have a file containing your private key value. If using jwt.
73
+ * private_key : REQUIRED : If you do not use a file but pass a variable directly. If using jwt.
74
+
75
+ **Note**: JWT integration will be discontinue in 2025. Hence we do not recommend starting a new integration using the `path_to_key` and `private_key` parameters.
68
76
 
69
77
  ### CJA class
70
78
 
@@ -11,7 +11,9 @@ Patch:
11
11
  * Changing Oauth V2 to V3
12
12
  * Accepting more elements as credentials
13
13
  * Fixing some edge cases of `findComponentUsage`
14
- * adding more parameters for `createDataView` methods
14
+ * Adding more parameters for `createDataView` methods
15
+ * Fixing `updateCalculatedMetric`
16
+ * Fixing the `setSearch`
15
17
 
16
18
  ## 0.2.1
17
19
 
@@ -1 +0,0 @@
1
- __version__ = "0.2.2-2"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes