launchpy 0.4.4__tar.gz → 0.4.4.post1__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 (31) hide show
  1. {launchpy-0.4.4/launchpy.egg-info → launchpy-0.4.4.post1}/PKG-INFO +5 -2
  2. {launchpy-0.4.4 → launchpy-0.4.4.post1}/docs/property.md +4 -0
  3. {launchpy-0.4.4 → launchpy-0.4.4.post1}/docs/releases.md +5 -1
  4. launchpy-0.4.4.post1/launchpy/__version__.py +1 -0
  5. {launchpy-0.4.4 → launchpy-0.4.4.post1}/launchpy/property.py +32 -5
  6. {launchpy-0.4.4 → launchpy-0.4.4.post1}/launchpy/synchronizer.py +21 -1
  7. {launchpy-0.4.4 → launchpy-0.4.4.post1/launchpy.egg-info}/PKG-INFO +5 -2
  8. launchpy-0.4.4/launchpy/__version__.py +0 -1
  9. {launchpy-0.4.4 → launchpy-0.4.4.post1}/LICENSE +0 -0
  10. {launchpy-0.4.4 → launchpy-0.4.4.post1}/README.md +0 -0
  11. {launchpy-0.4.4 → launchpy-0.4.4.post1}/docs/admin.md +0 -0
  12. {launchpy-0.4.4 → launchpy-0.4.4.post1}/docs/getstarted.md +0 -0
  13. {launchpy-0.4.4 → launchpy-0.4.4.post1}/docs/library.md +0 -0
  14. {launchpy-0.4.4 → launchpy-0.4.4.post1}/docs/main.md +0 -0
  15. {launchpy-0.4.4 → launchpy-0.4.4.post1}/docs/synchronizer.md +0 -0
  16. {launchpy-0.4.4 → launchpy-0.4.4.post1}/docs/translator.md +0 -0
  17. {launchpy-0.4.4 → launchpy-0.4.4.post1}/launchpy/__init__.py +0 -0
  18. {launchpy-0.4.4 → launchpy-0.4.4.post1}/launchpy/admin.py +0 -0
  19. {launchpy-0.4.4 → launchpy-0.4.4.post1}/launchpy/config.py +0 -0
  20. {launchpy-0.4.4 → launchpy-0.4.4.post1}/launchpy/configs.py +0 -0
  21. {launchpy-0.4.4 → launchpy-0.4.4.post1}/launchpy/connector.py +0 -0
  22. {launchpy-0.4.4 → launchpy-0.4.4.post1}/launchpy/launchpy.py +0 -0
  23. {launchpy-0.4.4 → launchpy-0.4.4.post1}/launchpy/library.py +0 -0
  24. {launchpy-0.4.4 → launchpy-0.4.4.post1}/launchpy.egg-info/SOURCES.txt +0 -0
  25. {launchpy-0.4.4 → launchpy-0.4.4.post1}/launchpy.egg-info/dependency_links.txt +0 -0
  26. {launchpy-0.4.4 → launchpy-0.4.4.post1}/launchpy.egg-info/requires.txt +0 -0
  27. {launchpy-0.4.4 → launchpy-0.4.4.post1}/launchpy.egg-info/top_level.txt +0 -0
  28. {launchpy-0.4.4 → launchpy-0.4.4.post1}/pyproject.toml +0 -0
  29. {launchpy-0.4.4 → launchpy-0.4.4.post1}/requirements.txt +0 -0
  30. {launchpy-0.4.4 → launchpy-0.4.4.post1}/setup.cfg +0 -0
  31. {launchpy-0.4.4 → launchpy-0.4.4.post1}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: launchpy
3
- Version: 0.4.4
3
+ Version: 0.4.4.post1
4
4
  Summary: Adobe Launch API wrapper
5
5
  Home-page: https://github.com/pitchmuc/launchpy
6
6
  Author: Julien Piccini
@@ -30,6 +30,9 @@ Requires-Dist: pathlib2
30
30
  Requires-Dist: pathlib
31
31
  Provides-Extra: dynamic
32
32
  Requires-Dist: version; extra == "dynamic"
33
+ Dynamic: author
34
+ Dynamic: home-page
35
+ Dynamic: requires-python
33
36
 
34
37
  # Launchpy
35
38
 
@@ -326,6 +326,10 @@ They are not propertly defined by the Launch API, they have some business logic
326
326
  * save : OPTIONAL : bool, if you want to save the setting in a JS or JSON file, set it to true. (default False)
327
327
  * encoding : OPTIONAL : encoding to be used for saving the file.
328
328
 
329
+ * **extractRuleComponents** : Extract the ruleComponents reference URL from the rule definition. It can be useful for extracting rule components from the last published rule.
330
+ Arguments:
331
+ * rule : REQUIRED : A dictionary that provide the definition of the rule.
332
+
329
333
  * **findRuleComponentSettingsFileName** : Return the filename use to save your custom code of your ruleComponent in a file using the extractSettings method.\
330
334
  Returns None when this is not a Custom code from CORE or Adobe Analytics. \
331
335
  Argument:
@@ -7,7 +7,11 @@ This has been started after the 0.3.0 release.\
7
7
  * adding a `getBuilds` method on the `Library` class instance
8
8
  * extend support for pagination on `getEnvironments`
9
9
  * adding `getProductionEndpoint` and `getStagingEndpoint` to retrieve the URL to use on websites
10
- * support the instantiation of the `Library` class via a single libraryId string.
10
+ * support the instantiation of the `Library` class via a single libraryId string.\
11
+ Patch:
12
+ * adding a name parameter for the `checkExtensionUpdate` method
13
+ * adding the `extractRuleComponents` method in property.
14
+
11
15
 
12
16
  ## 0.4.3
13
17
  * Refactor `Translator` class for removing `pandas` dependency\
@@ -0,0 +1 @@
1
+ __version__ = "0.4.4-1"
@@ -146,13 +146,14 @@ class Property:
146
146
  data = extensions
147
147
  return data
148
148
 
149
- def checkExtensionUpdate(self, platform: str = "web", verbose: bool = False):
149
+ def checkExtensionUpdate(self, name:str=None, platform: str = "web", verbose: bool = False):
150
150
  """
151
151
  Returns a dictionary of extensions with their names, ids and if there is an update.
152
152
  If there is an update available, the id returned is the latest id (to be used for installation).
153
153
  It can be re-use for installation and for checking for update.
154
154
  Arguments:
155
- platform : REQUIRED : if you need to look for extension on a specific platform (default web).
155
+ name : OPTIONAL : If you want to check for a specific extension
156
+ platform : OPTIONAL : if you need to look for extension on a specific platform (default web).
156
157
  verbose: OPTIONAL : if set to True, will print the different name and id of the extensions checked.
157
158
  Dictionary example:
158
159
  {'adobe-mcid':
@@ -162,13 +163,18 @@ class Property:
162
163
  }
163
164
  """
164
165
  extensions = self.getExtensions()
165
- dict_extensions = {ext['attributes']['name']: {'package_id': ext['relationships']['extension_package']['data']['id'],
166
+ if name is None:
167
+ dict_extensions = {ext['attributes']['name']: {'package_id': ext['relationships']['extension_package']['data']['id'],
166
168
  'update': False,
167
169
  'internal_id': ext['id']
168
170
  } for ext in extensions}
171
+ else:
172
+ dict_extensions = {ext['attributes']['name']: {'package_id': ext['relationships']['extension_package']['data']['id'],
173
+ 'update': False,
174
+ 'internal_id': ext['id']
175
+ } for ext in extensions if ext['attributes']['name'] == name}
169
176
  for name in dict_extensions:
170
- new_id = self._getExtensionPackage(
171
- name, platform=platform, verbose=verbose)
177
+ new_id = self._getExtensionPackage(name, platform=platform, verbose=verbose)
172
178
  if new_id != dict_extensions[name]['package_id']:
173
179
  dict_extensions[name]['package_id'] = new_id
174
180
  dict_extensions[name]['update'] = True
@@ -304,6 +310,27 @@ class Property:
304
310
  'url': rule['links']['rule_components']
305
311
  }
306
312
  return data
313
+
314
+ def extractRuleComponents(self,rule:dict=None)->list:
315
+ """
316
+ Extract the rule component based on the rule definition.
317
+ Arguments:
318
+ rule : REQUIRED : The rule definition
319
+ """
320
+ if rule is None:
321
+ raise ValueError("No rule definition provided")
322
+ params={'page[number]':0}
323
+ rc_endpoint = rule['relationships']['rule_components']['links']['related']
324
+ page1 = self.getRessource(rc_endpoint)
325
+ data = page1.get('data',{})
326
+ next_page = page1.get('meta',{}).get('pagination',{}).get('next_page',None)
327
+ while next_page is not None:
328
+ params['page[number]'] = next_page
329
+ pageN = self.connector.getData(rc_endpoint,params=params)
330
+ data += pageN.get('data',[])
331
+ next_page = pageN.get('meta',{}).get('pagination',{}).get('next_page',None)
332
+ return data
333
+
307
334
 
308
335
  def getRuleComponents(self, verbose:bool=False,**kwargs)->dict:
309
336
  """
@@ -37,7 +37,7 @@ class Synchronizer:
37
37
  raise KeyError("The base property name has not been found in your account")
38
38
  self.base = {}
39
39
  self.base["name"] = base
40
- self.base["api"] = Property(base_property[0])
40
+ self.base["api"]:Property = Property(base_property[0])
41
41
  self.base['rules'] = self.base['api'].getRules()
42
42
  self.base['dataElements'] = self.base['api'].getDataElements()
43
43
  self.base['extensions'] = self.base['api'].getExtensions()
@@ -353,6 +353,26 @@ class Synchronizer:
353
353
  if len(newDataElements)>0:
354
354
  self.targets[target]['library'].addDataElements(newDataElements)
355
355
 
356
+ def upgradeTargetExtension(self,extensionName:str=None,platform:str="web")->dict:
357
+ """
358
+ Upgrade the name extension in the target properties.
359
+ Arguments:
360
+ extensionName : REQUIRED : The name of the extension to upgrade.
361
+ ex : "core" or "adobe-analytics"
362
+ platform : OPTIONAL : If you want to update the extension of a specific platform (default "web")
363
+ """
364
+ if extensionName is None:
365
+ raise ValueError("Require an extension name")
366
+ for prop, target in self.targets:
367
+ try:
368
+ extensionUpdate = target['api'].checkExtensionUpdate(extensionName)
369
+ except:
370
+ raise ValueError(f"Could not find an extension name: {extensionName}")
371
+
372
+
373
+
374
+
375
+
356
376
  def renameComponent(self,old_name:str=None,new_name:str=None)->None:
357
377
  """
358
378
  Passing the old and new name of a component, it will rename the component in the different target properties.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: launchpy
3
- Version: 0.4.4
3
+ Version: 0.4.4.post1
4
4
  Summary: Adobe Launch API wrapper
5
5
  Home-page: https://github.com/pitchmuc/launchpy
6
6
  Author: Julien Piccini
@@ -30,6 +30,9 @@ Requires-Dist: pathlib2
30
30
  Requires-Dist: pathlib
31
31
  Provides-Extra: dynamic
32
32
  Requires-Dist: version; extra == "dynamic"
33
+ Dynamic: author
34
+ Dynamic: home-page
35
+ Dynamic: requires-python
33
36
 
34
37
  # Launchpy
35
38
 
@@ -1 +0,0 @@
1
- __version__ = "0.4.4"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes