rolling-pin 0.10.0__py3-none-any.whl → 0.10.1__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.
rolling_pin/repo_etl.py CHANGED
@@ -335,17 +335,28 @@ class RepoETL():
335
335
  return data
336
336
 
337
337
  @staticmethod
338
- def _to_networkx_graph(data):
339
- # (DataFrame) -> networkx.DiGraph
338
+ def _to_networkx_graph(data, escape_chars=False):
339
+ # (DataFrame, bool) -> networkx.DiGraph
340
340
  '''
341
341
  Converts given DataFrame into networkx directed graph.
342
342
 
343
343
  Args:
344
- DataFrame: DataFrame of nodes.
344
+ data (DataFrame): DataFrame of nodes.
345
+ escape_chars (bool, optional): Escape special characters. Used to
346
+ avoid dot file errors. Default: False.
345
347
 
346
348
  Returns:
347
349
  networkx.DiGraph: Graph of nodes.
348
350
  '''
351
+ # escape periods for dot file interpolation
352
+ if escape_chars:
353
+ data = data.copy()
354
+ data.node_name = data.node_name \
355
+ .fillna('') \
356
+ .apply(lambda x: re.sub(r'\.', '\\.', x))
357
+ data.dependencies = data.dependencies \
358
+ .apply(lambda x: [re.sub(r'\.', '\\.', y) for y in x])
359
+
349
360
  graph = networkx.DiGraph()
350
361
  data.apply(
351
362
  lambda x: graph.add_node(
@@ -406,7 +417,7 @@ class RepoETL():
406
417
  color_scheme = rpt.COLOR_SCHEME
407
418
 
408
419
  # create dot graph
409
- graph = self.to_networkx_graph()
420
+ graph = self._to_networkx_graph(self._data, escape_chars=True)
410
421
  dot = networkx.drawing.nx_pydot.to_pydot(graph)
411
422
 
412
423
  # set layout orientation
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rolling-pin
3
- Version: 0.10.0
3
+ Version: 0.10.1
4
4
  Summary: A library of generic tools for ETL work and visualization of JSON blobs and python repositories
5
5
  License: MIT
6
6
  Keywords: ETL,blob,dependency,graph,svg,networkx,transform,code metrics,dependency diagram,build system
@@ -19,10 +19,10 @@ Requires-Dist: graphviz
19
19
  Requires-Dist: ipython
20
20
  Requires-Dist: lunchbox
21
21
  Requires-Dist: networkx
22
- Requires-Dist: numpy<=1.24.4,>=1.23.4
22
+ Requires-Dist: numpy>=1.23.4
23
23
  Requires-Dist: pandas>=1.1.5
24
24
  Requires-Dist: plotly>=5.22.0
25
- Requires-Dist: pydot<=1.4.2
25
+ Requires-Dist: pydot>=1.4.2
26
26
  Requires-Dist: pyyaml
27
27
  Requires-Dist: radon<6.0.0
28
28
  Requires-Dist: schematics
@@ -5,11 +5,11 @@ rolling_pin/conform_config.py,sha256=W-Ps6FPuZ7SOxFOfEjIo2MZac1vCRuVky6samSZPQkw
5
5
  rolling_pin/conform_etl.py,sha256=VyHAKVvdOtjx6Fy8dWn6XMfNh9OFgBbidyDUnSl3Zl4,9594
6
6
  rolling_pin/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  rolling_pin/radon_etl.py,sha256=0rxFSnv2z41vKFe35XqCHSnnjT9qNNjouaCcIYkcHgI,18252
8
- rolling_pin/repo_etl.py,sha256=W3ms6zdK22A6d9kVzHLP3HE1h0fTPMUeXww0c57Nq-k,20479
8
+ rolling_pin/repo_etl.py,sha256=Q6W-_4hTNh3nj5o9eTz5d7HuH5Kf9Uew8W9UD52dCJ0,21041
9
9
  rolling_pin/toml_etl.py,sha256=fyioQTfqFW1e15qZ8F64sX379V5JzNlBKBuC5IPIgIo,4350
10
10
  rolling_pin/tools.py,sha256=bLZGXDg5DuV59RxiVjLIwTAr83X5nMBElvR7w0mEnx8,19179
11
- rolling_pin-0.10.0.dist-info/entry_points.txt,sha256=nbMiJnGLhp49xrtx1pjK8sJiBrwkpj2kq-ezp8Zfyyk,56
12
- rolling_pin-0.10.0.dist-info/WHEEL,sha256=B19PGBCYhWaz2p_UjAoRVh767nYQfk14Sn4TpIZ-nfU,87
13
- rolling_pin-0.10.0.dist-info/METADATA,sha256=Oh1-rm5lU1LsZg4ufs40VoEQd9FR7M2MBJ5GINJfpJw,20063
14
- rolling_pin-0.10.0.dist-info/licenses/LICENSE,sha256=Z61vsRc9ZyRu0Tm3TkYgIeKDjUJCR3dT0hJonw9Q3i4,1067
15
- rolling_pin-0.10.0.dist-info/RECORD,,
11
+ rolling_pin-0.10.1.dist-info/entry_points.txt,sha256=nbMiJnGLhp49xrtx1pjK8sJiBrwkpj2kq-ezp8Zfyyk,56
12
+ rolling_pin-0.10.1.dist-info/WHEEL,sha256=B19PGBCYhWaz2p_UjAoRVh767nYQfk14Sn4TpIZ-nfU,87
13
+ rolling_pin-0.10.1.dist-info/METADATA,sha256=B7s0WHFa3vdPUKujCpbyGuA45FAmlphifDzmRDonhSM,20054
14
+ rolling_pin-0.10.1.dist-info/licenses/LICENSE,sha256=Z61vsRc9ZyRu0Tm3TkYgIeKDjUJCR3dT0hJonw9Q3i4,1067
15
+ rolling_pin-0.10.1.dist-info/RECORD,,