rolling-pin 0.9.5__py3-none-any.whl → 0.10.0__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/radon_etl.py CHANGED
@@ -5,13 +5,13 @@ import os
5
5
  import re
6
6
  from pathlib import Path
7
7
 
8
- import cufflinks as cf
8
+ from pandas import DataFrame
9
+ from radon.cli import CCHarvester, HCHarvester, MIHarvester, RawHarvester
10
+ from radon.cli import Config
9
11
  import numpy as np
10
12
  import pandas as pd
11
- from pandas import DataFrame
13
+ import plotly.express as px
12
14
  import radon.complexity
13
- from radon.cli import Config
14
- from radon.cli import CCHarvester, HCHarvester, MIHarvester, RawHarvester
15
15
 
16
16
  from rolling_pin.blob_etl import BlobETL
17
17
  import rolling_pin.tools as rpt
@@ -413,8 +413,6 @@ class RadonETL():
413
413
  Returns:
414
414
  RadonETL: self.
415
415
  '''
416
- cf.go_offline()
417
-
418
416
  def remove_test_modules(data):
419
417
  # type: (DataFrame) -> DataFrame
420
418
  mask = data.fullpath\
@@ -436,13 +434,6 @@ class RadonETL():
436
434
  bugs='bugs (B) - V / 3000 - an estimate of the errors in the implementation',
437
435
  )
438
436
 
439
- params = dict(
440
- theme='henanigans',
441
- colors=rpt.COLOR_SCALE,
442
- dimensions=(900, 900),
443
- asFigure=True,
444
- )
445
-
446
437
  html = '<body style="background: #242424">\n'
447
438
 
448
439
  raw = remove_test_modules(self.raw_metrics)
@@ -452,42 +443,64 @@ class RadonETL():
452
443
 
453
444
  raw['docstring_ratio'] = raw.multiline_comment / raw.code
454
445
  raw.sort_values('docstring_ratio', inplace=True)
455
- html += raw.iplot(
456
- x='fullpath',
457
- kind='barh',
446
+
447
+ # line count
448
+ fig = px.bar(
449
+ raw,
458
450
  title='Line Count Metrics',
459
- **params
460
- ).to_html()
451
+ x=raw.drop(columns='fullpath').columns.tolist(),
452
+ y='fullpath',
453
+ orientation='h',
454
+ barmode='group',
455
+ width=900,
456
+ height=900,
457
+ color_discrete_sequence=rpt.COLOR_SCALE,
458
+ )
459
+ fig.layout.update(rpt.PLOTLY_LAYOUT_THEME)
460
+ html += fig.to_html()
461
461
 
462
- html += mi.iplot(
463
- x='fullpath',
464
- kind='barh',
462
+ # maintainability
463
+ fig = px.bar(
464
+ mi,
465
465
  title='Maintainability Metrics',
466
- **params
467
- ).to_html()
468
-
469
- params['dimensions'] = (900, 500)
466
+ x='maintainability_index',
467
+ y='fullpath',
468
+ orientation='h',
469
+ barmode='group',
470
+ width=900,
471
+ height=900,
472
+ color_discrete_sequence=rpt.COLOR_SCALE,
473
+ )
474
+ fig.layout.update(rpt.PLOTLY_LAYOUT_THEME)
475
+ html += fig.to_html()
470
476
 
471
- cols = ['cyclomatic_complexity', 'cyclomatic_rank']
472
- html += cc[cols].iplot(
473
- kind='hist',
474
- bins=50,
477
+ # cyclomatic
478
+ fig = px.histogram(
479
+ cc[['cyclomatic_complexity', 'cyclomatic_rank']],
475
480
  title='Cyclomatic Metric Distributions',
476
- **params
477
- ).to_html()
481
+ nbins=10,
482
+ width=900,
483
+ height=500,
484
+ color_discrete_sequence=rpt.COLOR_SCALE,
485
+ )
486
+ fig.layout.update(rpt.PLOTLY_LAYOUT_THEME)
487
+ html += fig.to_html()
478
488
 
489
+ # halstead
479
490
  cols = [
480
491
  'h1', 'h2', 'n1', 'n2', 'vocabulary', 'length', 'calculated_length',
481
492
  'volume', 'difficulty', 'effort', 'time', 'bugs'
482
493
  ]
483
- html += hal[cols]\
484
- .rename(mapper=lambda x: lut[x], axis=1)\
485
- .iplot(
486
- kind='hist',
487
- bins=50,
488
- title='Halstead Metric Distributions',
489
- **params)\
490
- .to_html()
494
+ fig = px.histogram(
495
+ hal[cols].rename(mapper=lambda x: lut[x], axis=1),
496
+ title='Halstead Metric Distributions',
497
+ nbins=10,
498
+ width=1400,
499
+ height=500,
500
+ color_discrete_sequence=rpt.COLOR_SCALE,
501
+ )
502
+ fig.layout.update(rpt.PLOTLY_LAYOUT_THEME)
503
+ html += fig.to_html()
491
504
 
492
505
  html += '\n</body>'
493
506
 
rolling_pin/repo_etl.py CHANGED
@@ -275,6 +275,8 @@ class RepoETL():
275
275
  '''
276
276
  x = anneal_axis
277
277
  y = pin_axis
278
+ data[x] = data[x].astype(float)
279
+ data[y] = data[y].astype(float)
278
280
  for iteration in range(iterations):
279
281
  # create directed graph from data
280
282
  graph = RepoETL._to_networkx_graph(data)
rolling_pin/tools.py CHANGED
@@ -38,18 +38,83 @@ COLOR_SCHEME = dict(
38
38
  edge_module='#B6ECF3',
39
39
  ) # type: Dict[str, str]
40
40
 
41
+
42
+ PLOTLY_COLOR_SCHEME = dict(
43
+ bg='#242424',
44
+ blue1='#5F95DE',
45
+ blue2='#93B6E6',
46
+ cyan1='#7EC4CF',
47
+ cyan2='#B6ECF3',
48
+ dark1='#040404',
49
+ dark2='#141414',
50
+ dialog1='#444459',
51
+ dialog2='#5D5D7A',
52
+ green1='#8BD155',
53
+ green2='#A0D17B',
54
+ grey1='#343434',
55
+ grey2='#444444',
56
+ light1='#A4A4A4',
57
+ light2='#F4F4F4',
58
+ orange1='#EB9E58',
59
+ orange2='#EBB483',
60
+ purple1='#C98FDE',
61
+ purple2='#AC92DE',
62
+ red1='#F77E70',
63
+ red2='#DE958E',
64
+ yellow1='#E8EA7E',
65
+ yellow2='#E9EABE',
66
+ )
67
+
68
+
41
69
  COLOR_SCALE = [
42
- '#B6ECF3',
43
- '#DE958E',
44
- '#EBB483',
45
- '#A0D17B',
46
- '#93B6E6',
47
- '#AC92DE',
48
- '#E9EABE',
49
- '#7EC4CF',
50
- '#F77E70',
51
- '#EB9E58',
70
+ 'cyan2', 'red2', 'green2', 'blue2', 'orange2', 'purple2', 'yellow2',
71
+ 'light2', 'cyan1', 'red1', 'green1', 'blue1'
52
72
  ] # type: List[str]
73
+ COLOR_SCALE = [PLOTLY_COLOR_SCHEME[x] for x in COLOR_SCALE]
74
+
75
+
76
+ PLOTLY_LAYOUT_THEME = {
77
+ 'legend': {
78
+ 'bgcolor': PLOTLY_COLOR_SCHEME['bg'],
79
+ 'title': {'text': ''},
80
+ 'font': {
81
+ 'color': PLOTLY_COLOR_SCHEME['light2']
82
+ }
83
+ },
84
+ 'paper_bgcolor': PLOTLY_COLOR_SCHEME['bg'],
85
+ 'plot_bgcolor': PLOTLY_COLOR_SCHEME['bg'],
86
+ 'title': {
87
+ 'font': {
88
+ 'color': PLOTLY_COLOR_SCHEME['light2']
89
+ }
90
+ },
91
+ 'xaxis': {
92
+ 'gridcolor': PLOTLY_COLOR_SCHEME['grey1'],
93
+ 'showgrid': True,
94
+ 'tickfont': {
95
+ 'color': PLOTLY_COLOR_SCHEME['light1']
96
+ },
97
+ 'title': {
98
+ 'font': {
99
+ 'color': PLOTLY_COLOR_SCHEME['light1']
100
+ }
101
+ },
102
+ 'zerolinecolor': PLOTLY_COLOR_SCHEME['grey2']
103
+ },
104
+ 'yaxis': {
105
+ 'gridcolor': PLOTLY_COLOR_SCHEME['grey1'],
106
+ 'showgrid': True,
107
+ 'tickfont': {
108
+ 'color': PLOTLY_COLOR_SCHEME['light1']
109
+ },
110
+ 'title': {
111
+ 'font': {
112
+ 'color': PLOTLY_COLOR_SCHEME['light1']
113
+ }
114
+ },
115
+ 'zerolinecolor': PLOTLY_COLOR_SCHEME['grey2']
116
+ }
117
+ }
53
118
 
54
119
 
55
120
  # PREDICATE-FUNCTIONS-----------------------------------------------------------
@@ -340,9 +405,9 @@ def filter_text(
340
405
  '''
341
406
  lines = text.split('\n')
342
407
  if include_regex is not None:
343
- lines = list(filter(lambda x: re.search(include_regex, x), lines)) # type: ignore
408
+ lines = list(filter(lambda x: re.search(include_regex, x), lines))
344
409
  if exclude_regex is not None:
345
- lines = list(filter(lambda x: not re.search(exclude_regex, x), lines)) # type: ignore
410
+ lines = list(filter(lambda x: not re.search(exclude_regex, x), lines))
346
411
  if replace_regex is not None:
347
412
  rep_val = replace_value or ''
348
413
  lines = [re.sub(replace_regex, rep_val, x) for x in lines]
@@ -0,0 +1,443 @@
1
+ Metadata-Version: 2.1
2
+ Name: rolling-pin
3
+ Version: 0.10.0
4
+ Summary: A library of generic tools for ETL work and visualization of JSON blobs and python repositories
5
+ License: MIT
6
+ Keywords: ETL,blob,dependency,graph,svg,networkx,transform,code metrics,dependency diagram,build system
7
+ Author-email: Alex Braun <alexander.g.braun@gmail.com>
8
+ Requires-Python: >=3.8
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Typing :: Typed
17
+ Requires-Dist: click>=8.1.3
18
+ Requires-Dist: graphviz
19
+ Requires-Dist: ipython
20
+ Requires-Dist: lunchbox
21
+ Requires-Dist: networkx
22
+ Requires-Dist: numpy<=1.24.4,>=1.23.4
23
+ Requires-Dist: pandas>=1.1.5
24
+ Requires-Dist: plotly>=5.22.0
25
+ Requires-Dist: pydot<=1.4.2
26
+ Requires-Dist: pyyaml
27
+ Requires-Dist: radon<6.0.0
28
+ Requires-Dist: schematics
29
+ Requires-Dist: toml>=0.10.2
30
+ Requires-Dist: wrapt
31
+ Project-URL: documentation, https://thenewflesh.github.io/rolling-pin
32
+ Project-URL: repository, https://github.com/theNewFlesh/rolling-pin
33
+ Description-Content-Type: text/markdown
34
+
35
+ <p>
36
+ <a href="https://www.linkedin.com/in/alexandergbraun" rel="nofollow noreferrer">
37
+ <img src="https://www.gomezaparicio.com/wp-content/uploads/2012/03/linkedin-logo-1-150x150.png"
38
+ alt="linkedin" width="30px" height="30px"
39
+ >
40
+ </a>
41
+ <a href="https://github.com/theNewFlesh" rel="nofollow noreferrer">
42
+ <img src="https://tadeuzagallo.com/GithubPulse/assets/img/app-icon-github.png"
43
+ alt="github" width="30px" height="30px"
44
+ >
45
+ </a>
46
+ <a href="https://pypi.org/user/the-new-flesh" rel="nofollow noreferrer">
47
+ <img src="https://cdn.iconscout.com/icon/free/png-256/python-2-226051.png"
48
+ alt="pypi" width="30px" height="30px"
49
+ >
50
+ </a>
51
+ <a href="http://vimeo.com/user3965452" rel="nofollow noreferrer">
52
+ <img src="https://cdn.iconscout.com/icon/free/png-512/movie-52-151107.png?f=avif&w=512"
53
+ alt="vimeo" width="30px" height="30px"
54
+ >
55
+ </a>
56
+ <a href="http://www.alexgbraun.com" rel="nofollow noreferrer">
57
+ <img src="https://i.ibb.co/fvyMkpM/logo.png"
58
+ alt="alexgbraun" width="30px" height="30px"
59
+ >
60
+ </a>
61
+ </p>
62
+
63
+ <!-- <img id="logo" src="resources/logo.png" style="max-width: 717px"> -->
64
+
65
+ [![](https://img.shields.io/badge/License-MIT-F77E70.svg?style=for-the-badge)](https://github.com/theNewFlesh/rolling-pin/blob/master/LICENSE)
66
+ [![](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)
67
+ [![](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/)
68
+ [![](https://img.shields.io/pypi/dm/rolling-pin?style=for-the-badge&label=Downloads&color=5F95DE)](https://pepy.tech/project/rolling-pin)
69
+
70
+ # Introduction
71
+ Rolling-pin is a library of generic tools for ETL work and visualization of JSON
72
+ blobs and python repositories
73
+
74
+ See [documentation](https://thenewflesh.github.io/rolling-pin/) for details.
75
+
76
+ On the documentation main page, under the *Architecture* section, is a
77
+ dynamically generated dependency graph of rolling-pin's current architecture.
78
+ It is generated using the RepoETL class.
79
+
80
+ If you look under the *Metrics* section you will find Radon code metric plots
81
+ and data of the rolling-pin source code, generated by the RadonETL class.
82
+
83
+ Also have a look at this
84
+ **[Jupyter notebook demo](https://github.com/theNewFlesh/rolling-pin/blob/master/notebooks/prototype_demo.ipynb)**
85
+ for a taste of what rolling-pin can do.
86
+
87
+ ---
88
+
89
+ # Installation for Developers
90
+
91
+ ### Docker
92
+ 1. Install [docker-desktop](https://docs.docker.com/desktop/)
93
+ 2. Ensure docker-desktop has at least 4 GB of memory allocated to it.
94
+ 3. `git clone git@github.com:theNewFlesh/rolling-pin.git`
95
+ 4. `cd rolling-pin`
96
+ 5. `chmod +x bin/rolling-pin`
97
+ 6. `bin/rolling-pin docker-start`
98
+ - If building on a M1 Mac run `export DOCKER_DEFAULT_PLATFORM=linux/amd64` first.
99
+
100
+ The service should take a few minutes to start up.
101
+
102
+ Run `bin/rolling-pin --help` for more help on the command line tool.
103
+
104
+ ### ZSH Setup
105
+ 1. `bin/rolling-pin` must be run from this repository's top level directory.
106
+ 2. Therefore, if using zsh, it is recommended that you paste the following line
107
+ in your ~/.zshrc file:
108
+ - `alias rolling-pin="cd [parent dir]/rolling-pin; bin/rolling-pin"`
109
+ - Replace `[parent dir]` with the parent directory of this repository
110
+ 3. Consider adding the following line to your ~/.zshrc if you are using a M1 Mac:
111
+ - `export DOCKER_DEFAULT_PLATFORM=linux/amd64`
112
+ 4. Running the `zsh-complete` command will enable tab completions of the cli
113
+ commands, in the next shell session.
114
+
115
+ For example:
116
+ - `rolling-pin [tab]` will show you all the cli options, which you can press
117
+ tab to cycle through
118
+ - `rolling-pin docker-[tab]` will show you only the cli options that begin with
119
+ "docker-"
120
+
121
+ # Installation for Production
122
+
123
+ ### Python
124
+ `pip install rolling-pin`
125
+
126
+ ### Docker
127
+ 1. Install [docker-desktop](https://docs.docker.com/desktop/)
128
+ 2. `docker pull theNewFlesh/rolling-pin:[version]`
129
+
130
+
131
+ ---
132
+
133
+ # Quickstart Guide
134
+ This repository contains a suite commands for the whole development process.
135
+ This includes everything from testing, to documentation generation and
136
+ publishing pip packages.
137
+
138
+ These commands can be accessed through:
139
+
140
+ - The VSCode task runner
141
+ - The VSCode task runner side bar
142
+ - A terminal running on the host OS
143
+ - A terminal within this repositories docker container
144
+
145
+ Running the `zsh-complete` command will enable tab completions of the CLI.
146
+ See the zsh setup section for more information.
147
+
148
+ ### Command Groups
149
+
150
+ Development commands are grouped by one of 10 prefixes:
151
+
152
+ | Command | Description |
153
+ | ---------- | ---------------------------------------------------------------------------------- |
154
+ | build | Commands for building packages for testing and pip publishing |
155
+ | docker | Common docker commands such as build, start and stop |
156
+ | docs | Commands for generating documentation and code metrics |
157
+ | library | Commands for managing python package dependencies |
158
+ | session | Commands for starting interactive sessions such as jupyter lab and python |
159
+ | state | Command to display the current state of the repo and container |
160
+ | test | Commands for running tests, linter and type annotations |
161
+ | version | Commands for bumping project versions |
162
+ | quickstart | Display this quickstart guide |
163
+ | zsh | Commands for running a zsh session in the container and generating zsh completions |
164
+
165
+ ### Common Commands
166
+
167
+ Here are some frequently used commands to get you started:
168
+
169
+ | Command | Description |
170
+ | ----------------- | --------------------------------------------------------- |
171
+ | docker-restart | Restart container |
172
+ | docker-start | Start container |
173
+ | docker-stop | Stop container |
174
+ | docs-full | Generate documentation, coverage report, diagram and code |
175
+ | library-add | Add a given package to a given dependency group |
176
+ | library-graph-dev | Graph dependencies in dev environment |
177
+ | library-remove | Remove a given package from a given dependency group |
178
+ | library-search | Search for pip packages |
179
+ | library-update | Update dev dependencies |
180
+ | session-lab | Run jupyter lab server |
181
+ | state | State of |
182
+ | test-dev | Run all tests |
183
+ | test-lint | Run linting and type checking |
184
+ | zsh | Run ZSH session inside container |
185
+ | zsh-complete | Generate ZSH completion script |
186
+
187
+ ---
188
+
189
+ # Development CLI
190
+ bin/rolling-pin is a command line interface (defined in cli.py) that
191
+ works with any version of python 2.7 and above, as it has no dependencies.
192
+ Commands generally do not expect any arguments or flags.
193
+
194
+ Its usage pattern is: `bin/rolling-pin COMMAND [-a --args]=ARGS [-h --help] [--dryrun]`
195
+
196
+ ### Commands
197
+ The following is a complete list of all available development commands:
198
+
199
+ | Command | Description |
200
+ | ----------------------- | ------------------------------------------------------------------- |
201
+ | build-package | Build production version of repo for publishing |
202
+ | build-prod | Publish pip package of repo to PyPi |
203
+ | build-publish | Run production tests first then publish pip package of repo to PyPi |
204
+ | build-test | Build test version of repo for prod testing |
205
+ | docker-build | Build Docker image |
206
+ | docker-build-from-cache | Build Docker image from cached image |
207
+ | docker-build-prod | Build production image |
208
+ | docker-container | Display the Docker container id |
209
+ | docker-destroy | Shutdown container and destroy its image |
210
+ | docker-destroy-prod | Shutdown production container and destroy its image |
211
+ | docker-image | Display the Docker image id |
212
+ | docker-prod | Start production container |
213
+ | docker-pull-dev | Pull development image from Docker registry |
214
+ | docker-pull-prod | Pull production image from Docker registry |
215
+ | docker-push-dev | Push development image to Docker registry |
216
+ | docker-push-dev-latest | Push development image to Docker registry with dev-latest tag |
217
+ | docker-push-prod | Push production image to Docker registry |
218
+ | docker-push-prod-latest | Push production image to Docker registry with prod-latest tag |
219
+ | docker-remove | Remove Docker image |
220
+ | docker-restart | Restart Docker container |
221
+ | docker-start | Start Docker container |
222
+ | docker-stop | Stop Docker container |
223
+ | docs | Generate sphinx documentation |
224
+ | docs-architecture | Generate architecture.svg diagram from all import statements |
225
+ | docs-full | Generate documentation, coverage report, diagram and code |
226
+ | docs-metrics | Generate code metrics report, plots and tables |
227
+ | library-add | Add a given package to a given dependency group |
228
+ | library-graph-dev | Graph dependencies in dev environment |
229
+ | library-graph-prod | Graph dependencies in prod environment |
230
+ | library-install-dev | Install all dependencies into dev environment |
231
+ | library-install-prod | Install all dependencies into prod environment |
232
+ | library-list-dev | List packages in dev environment |
233
+ | library-list-prod | List packages in prod environment |
234
+ | library-lock-dev | Resolve dev.lock file |
235
+ | library-lock-prod | Resolve prod.lock file |
236
+ | library-remove | Remove a given package from a given dependency group |
237
+ | library-search | Search for pip packages |
238
+ | library-sync-dev | Sync dev environment with packages listed in dev.lock |
239
+ | library-sync-prod | Sync prod environment with packages listed in prod.lock |
240
+ | library-update | Update dev dependencies |
241
+ | library-update-pdm | Update PDM |
242
+ | quickstart | Display quickstart guide |
243
+ | session-lab | Run jupyter lab server |
244
+ | session-python | Run python session with dev dependencies |
245
+ | session-server | Runn application server inside Docker container |
246
+ | state | State of repository and Docker container |
247
+ | test-coverage | Generate test coverage report |
248
+ | test-dev | Run all tests |
249
+ | test-fast | Test all code excepts tests marked with SKIP_SLOWS_TESTS decorator |
250
+ | test-lint | Run linting and type checking |
251
+ | test-prod | Run tests across all support python versions |
252
+ | version | Full resolution of repo: dependencies, linting, tests, docs, etc |
253
+ | version-bump-major | Bump pyproject major version |
254
+ | version-bump-minor | Bump pyproject minor version |
255
+ | version-bump-patch | Bump pyproject patch version |
256
+ | version-commit | Tag with version and commit changes to master |
257
+ | zsh | Run ZSH session inside Docker container |
258
+ | zsh-complete | Generate oh-my-zsh completions |
259
+ | zsh-root | Run ZSH session as root inside Docker container |
260
+
261
+ ### Flags
262
+
263
+ | Short | Long | Description |
264
+ | ----- | --------- | ---------------------------------------------------- |
265
+ | -a | --args | Additional arguments, this can generally be ignored |
266
+ | -h | --help | Prints command help message to stdout |
267
+ | | --dryrun | Prints command that would otherwise be run to stdout |
268
+
269
+ ---
270
+
271
+ # Production CLI
272
+
273
+ Rolling-pin comes with a command line interface defined in command.py.
274
+
275
+ Its usage pattern is: `rolling-pin COMMAND [ARGS] [FLAGS] [-h --help]`
276
+
277
+ ## Commands
278
+
279
+ ---
280
+
281
+ ### bash-completion
282
+ Prints BASH completion code to be written to a _rolling-pin completion file
283
+
284
+ Usage: `rolling-pin bash-completion`
285
+
286
+ ---
287
+
288
+ ### zsh-completion
289
+ Prints ZSH completion code to be written to a _rolling-pin completion file
290
+
291
+ Usage: `rolling-pin zsh-completion`
292
+
293
+ ---
294
+
295
+ ### conform
296
+ Copies source files to target filepaths according to given conform file.
297
+
298
+ Usage: `rolling-pin conform [OPTIONS] SOURCE`
299
+
300
+ | Argument | Description |
301
+ | -------- | --------------------- |
302
+ | source | conform YAML filepath |
303
+
304
+ | Flag | Argument | Description | Default |
305
+ | --------- | -------- | ---------------------------------------------- | ------- |
306
+ | --groups | text | comma separated list of groups to be conformed | all |
307
+ | --dryrun | <p></p> | Print out conform table instead of run conform | <p></p> |
308
+ | --help | <p></p> | print help message | <p></p> |
309
+
310
+ ---
311
+
312
+ ### graph
313
+ Generate a dependency graph of a source repository and write it to a given filepath
314
+
315
+ Usage: `rolling-pin graph [OPTIONS] SOURCE TARGET`
316
+
317
+ | Argument | Description |
318
+ | -------- | --------------- |
319
+ | source | repository path |
320
+ | target | target filepath |
321
+
322
+ | Flag | Argument | Description | Default |
323
+ | --------- | -------- | ------------------------------------------- | --------- |
324
+ | --include | text | include files that match this regex pattern | .*\.py$' |
325
+ | --exclude | text | exclude files that match this regex pattern | test|mock |
326
+ | --orient | text | graph orientation | lr |
327
+ | --help | <p></p> | print help message | <p></p> |
328
+
329
+ ---
330
+
331
+ ### plot
332
+ Write radon metrics plots of given repository to given filepath.
333
+
334
+ Usage: `rolling-pin plot [OPTIONS] SOURCE TARGET`
335
+
336
+ | Argument | Description |
337
+ | -------- | --------------- |
338
+ | source | repository path |
339
+ | target | plot filepath |
340
+
341
+ | Flag | Description |
342
+ | ------ | ------------------ |
343
+ | --help | print help message |
344
+
345
+ ---
346
+
347
+ ### table
348
+ Write radon metrics tables of given repository to given directory.
349
+
350
+ Usage: `rolling-pin table [OPTIONS] SOURCE TARGET`
351
+
352
+ | Argument | Description |
353
+ | -------- | --------------- |
354
+ | source | repository path |
355
+ | target | table directory |
356
+
357
+ | Flag | Description |
358
+ | ------ | ------------------ |
359
+ | --help | print help message |
360
+
361
+ ---
362
+
363
+ ### toml
364
+ Generate a copy of a given TOML file with given edits indicated by flags. Flags
365
+ are evalauted in the following order: edit, delete, search. Flags may be
366
+ arbitrarily combined. Edit and delete flags may appear multiple times.
367
+
368
+ Usage: `rolling-pin toml [OPTIONS] SOURCE`
369
+
370
+ | Argument | Description |
371
+ | -------- | ------------- |
372
+ | source | TOML filepath |
373
+
374
+ | Flag | Argument | Description |
375
+ | --------- | -------- | ----------------------------------------------------------------------------------------- |
376
+ | --edit | text | replace key's value with given value, text is "=" separated key value pair in TOML format |
377
+ | --delete | text | delete keys that match this regular expression |
378
+ | --search | text | search for keys that match this regular expression |
379
+ | --target | text | target filepath to write to |
380
+ | --help | <p></p> | print help message |
381
+
382
+ #### *Example Usage*
383
+ **example file**
384
+ ```
385
+ >>>cat example.toml
386
+ [root]
387
+ a = 1
388
+ b = 2
389
+
390
+ [root.foo.bar]
391
+ x = "y"
392
+
393
+ [world]
394
+ hello = true
395
+ ```
396
+
397
+ **edit flag**
398
+ ```
399
+ >>>rolling-pin toml foobar.toml --edit 'root.a=999'
400
+ [root]
401
+ a = 999
402
+ b = 2...
403
+
404
+ >>>rolling-pin toml foobar.toml \
405
+ --edit 'root.a=[1, 2]' \
406
+ --edit 'root.b="xxx"'
407
+ [root]
408
+ a = [
409
+ 1,
410
+ 2,
411
+ ]
412
+ b = "xxx"...
413
+
414
+ >>>rolling-pin toml foobar.toml --edit 'root.foo.bar="baz"'
415
+ ...
416
+ hello = true
417
+
418
+ [root.foo]
419
+ bar = "baz"...
420
+ ```
421
+
422
+ **delete flag**
423
+ ```
424
+ >>>rolling-pin toml foobar.toml \
425
+ --delete 'root.foo.bar' \
426
+ --delete 'root.a'
427
+ [root]
428
+ b = 2
429
+
430
+ [world]
431
+ hello = true
432
+ ```
433
+
434
+ **search flag**
435
+ ```
436
+ >>>rolling-pin toml foobar.toml --search 'root.foo|world'
437
+ [world]
438
+ hello = true
439
+
440
+ [root.foo.bar]
441
+ x = "y"
442
+ ```
443
+
@@ -0,0 +1,15 @@
1
+ rolling_pin/__init__.py,sha256=R_g0FYses--dTmvbZLtFFI-FPn4og6p8zmkEesYmN1A,511
2
+ rolling_pin/blob_etl.py,sha256=79eEeCZwPeJ8XwMlLp9-MywDwC-HlqMK-MJhksLrPdU,20712
3
+ rolling_pin/command.py,sha256=xaM3Zp516sS2iF8RWb6qwGpc_IYmIkwtzJ2vDK9zPZo,6477
4
+ rolling_pin/conform_config.py,sha256=W-Ps6FPuZ7SOxFOfEjIo2MZac1vCRuVky6samSZPQkw,2630
5
+ rolling_pin/conform_etl.py,sha256=VyHAKVvdOtjx6Fy8dWn6XMfNh9OFgBbidyDUnSl3Zl4,9594
6
+ rolling_pin/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ rolling_pin/radon_etl.py,sha256=0rxFSnv2z41vKFe35XqCHSnnjT9qNNjouaCcIYkcHgI,18252
8
+ rolling_pin/repo_etl.py,sha256=W3ms6zdK22A6d9kVzHLP3HE1h0fTPMUeXww0c57Nq-k,20479
9
+ rolling_pin/toml_etl.py,sha256=fyioQTfqFW1e15qZ8F64sX379V5JzNlBKBuC5IPIgIo,4350
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,,
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2022 Alex Braun
3
+ Copyright (c) 2024 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,354 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: rolling-pin
3
- Version: 0.9.5
4
- Summary: A library of generic tools for ETL work and visualization of JSON blobs and python repositories
5
- License: MIT
6
- Keywords: ETL,blob,dependency,graph,svg,networkx,transform,code metrics,dependency diagram,build system
7
- Author-email: Alex Braun <alexander.g.braun@gmail.com>
8
- Requires-Python: >=3.8
9
- Classifier: Development Status :: 4 - Beta
10
- Classifier: Intended Audience :: Developers
11
- Classifier: License :: OSI Approved :: MIT License
12
- Classifier: Programming Language :: Python :: 3
13
- Classifier: Programming Language :: Python :: 3.10
14
- Classifier: Programming Language :: Python :: 3.8
15
- Classifier: Programming Language :: Python :: 3.9
16
- Classifier: Typing :: Typed
17
- Requires-Dist: click>=8.1.3
18
- Requires-Dist: cufflinks
19
- Requires-Dist: graphviz
20
- Requires-Dist: ipython
21
- Requires-Dist: lunchbox
22
- Requires-Dist: networkx
23
- Requires-Dist: numpy<=1.24.4,>=1.23.4
24
- Requires-Dist: pandas>=1.1.5
25
- Requires-Dist: pydot
26
- Requires-Dist: pyyaml
27
- Requires-Dist: radon<6.0.0
28
- Requires-Dist: schematics
29
- Requires-Dist: toml>=0.10.2
30
- Requires-Dist: wrapt
31
- Project-URL: documentation, https://thenewflesh.github.io/rolling-pin
32
- Project-URL: repository, https://github.com/theNewFlesh/rolling-pin
33
- Description-Content-Type: text/markdown
34
-
35
- <p>
36
- <a href="https://www.linkedin.com/in/alexandergbraun" rel="nofollow noreferrer">
37
- <img src="https://www.gomezaparicio.com/wp-content/uploads/2012/03/linkedin-logo-1-150x150.png"
38
- alt="linkedin" width="30px" height="30px"
39
- >
40
- </a>
41
- <a href="https://github.com/theNewFlesh" rel="nofollow noreferrer">
42
- <img src="https://tadeuzagallo.com/GithubPulse/assets/img/app-icon-github.png"
43
- alt="github" width="30px" height="30px"
44
- >
45
- </a>
46
- <a href="https://pypi.org/user/the-new-flesh" rel="nofollow noreferrer">
47
- <img src="https://cdn.iconscout.com/icon/free/png-256/python-2-226051.png"
48
- alt="pypi" width="30px" height="30px"
49
- >
50
- </a>
51
- <a href="http://vimeo.com/user3965452" rel="nofollow noreferrer">
52
- <img src="https://cdn.iconscout.com/icon/free/png-512/movie-52-151107.png?f=avif&w=512"
53
- alt="vimeo" width="30px" height="30px"
54
- >
55
- </a>
56
- <a href="http://www.alexgbraun.com" rel="nofollow noreferrer">
57
- <img src="https://i.ibb.co/fvyMkpM/logo.png"
58
- alt="alexgbraun" width="30px" height="30px"
59
- >
60
- </a>
61
- </p>
62
-
63
- <!-- <img id="logo" src="resources/logo.png" style="max-width: 717px"> -->
64
-
65
- [![](https://img.shields.io/badge/License-MIT-F77E70.svg?style=for-the-badge)](https://github.com/theNewFlesh/rolling-pin/blob/master/LICENSE)
66
- [![](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)
67
- [![](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/)
68
- [![](https://img.shields.io/pypi/dm/rolling-pin?style=for-the-badge&label=Downloads&color=5F95DE)](https://pepy.tech/project/rolling-pin)
69
-
70
- # Introduction
71
- Rolling-pin is a library of generic tools for ETL work and visualization of JSON
72
- blobs and python repositories
73
-
74
- See [documentation](https://thenewflesh.github.io/rolling-pin/) for details.
75
-
76
- On the documentation main page, under the *Architecture* section, is a
77
- dynamically generated dependency graph of rolling-pin's current architecture.
78
- It is generated using the RepoETL class.
79
-
80
- If you look under the *Metrics* section you will find Radon code metric plots
81
- and data of the rolling-pin source code, generated by the RadonETL class.
82
-
83
- Also have a look at this
84
- **[Jupyter notebook demo](https://github.com/theNewFlesh/rolling-pin/blob/master/notebooks/prototype_demo.ipynb)**
85
- for a taste of what rolling-pin can do.
86
-
87
- ---
88
-
89
- # Installation
90
- ### Python
91
- `pip install rolling-pin`
92
-
93
- ### Docker
94
- 1. Install [docker-desktop](https://docs.docker.com/desktop/)
95
- 2. `docker pull thenewflesh/rolling-pin:latest`
96
-
97
- ### Docker For Developers
98
- 1. Install [docker-desktop](https://docs.docker.com/desktop/)
99
- 2. Ensure docker-desktop has at least 4 GB of memory allocated to it.
100
- 3. `git clone git@github.com:theNewFlesh/rolling-pin.git`
101
- 4. `cd rolling-pin`
102
- 6. `chmod +x bin/rolling-pin`
103
- 7. `bin/rolling-pin docker-start`
104
-
105
- The service should take a few minutes to start up.
106
-
107
- Run `bin/rolling-pin --help` for more help on the command line tool.
108
-
109
- ---
110
-
111
- # Production CLI
112
-
113
- Rolling-pin comes with a command line interface defined in command.py.
114
-
115
- Its usage pattern is: `rolling-pin COMMAND [ARGS] [FLAGS] [-h --help]`
116
-
117
- ## Commands
118
-
119
- ---
120
-
121
- ### bash-completion
122
- Prints BASH completion code to be written to a _rolling-pin completion file
123
-
124
- Usage: `rolling-pin bash-completion`
125
-
126
- ---
127
-
128
- ### zsh-completion
129
- Prints ZSH completion code to be written to a _rolling-pin completion file
130
-
131
- Usage: `rolling-pin zsh-completion`
132
-
133
- ---
134
-
135
- ### conform
136
- Copies source files to target filepaths according to given conform file.
137
-
138
- Usage: `rolling-pin conform [OPTIONS] SOURCE`
139
-
140
- | Argument | Description |
141
- | -------- | --------------------- |
142
- | source | conform YAML filepath |
143
-
144
- | Flag | Argument | Description | Default |
145
- | --------- | -------- | ---------------------------------------------- | ------- |
146
- | --groups | text | comma separated list of groups to be conformed | all |
147
- | --dryrun | - | Print out conform table instead of run conform | - |
148
- | --help | - | print help message | - |
149
-
150
- ---
151
-
152
- ### graph
153
- Generate a dependency graph of a source repository and write it to a given filepath
154
-
155
- Usage: `rolling-pin graph [OPTIONS] SOURCE TARGET`
156
-
157
- | Argument | Description |
158
- | -------- | --------------- |
159
- | source | repository path |
160
- | target | target filepath |
161
-
162
- | Flag | Argument | Description | Default |
163
- | --------- | -------- | ------------------------------------------- | --------- |
164
- | --include | text | include files that match this regex pattern | .*\.py$' |
165
- | --exclude | text | exclude files that match this regex pattern | test|mock |
166
- | --orient | text | graph orientation | lr |
167
- | --help | - | print help message | - |
168
-
169
- ---
170
-
171
- ### plot
172
- Write radon metrics plots of given repository to given filepath.
173
-
174
- Usage: `rolling-pin plot [OPTIONS] SOURCE TARGET`
175
-
176
- | Argument | Description |
177
- | -------- | --------------- |
178
- | source | repository path |
179
- | target | plot filepath |
180
-
181
- | Flag | Description |
182
- | ------ | ------------------ |
183
- | --help | print help message |
184
-
185
- ---
186
-
187
- ### table
188
- Write radon metrics tables of given repository to given directory.
189
-
190
- Usage: `rolling-pin table [OPTIONS] SOURCE TARGET`
191
-
192
- | Argument | Description |
193
- | -------- | --------------- |
194
- | source | repository path |
195
- | target | table directory |
196
-
197
- | Flag | Description |
198
- | ------ | ------------------ |
199
- | --help | print help message |
200
-
201
- ---
202
-
203
- ### toml
204
- Generate a copy of a given TOML file with given edits indicated by flags. Flags
205
- are evalauted in the following order: edit, delete, search. Flags may be
206
- arbitrarily combined. Edit and delete flags may appear multiple times.
207
-
208
- Usage: `rolling-pin toml [OPTIONS] SOURCE`
209
-
210
- | Argument | Description |
211
- | -------- | ------------- |
212
- | source | TOML filepath |
213
-
214
- | Flag | Argument | Description |
215
- | --------- | -------- | ----------------------------------------------------------------------------------------- |
216
- | --edit | text | replace key's value with given value, text is "=" separated key value pair in TOML format |
217
- | --delete | text | delete keys that match this regular expression |
218
- | --search | text | search for keys that match this regular expression |
219
- | --target | text | target filepath to write to |
220
- | --help | - | print help message |
221
-
222
- #### *Example Usage*
223
- **example file**
224
- ```
225
- >>>cat example.toml
226
- [root]
227
- a = 1
228
- b = 2
229
-
230
- [root.foo.bar]
231
- x = "y"
232
-
233
- [world]
234
- hello = true
235
- ```
236
-
237
- **edit flag**
238
- ```
239
- >>>rolling-pin toml foobar.toml --edit 'root.a=999'
240
- [root]
241
- a = 999
242
- b = 2...
243
-
244
- >>>rolling-pin toml foobar.toml \
245
- --edit 'root.a=[1, 2]' \
246
- --edit 'root.b="xxx"'
247
- [root]
248
- a = [
249
- 1,
250
- 2,
251
- ]
252
- b = "xxx"...
253
-
254
- >>>rolling-pin toml foobar.toml --edit 'root.foo.bar="baz"'
255
- ...
256
- hello = true
257
-
258
- [root.foo]
259
- bar = "baz"...
260
- ```
261
-
262
- **delete flag**
263
- ```
264
- >>>rolling-pin toml foobar.toml \
265
- --delete 'root.foo.bar' \
266
- --delete 'root.a'
267
- [root]
268
- b = 2
269
-
270
- [world]
271
- hello = true
272
- ```
273
-
274
- **search flag**
275
- ```
276
- >>>rolling-pin toml foobar.toml --search 'root.foo|world'
277
- [world]
278
- hello = true
279
-
280
- [root.foo.bar]
281
- x = "y"
282
- ```
283
-
284
- ---
285
-
286
- # Development CLI
287
- bin/rolling-pin is a command line interface (defined in cli.py) that works with
288
- any version of python 2.7 and above, as it has no dependencies.
289
-
290
- Its usage pattern is: `bin/rolling-pin COMMAND [-a --args]=ARGS [-h --help] [--dryrun]`
291
-
292
- ### Commands
293
-
294
- | Command | Description |
295
- | -------------------- | ------------------------------------------------------------------- |
296
- | build-package | Build production version of repo for publishing |
297
- | build-prod | Publish pip package of repo to PyPi |
298
- | build-publish | Run production tests first then publish pip package of repo to PyPi |
299
- | build-test | Build test version of repo for prod testing |
300
- | docker-build | Build image of rolling-pin |
301
- | docker-build-prod | Build production image of rolling-pin |
302
- | docker-container | Display the Docker container id of rolling-pin |
303
- | docker-destroy | Shutdown rolling-pin container and destroy its image |
304
- | docker-destroy-prod | Shutdown rolling-pin production container and destroy its image |
305
- | docker-image | Display the Docker image id of rolling-pin |
306
- | docker-prod | Start rolling-pin production container |
307
- | docker-push | Push rolling-pin production image to Dockerhub |
308
- | docker-remove | Remove rolling-pin Docker image |
309
- | docker-restart | Restart rolling-pin container |
310
- | docker-start | Start rolling-pin container |
311
- | docker-stop | Stop rolling-pin container |
312
- | docs | Generate sphinx documentation |
313
- | docs-architecture | Generate architecture.svg diagram from all import statements |
314
- | docs-full | Generate documentation, coverage report, diagram and code |
315
- | docs-metrics | Generate code metrics report, plots and tables |
316
- | library-add | Add a given package to a given dependency group |
317
- | library-graph-dev | Graph dependencies in dev environment |
318
- | library-graph-prod | Graph dependencies in prod environment |
319
- | library-install-dev | Install all dependencies into dev environment |
320
- | library-install-prod | Install all dependencies into prod environment |
321
- | library-list-dev | List packages in dev environment |
322
- | library-list-prod | List packages in prod environment |
323
- | library-lock-dev | Resolve dev.lock file |
324
- | library-lock-prod | Resolve prod.lock file |
325
- | library-remove | Remove a given package from a given dependency group |
326
- | library-search | Search for pip packages |
327
- | library-sync-dev | Sync dev environment with packages listed in dev.lock |
328
- | library-sync-prod | Sync prod environment with packages listed in prod.lock |
329
- | library-update | Update dev dependencies |
330
- | library-update-pdm | Update PDM |
331
- | session-lab | Run jupyter lab server |
332
- | session-python | Run python session with dev dependencies |
333
- | state | State of rolling-pin |
334
- | test-coverage | Generate test coverage report |
335
- | test-dev | Run all tests |
336
- | test-fast | Test all code excepts tests marked with SKIP_SLOWS_TESTS decorator |
337
- | test-lint | Run linting and type checking |
338
- | test-prod | Run tests across all support python versions |
339
- | version | Full resolution of repo: dependencies, linting, tests, docs, etc |
340
- | version-bump-major | Bump pyproject major version |
341
- | version-bump-minor | Bump pyproject minor version |
342
- | version-bump-patch | Bump pyproject patch version |
343
- | zsh | Run ZSH session inside rolling-pin container |
344
- | zsh-complete | Generate oh-my-zsh completions |
345
- | zsh-root | Run ZSH session as root inside rolling-pin container |
346
-
347
- ### Flags
348
-
349
- | Short | Long | Description |
350
- | ----- | --------- | ---------------------------------------------------- |
351
- | -a | --args | Additional arguments, this can generally be ignored |
352
- | -h | --help | Prints command help message to stdout |
353
- | - | --dryrun | Prints command that would otherwise be run to stdout |
354
-
@@ -1,15 +0,0 @@
1
- rolling_pin/__init__.py,sha256=R_g0FYses--dTmvbZLtFFI-FPn4og6p8zmkEesYmN1A,511
2
- rolling_pin/blob_etl.py,sha256=79eEeCZwPeJ8XwMlLp9-MywDwC-HlqMK-MJhksLrPdU,20712
3
- rolling_pin/command.py,sha256=xaM3Zp516sS2iF8RWb6qwGpc_IYmIkwtzJ2vDK9zPZo,6477
4
- rolling_pin/conform_config.py,sha256=W-Ps6FPuZ7SOxFOfEjIo2MZac1vCRuVky6samSZPQkw,2630
5
- rolling_pin/conform_etl.py,sha256=VyHAKVvdOtjx6Fy8dWn6XMfNh9OFgBbidyDUnSl3Zl4,9594
6
- rolling_pin/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- rolling_pin/radon_etl.py,sha256=SbGrRQM-exMBXiVmCL1ZThvxwLbZNL6URK6J97Ffdis,17681
8
- rolling_pin/repo_etl.py,sha256=QqPCaf_NKRvhEe-0ZZOL49kdTDmeJrAUBsEpMBF2Ccc,20399
9
- rolling_pin/toml_etl.py,sha256=fyioQTfqFW1e15qZ8F64sX379V5JzNlBKBuC5IPIgIo,4350
10
- rolling_pin/tools.py,sha256=OgjfFIrDe5ka7OPUyUC-hCSTXaPkDtxQyrf0jxNB0to,17530
11
- rolling_pin-0.9.5.dist-info/entry_points.txt,sha256=nbMiJnGLhp49xrtx1pjK8sJiBrwkpj2kq-ezp8Zfyyk,56
12
- rolling_pin-0.9.5.dist-info/WHEEL,sha256=B19PGBCYhWaz2p_UjAoRVh767nYQfk14Sn4TpIZ-nfU,87
13
- rolling_pin-0.9.5.dist-info/METADATA,sha256=sbNE4PPEC5pPtDeHLhJZQqCuTermuSJosvu23pjIfUw,14669
14
- rolling_pin-0.9.5.dist-info/licenses/LICENSE,sha256=uP7spBpmtZy9-ruxdJfwB8VVGaOYjxgtUfxwwQ3j0hU,1067
15
- rolling_pin-0.9.5.dist-info/RECORD,,