cjapy 0.2.2.post1__tar.gz → 0.2.2.post2__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.
- {cjapy-0.2.2.post1 → cjapy-0.2.2.post2}/PKG-INFO +1 -1
- cjapy-0.2.2.post2/cjapy/__version__.py +1 -0
- {cjapy-0.2.2.post1 → cjapy-0.2.2.post2}/cjapy/cjapy.py +41 -5
- {cjapy-0.2.2.post1 → cjapy-0.2.2.post2}/cjapy/projects.py +5 -1
- {cjapy-0.2.2.post1 → cjapy-0.2.2.post2}/cjapy.egg-info/PKG-INFO +1 -1
- {cjapy-0.2.2.post1 → cjapy-0.2.2.post2}/docs/releases.md +2 -0
- cjapy-0.2.2.post1/cjapy/__version__.py +0 -1
- {cjapy-0.2.2.post1 → cjapy-0.2.2.post2}/LICENSE +0 -0
- {cjapy-0.2.2.post1 → cjapy-0.2.2.post2}/README.md +0 -0
- {cjapy-0.2.2.post1 → cjapy-0.2.2.post2}/cjapy/__init__.py +0 -0
- {cjapy-0.2.2.post1 → cjapy-0.2.2.post2}/cjapy/config.py +0 -0
- {cjapy-0.2.2.post1 → cjapy-0.2.2.post2}/cjapy/configs.py +0 -0
- {cjapy-0.2.2.post1 → cjapy-0.2.2.post2}/cjapy/connector.py +0 -0
- {cjapy-0.2.2.post1 → cjapy-0.2.2.post2}/cjapy/requestCreator.py +0 -0
- {cjapy-0.2.2.post1 → cjapy-0.2.2.post2}/cjapy/token_provider.py +0 -0
- {cjapy-0.2.2.post1 → cjapy-0.2.2.post2}/cjapy/workspace.py +0 -0
- {cjapy-0.2.2.post1 → cjapy-0.2.2.post2}/cjapy.egg-info/SOURCES.txt +0 -0
- {cjapy-0.2.2.post1 → cjapy-0.2.2.post2}/cjapy.egg-info/dependency_links.txt +0 -0
- {cjapy-0.2.2.post1 → cjapy-0.2.2.post2}/cjapy.egg-info/requires.txt +0 -0
- {cjapy-0.2.2.post1 → cjapy-0.2.2.post2}/cjapy.egg-info/top_level.txt +0 -0
- {cjapy-0.2.2.post1 → cjapy-0.2.2.post2}/docs/authenticating_without_config_json.md +0 -0
- {cjapy-0.2.2.post1 → cjapy-0.2.2.post2}/docs/cja.md +0 -0
- {cjapy-0.2.2.post1 → cjapy-0.2.2.post2}/docs/getting_started.md +0 -0
- {cjapy-0.2.2.post1 → cjapy-0.2.2.post2}/docs/logging.md +0 -0
- {cjapy-0.2.2.post1 → cjapy-0.2.2.post2}/docs/main.md +0 -0
- {cjapy-0.2.2.post1 → cjapy-0.2.2.post2}/docs/projects.md +0 -0
- {cjapy-0.2.2.post1 → cjapy-0.2.2.post2}/docs/requestCreator.md +0 -0
- {cjapy-0.2.2.post1 → cjapy-0.2.2.post2}/docs/workspace.md +0 -0
- {cjapy-0.2.2.post1 → cjapy-0.2.2.post2}/pyproject.toml +0 -0
- {cjapy-0.2.2.post1 → cjapy-0.2.2.post2}/requirements.txt +0 -0
- {cjapy-0.2.2.post1 → cjapy-0.2.2.post2}/setup.cfg +0 -0
- {cjapy-0.2.2.post1 → cjapy-0.2.2.post2}/setup.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.2.2-2"
|
|
@@ -988,18 +988,54 @@ class CJA:
|
|
|
988
988
|
res = self.connector.postData(self.endpoint + path, data=data)
|
|
989
989
|
return res
|
|
990
990
|
|
|
991
|
-
def createDataView(self,
|
|
991
|
+
def createDataView(self,
|
|
992
|
+
data: Union[dict, IO] = None,
|
|
993
|
+
name:str=None,
|
|
994
|
+
connectionId:str=None,
|
|
995
|
+
description:str="power by cjapy",
|
|
996
|
+
timeZone:str="US/Mountain",
|
|
997
|
+
minuteInactivity:int=30,
|
|
998
|
+
**kwargs) -> dict:
|
|
992
999
|
"""
|
|
993
1000
|
Create and stores the given Data View in the db.
|
|
994
1001
|
Arguments:
|
|
995
1002
|
data : REQUIRED : The dictionary or json file that holds the definition for the dataview to be created.
|
|
1003
|
+
name : OPTIONAL : If you want to pass the name of the data View (and not pass the whole definition)
|
|
1004
|
+
connectionId : OPTIONAL : If you want to pass the connectionId of the data View (and not pass the whole definition)
|
|
1005
|
+
timezone : OPTIONAL : The timezone to use in the data View (see here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
|
|
1006
|
+
common timezone: US/Montain, US/Pacific, US/Michigan, US/Central, Europe/London, Europe/Paris, Asia/Tokyo, Australia/Sydney
|
|
1007
|
+
minuteInactivity : OPTIONAL : number of minutes of inactivity before closing a session
|
|
996
1008
|
"""
|
|
997
1009
|
path = "/datagroups/dataviews/"
|
|
998
|
-
if data is None:
|
|
1010
|
+
if data is None and name is None and connectionId is None:
|
|
999
1011
|
raise ValueError("Require information to be passed for data view creation")
|
|
1000
|
-
if
|
|
1001
|
-
|
|
1002
|
-
data =
|
|
1012
|
+
if data is not None:
|
|
1013
|
+
if ".json" in data:
|
|
1014
|
+
with open(data, "r", encoding=kwargs.get("encoding", "utf-8")) as f:
|
|
1015
|
+
data = json.load(f)
|
|
1016
|
+
data = data
|
|
1017
|
+
if data is None and name is not None and connectionId is not None:
|
|
1018
|
+
data = {
|
|
1019
|
+
"name": name,
|
|
1020
|
+
"description": description,
|
|
1021
|
+
"parentDataGroupId": connectionId,
|
|
1022
|
+
"timezoneDesignator": timeZone,
|
|
1023
|
+
"sessionDefinition": [
|
|
1024
|
+
{
|
|
1025
|
+
"numPeriods": minuteInactivity,
|
|
1026
|
+
"granularity": "MINUTE",
|
|
1027
|
+
"func": "INACTIVITY",
|
|
1028
|
+
"events": [
|
|
1029
|
+
"string"
|
|
1030
|
+
]
|
|
1031
|
+
}
|
|
1032
|
+
],
|
|
1033
|
+
"organization": self.connector.config['org_id'],
|
|
1034
|
+
"externalData": {
|
|
1035
|
+
"externalParentId": connectionId
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
}
|
|
1003
1039
|
if self.loggingEnabled:
|
|
1004
1040
|
self.logger.debug(f"createDataView start")
|
|
1005
1041
|
res = self.connector.postData(self.endpoint + path, data=data, **kwargs)
|
|
@@ -27,6 +27,8 @@ class Project:
|
|
|
27
27
|
self.template: bool = projectDict.get("companyTemplate", False)
|
|
28
28
|
self.type: str = projectDict.get('type',None)
|
|
29
29
|
self.version: str = None
|
|
30
|
+
self.curation: bool = False
|
|
31
|
+
self.reportType:str = None
|
|
30
32
|
if "definition" in projectDict.keys() and projectDict.get('type') == "project":
|
|
31
33
|
definition: dict = projectDict["definition"]
|
|
32
34
|
self.version: str = definition.get("version", None)
|
|
@@ -51,6 +53,7 @@ class Project:
|
|
|
51
53
|
)
|
|
52
54
|
else:
|
|
53
55
|
self.reportType = "mobile"
|
|
56
|
+
self.version: str = projectDict.get("definition",{}).get("version", None)
|
|
54
57
|
elif "definition" in projectDict.keys() and projectDict.get('type') == "guidedAnalysis":
|
|
55
58
|
self.reportType = "guidedAnalysis"
|
|
56
59
|
definition: dict = projectDict["definition"]
|
|
@@ -74,7 +77,8 @@ class Project:
|
|
|
74
77
|
+ len(self.elementsUsed["filters"])
|
|
75
78
|
+ len(self.elementsUsed["calculatedMetrics"])
|
|
76
79
|
)
|
|
77
|
-
|
|
80
|
+
else:
|
|
81
|
+
self.reportType = projectDict.get('type','unknown')
|
|
78
82
|
def __str__(self) -> str:
|
|
79
83
|
return json.dumps(self.to_dict(), indent=4)
|
|
80
84
|
|
|
@@ -10,6 +10,8 @@ The changes have been tracked starting version 0.1.0
|
|
|
10
10
|
Patch:
|
|
11
11
|
* Changing Oauth V2 to V3
|
|
12
12
|
* Accepting more elements as credentials
|
|
13
|
+
* Fixing some edge cases of `findComponentUsage`
|
|
14
|
+
* adding more parameters for `createDataView` methods
|
|
13
15
|
|
|
14
16
|
## 0.2.1
|
|
15
17
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.2.2-1"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|