rolling-pin 0.11.1__tar.gz → 0.11.2__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.
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 Alex Braun
3
+ Copyright (c) 2019 Alex Braun
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rolling-pin
3
- Version: 0.11.1
3
+ Version: 0.11.2
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
@@ -15,7 +15,7 @@ Classifier: Programming Language :: Python :: 3.11
15
15
  Classifier: Programming Language :: Python :: 3.12
16
16
  Classifier: Programming Language :: Python :: 3.13
17
17
  Classifier: Typing :: Typed
18
- Project-URL: documentation, https://thenewflesh.github.io/rolling-pin
18
+ Project-URL: documentation, https://theNewFlesh.github.io/rolling-pin
19
19
  Project-URL: repository, https://github.com/theNewFlesh/rolling-pin
20
20
  Description-Content-Type: text/markdown
21
21
 
@@ -47,8 +47,6 @@ Description-Content-Type: text/markdown
47
47
  </a>
48
48
  </p>
49
49
 
50
- <!-- <img id="logo" src="resources/logo.png" style="max-width: 717px"> -->
51
-
52
50
  [![](https://img.shields.io/badge/License-MIT-F77E70.svg?style=for-the-badge)](https://github.com/theNewFlesh/rolling-pin/blob/master/LICENSE)
53
51
  [![](https://img.shields.io/pypi/pyversions/rolling-pin?style=for-the-badge&label=Python&color=A0D17B&logo=python&logoColor=A0D17B)](https://github.com/theNewFlesh/rolling-pin/blob/master/docker/config/pyproject.toml)
54
52
  [![](https://img.shields.io/pypi/v/rolling-pin?style=for-the-badge&label=PyPI&color=5F95DE&logo=pypi&logoColor=5F95DE)](https://pypi.org/project/rolling-pin/)
@@ -62,6 +60,15 @@ blobs and python repositories
62
60
 
63
61
  See [documentation](https://thenewflesh.github.io/rolling-pin/) for details.
64
62
 
63
+ See [blob notebook](https://github.com/theNewFlesh/rolling-pin/blob/master/notebooks/demo-blob.ipynb)
64
+ for a demo of the BlobETL class.
65
+
66
+ See [conform notebook](https://github.com/theNewFlesh/rolling-pin/blob/master/notebooks/demo-conform.ipynb)
67
+ for a demo of the ConformETL class.
68
+
69
+ See [cli notebook](https://github.com/theNewFlesh/rolling-pin/blob/master/notebooks/demo-cli.ipynb)
70
+ for a demo of the rolling-pin CLI.
71
+
65
72
  On the documentation main page, under the *Architecture* section, is a
66
73
  dynamically generated dependency graph of rolling-pin's current architecture.
67
74
  It is generated using the RepoETL class.
@@ -69,10 +76,6 @@ It is generated using the RepoETL class.
69
76
  If you look under the *Metrics* section you will find Radon code metric plots
70
77
  and data of the rolling-pin source code, generated by the RadonETL class.
71
78
 
72
- Also have a look at this
73
- **[Jupyter notebook demo](https://github.com/theNewFlesh/rolling-pin/blob/master/notebooks/prototype_demo.ipynb)**
74
- for a taste of what rolling-pin can do.
75
-
76
79
  ---
77
80
 
78
81
  # Installation for Developers
@@ -112,6 +115,9 @@ Run `bin/rolling-pin --help` for more help on the command line tool.
112
115
  ### Python
113
116
  `pip install rolling-pin`
114
117
 
118
+ Please see the prod.dockerfile for an official example of how to build a docker
119
+ image with rolling-pin.
120
+
115
121
  ### Docker
116
122
  1. Install [docker-desktop](https://docs.docker.com/desktop/)
117
123
  2. `docker pull theNewFlesh/rolling-pin:[mode]-[version]`
@@ -239,6 +245,7 @@ The following is a complete list of all available development commands:
239
245
  | test-coverage | Generate test coverage report |
240
246
  | test-dev | Run all tests |
241
247
  | test-fast | Test all code excepts tests marked with SKIP_SLOWS_TESTS decorator |
248
+ | test-format | Format all python files |
242
249
  | test-lint | Run linting and type checking |
243
250
  | test-prod | Run tests across all support python versions |
244
251
  | version | Full resolution of repo: dependencies, linting, tests, docs, etc |
@@ -26,8 +26,6 @@
26
26
  </a>
27
27
  </p>
28
28
 
29
- <!-- <img id="logo" src="resources/logo.png" style="max-width: 717px"> -->
30
-
31
29
  [![](https://img.shields.io/badge/License-MIT-F77E70.svg?style=for-the-badge)](https://github.com/theNewFlesh/rolling-pin/blob/master/LICENSE)
32
30
  [![](https://img.shields.io/pypi/pyversions/rolling-pin?style=for-the-badge&label=Python&color=A0D17B&logo=python&logoColor=A0D17B)](https://github.com/theNewFlesh/rolling-pin/blob/master/docker/config/pyproject.toml)
33
31
  [![](https://img.shields.io/pypi/v/rolling-pin?style=for-the-badge&label=PyPI&color=5F95DE&logo=pypi&logoColor=5F95DE)](https://pypi.org/project/rolling-pin/)
@@ -41,6 +39,15 @@ blobs and python repositories
41
39
 
42
40
  See [documentation](https://thenewflesh.github.io/rolling-pin/) for details.
43
41
 
42
+ See [blob notebook](https://github.com/theNewFlesh/rolling-pin/blob/master/notebooks/demo-blob.ipynb)
43
+ for a demo of the BlobETL class.
44
+
45
+ See [conform notebook](https://github.com/theNewFlesh/rolling-pin/blob/master/notebooks/demo-conform.ipynb)
46
+ for a demo of the ConformETL class.
47
+
48
+ See [cli notebook](https://github.com/theNewFlesh/rolling-pin/blob/master/notebooks/demo-cli.ipynb)
49
+ for a demo of the rolling-pin CLI.
50
+
44
51
  On the documentation main page, under the *Architecture* section, is a
45
52
  dynamically generated dependency graph of rolling-pin's current architecture.
46
53
  It is generated using the RepoETL class.
@@ -48,10 +55,6 @@ It is generated using the RepoETL class.
48
55
  If you look under the *Metrics* section you will find Radon code metric plots
49
56
  and data of the rolling-pin source code, generated by the RadonETL class.
50
57
 
51
- Also have a look at this
52
- **[Jupyter notebook demo](https://github.com/theNewFlesh/rolling-pin/blob/master/notebooks/prototype_demo.ipynb)**
53
- for a taste of what rolling-pin can do.
54
-
55
58
  ---
56
59
 
57
60
  # Installation for Developers
@@ -91,6 +94,9 @@ Run `bin/rolling-pin --help` for more help on the command line tool.
91
94
  ### Python
92
95
  `pip install rolling-pin`
93
96
 
97
+ Please see the prod.dockerfile for an official example of how to build a docker
98
+ image with rolling-pin.
99
+
94
100
  ### Docker
95
101
  1. Install [docker-desktop](https://docs.docker.com/desktop/)
96
102
  2. `docker pull theNewFlesh/rolling-pin:[mode]-[version]`
@@ -218,6 +224,7 @@ The following is a complete list of all available development commands:
218
224
  | test-coverage | Generate test coverage report |
219
225
  | test-dev | Run all tests |
220
226
  | test-fast | Test all code excepts tests marked with SKIP_SLOWS_TESTS decorator |
227
+ | test-format | Format all python files |
221
228
  | test-lint | Run linting and type checking |
222
229
  | test-prod | Run tests across all support python versions |
223
230
  | version | Full resolution of repo: dependencies, linting, tests, docs, etc |
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "rolling-pin"
3
- version = "0.11.1"
3
+ version = "0.11.2"
4
4
  description = "A library of generic tools for ETL work and visualization of JSON blobs and python repositories"
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -32,7 +32,7 @@ dependencies = [
32
32
  "click>=8.1.3",
33
33
  "graphviz",
34
34
  "ipython",
35
- "lunchbox",
35
+ "lunchbox>=0.6.1",
36
36
  "networkx",
37
37
  "numpy>=1.23.4",
38
38
  "pandas>=1.1.5",
@@ -50,7 +50,7 @@ authors = [
50
50
 
51
51
  [project.urls]
52
52
  repository = "https://github.com/theNewFlesh/rolling-pin"
53
- documentation = "https://thenewflesh.github.io/rolling-pin"
53
+ documentation = "https://theNewFlesh.github.io/rolling-pin"
54
54
 
55
55
  [project.scripts]
56
56
  rolling-pin = "rolling_pin.command:main"
@@ -61,6 +61,33 @@ requires = [
61
61
  ]
62
62
  build-backend = "pdm.pep517.api"
63
63
 
64
+ [tool.ruff]
65
+ cache-dir = "/home/ubuntu/.cache/ruff"
66
+ line-length = 100
67
+ indent-width = 4
68
+ exclude = [
69
+ "*_test.py",
70
+ ]
71
+
72
+ [tool.ruff.format]
73
+ quote-style = "preserve"
74
+ indent-style = "space"
75
+ docstring-code-format = true
76
+ skip-magic-trailing-comma = true
77
+
78
+ [tool.ruff.lint]
79
+ select = [
80
+ "E",
81
+ "F",
82
+ ]
83
+ ignore = [
84
+ "E731",
85
+ ]
86
+
87
+ [tool.ruff.lint.flake8-quotes]
88
+ docstring-quotes = "single"
89
+ inline-quotes = "single"
90
+
64
91
  [tool.uv]
65
92
  cache-dir = "/home/ubuntu/pdm/cache"
66
93
 
@@ -23,7 +23,7 @@ converted to directed graphs.
23
23
  '''
24
24
 
25
25
 
26
- class BlobETL():
26
+ class BlobETL:
27
27
  '''
28
28
  Converts blob data internally into a flat dictionary that is universally
29
29
  searchable, editable and convertable back to the data's original structure,
@@ -1,6 +1,7 @@
1
1
  import subprocess
2
2
 
3
3
  import click
4
+ import lunchbox.theme as lbc
4
5
 
5
6
  from rolling_pin.conform_etl import ConformETL
6
7
  from rolling_pin.radon_etl import RadonETL
@@ -12,6 +13,8 @@ from rolling_pin.toml_etl import TomlETL
12
13
  Command line interface to rolling-pin library
13
14
  '''
14
15
 
16
+ click.Context.formatter_class = lbc.ThemeFormatter
17
+
15
18
 
16
19
  @click.group()
17
20
  def main():
@@ -35,11 +38,12 @@ def main():
35
38
  def conform(source, groups, dryrun):
36
39
  # type: (str, str, bool) -> None
37
40
  '''
38
- Copies source files to target filepaths according to given conform file.
41
+ {white}Copies source files to target filepaths according to given conform
42
+ file.{clear}
39
43
 
40
44
  \b
41
- Arguments:
42
- SOURCE - conform YAML filepath
45
+ {cyan2}ARGUMENTS{clear}
46
+ {cyan2}source{clear} conform YAML filepath
43
47
  '''
44
48
  etl = ConformETL.from_yaml(source)
45
49
  if dryrun:
@@ -72,13 +76,13 @@ def conform(source, groups, dryrun):
72
76
  def graph(source, target, include, exclude, orient):
73
77
  # type: (str, str, str, str, str) -> None
74
78
  '''
75
- Generate a dependency graph of a source repository and write it to a given
76
- filepath
79
+ {white}Generate a dependency graph of a source repository and write it to a
80
+ given filepath{clear}
77
81
 
78
82
  \b
79
- Arguments:
80
- SOURCE - repository path
81
- TARGET - target filepath
83
+ {cyan2}ARGUMENTS{clear}
84
+ {cyan2}source{clear} repository path
85
+ {cyan2}target{clear} target filepath
82
86
  '''
83
87
  include_ = '' if include is None else include
84
88
  exclude_ = '' if exclude is None else exclude
@@ -91,12 +95,13 @@ def graph(source, target, include, exclude, orient):
91
95
  def plot(source, target):
92
96
  # type: (str, str) -> None
93
97
  '''
94
- Write radon metrics plots of given repository to given filepath
98
+ {white}Write radon metrics plots of given repository to given filepath.
99
+ {clear}
95
100
 
96
101
  \b
97
- Arguments:
98
- SOURCE - repository path
99
- TARGET - plot filepath
102
+ {cyan2}ARGUMENTS{clear}
103
+ {cyan2}source{clear} repository path
104
+ {cyan2}target{clear} plot filepath
100
105
  '''
101
106
  RadonETL(source).write_plots(target)
102
107
 
@@ -107,12 +112,13 @@ def plot(source, target):
107
112
  def table(source, target):
108
113
  # type: (str, str) -> None
109
114
  '''
110
- Write radon metrics tables of given repository to given directory
115
+ {white}Write radon metrics tables of given repository to given directory
116
+ {clear}
111
117
 
112
118
  \b
113
- Arguments:
114
- SOURCE - repository path
115
- TARGET - table directory
119
+ {cyan2}ARGUMENTS{clear}
120
+ {cyan2}source{clear} repository path
121
+ {cyan2}target{clear} table directory
116
122
  '''
117
123
  RadonETL(source).write_tables(target)
118
124
 
@@ -149,19 +155,15 @@ value pair in TOML format''',
149
155
  def toml(source, edit, delete, search, target):
150
156
  # type: (str, tuple[str], tuple[str], str, str) -> None
151
157
  '''
152
- Generate a copy of a given TOML file with given edits indicated by flags.
153
- Flags are evalauted in the following order: edit, delete, search.
154
- Flags may be arbitrarily combined.
155
- Edit and delete flags may appear multiple times.
156
-
157
- \b
158
- Arguments:
159
- SOURCE - TOML filepath
158
+ {white}Generate a copy of a given TOML file with given edits indicated by
159
+ flags. Flags are evalauted in the following order: edit, delete, search.
160
+ Flags may be arbitrarily combined. Edit and delete flags may appear multiple
161
+ times.{clear}
160
162
 
161
163
  \b
162
- EXAMPLES
163
- EXAMPLE-FILE------------------------------------------------------------
164
- >>>cat example.toml
164
+ {yellow2}EXAMPLES
165
+ EXAMPLE-FILE------------------------------------------------------------{clear}
166
+ {blue2}>>>{clear}cat example.toml{purple2}
165
167
  [root]
166
168
  a = 1
167
169
  b = 2
@@ -173,16 +175,16 @@ def toml(source, edit, delete, search, target):
173
175
  hello = true
174
176
 
175
177
  \b
176
- EDIT-FLAG---------------------------------------------------------------
177
- >>>rolling-pin toml foobar.toml --edit 'root.a=999'
178
+ {yellow2}EDIT-FLAG-------------------------------------------------------------------{clear}
179
+ {blue2}>>>{clear}rolling-pin toml foobar.toml --edit 'root.a=999'{purple2}
178
180
  [root]
179
181
  a = 999
180
182
  b = 2...
181
183
  \b
182
- --------------------------------------------------------------------
183
- >>>rolling-pin toml foobar.toml \\
184
+ {yellow2}--------------------------------------------------------------------{clear}
185
+ {blue2}>>>{clear}rolling-pin toml foobar.toml \\
184
186
  --edit 'root.a=[1, 2]' \\
185
- --edit 'root.b="xxx"'
187
+ --edit 'root.b="xxx"'{purple2}
186
188
  [root]
187
189
  a = [
188
190
  1,
@@ -190,8 +192,8 @@ def toml(source, edit, delete, search, target):
190
192
  ]
191
193
  b = "xxx"...
192
194
  \b
193
- --------------------------------------------------------------------
194
- >>>rolling-pin toml foobar.toml --edit 'root.foo.bar="baz"'
195
+ {yellow2}--------------------------------------------------------------------{clear}
196
+ {blue2}>>>{clear}rolling-pin toml foobar.toml --edit 'root.foo.bar="baz"'{purple2}
195
197
  ...
196
198
  hello = true
197
199
  \b
@@ -199,10 +201,10 @@ def toml(source, edit, delete, search, target):
199
201
  bar = "baz"...
200
202
 
201
203
  \b
202
- DELETE-FLAG-------------------------------------------------------------
203
- >>>rolling-pin toml foobar.toml \\
204
+ {yellow2}DELETE-FLAG-------------------------------------------------------------{clear}
205
+ {blue2}>>>{clear}rolling-pin toml foobar.toml \\
204
206
  --delete 'root.foo.bar' \\
205
- --delete 'root.a'
207
+ --delete 'root.a'{purple2}
206
208
  [root]
207
209
  b = 2
208
210
  \b
@@ -210,13 +212,17 @@ def toml(source, edit, delete, search, target):
210
212
  hello = true
211
213
 
212
214
  \b
213
- SEARCH-FLAG-------------------------------------------------------------
214
- >>>rolling-pin toml foobar.toml --search 'root.foo|world'
215
+ {yellow2}SEARCH-FLAG-------------------------------------------------------------{clear}
216
+ {blue2}>>>{clear}rolling-pin toml foobar.toml --search 'root.foo|world'{purple2}
215
217
  [world]
216
218
  hello = true
217
219
  \b
218
220
  [root.foo.bar]
219
221
  x = "y"
222
+
223
+ \b
224
+ {cyan2}ARGUMENTS{clear}
225
+ {cyan2}source{clear} TOML filepath
220
226
  '''
221
227
  etl = TomlETL.from_toml(source)
222
228
  for e in edit:
@@ -234,7 +240,8 @@ def toml(source, edit, delete, search, target):
234
240
  @main.command()
235
241
  def bash_completion():
236
242
  '''
237
- BASH completion code to be written to a _rolling-pin completion file.
243
+ {white}BASH completion code to be written to a _rolling-pin completion file.
244
+ {clear}
238
245
  '''
239
246
  cmd = '_ROLLING_PIN_COMPLETE=bash_source rolling-pin'
240
247
  result = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
@@ -245,7 +252,8 @@ def bash_completion():
245
252
  @main.command()
246
253
  def zsh_completion():
247
254
  '''
248
- ZSH completion code to be written to a _rolling-pin completion file.
255
+ {white}ZSH completion code to be written to a _rolling-pin completion file.
256
+ {clear}
249
257
  '''
250
258
  cmd = '_ROLLING_PIN_COMPLETE=zsh_source rolling-pin'
251
259
  result = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
@@ -23,7 +23,7 @@ code wthin a given directory.
23
23
  '''
24
24
 
25
25
 
26
- class RadonETL():
26
+ class RadonETL:
27
27
  '''
28
28
  Conforms all four radon reports (raw metrics, Halstead, maintainability and
29
29
  cyclomatic complexity) into a single DataFrame that can then be plotted.
@@ -21,7 +21,7 @@ dependencies into a directed graph.
21
21
  '''
22
22
 
23
23
 
24
- class RepoETL():
24
+ class RepoETL:
25
25
  '''
26
26
  RepoETL is a class for extracting 1st order dependencies of modules within a
27
27
  given repository. This information is stored internally as a DataFrame and