rolling-pin 0.9.5__tar.gz → 0.9.6__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) 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
@@ -0,0 +1,429 @@
1
+ Metadata-Version: 2.1
2
+ Name: rolling-pin
3
+ Version: 0.9.6
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
+ Project-URL: documentation, https://thenewflesh.github.io/rolling-pin
18
+ Project-URL: repository, https://github.com/theNewFlesh/rolling-pin
19
+ Description-Content-Type: text/markdown
20
+
21
+ <p>
22
+ <a href="https://www.linkedin.com/in/alexandergbraun" rel="nofollow noreferrer">
23
+ <img src="https://www.gomezaparicio.com/wp-content/uploads/2012/03/linkedin-logo-1-150x150.png"
24
+ alt="linkedin" width="30px" height="30px"
25
+ >
26
+ </a>
27
+ <a href="https://github.com/theNewFlesh" rel="nofollow noreferrer">
28
+ <img src="https://tadeuzagallo.com/GithubPulse/assets/img/app-icon-github.png"
29
+ alt="github" width="30px" height="30px"
30
+ >
31
+ </a>
32
+ <a href="https://pypi.org/user/the-new-flesh" rel="nofollow noreferrer">
33
+ <img src="https://cdn.iconscout.com/icon/free/png-256/python-2-226051.png"
34
+ alt="pypi" width="30px" height="30px"
35
+ >
36
+ </a>
37
+ <a href="http://vimeo.com/user3965452" rel="nofollow noreferrer">
38
+ <img src="https://cdn.iconscout.com/icon/free/png-512/movie-52-151107.png?f=avif&w=512"
39
+ alt="vimeo" width="30px" height="30px"
40
+ >
41
+ </a>
42
+ <a href="http://www.alexgbraun.com" rel="nofollow noreferrer">
43
+ <img src="https://i.ibb.co/fvyMkpM/logo.png"
44
+ alt="alexgbraun" width="30px" height="30px"
45
+ >
46
+ </a>
47
+ </p>
48
+
49
+ <!-- <img id="logo" src="resources/logo.png" style="max-width: 717px"> -->
50
+
51
+ [![](https://img.shields.io/badge/License-MIT-F77E70.svg?style=for-the-badge)](https://github.com/theNewFlesh/rolling-pin/blob/master/LICENSE)
52
+ [![](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)
53
+ [![](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/)
54
+ [![](https://img.shields.io/pypi/dm/rolling-pin?style=for-the-badge&label=Downloads&color=5F95DE)](https://pepy.tech/project/rolling-pin)
55
+
56
+ # Introduction
57
+ Rolling-pin is a library of generic tools for ETL work and visualization of JSON
58
+ blobs and python repositories
59
+
60
+ See [documentation](https://thenewflesh.github.io/rolling-pin/) for details.
61
+
62
+ On the documentation main page, under the *Architecture* section, is a
63
+ dynamically generated dependency graph of rolling-pin's current architecture.
64
+ It is generated using the RepoETL class.
65
+
66
+ If you look under the *Metrics* section you will find Radon code metric plots
67
+ and data of the rolling-pin source code, generated by the RadonETL class.
68
+
69
+ Also have a look at this
70
+ **[Jupyter notebook demo](https://github.com/theNewFlesh/rolling-pin/blob/master/notebooks/prototype_demo.ipynb)**
71
+ for a taste of what rolling-pin can do.
72
+
73
+ ---
74
+
75
+ # Installation for Developers
76
+
77
+ ### Docker
78
+ 1. Install [docker-desktop](https://docs.docker.com/desktop/)
79
+ 2. Ensure docker-desktop has at least 4 GB of memory allocated to it.
80
+ 3. `git clone git@github.com:theNewFlesh/rolling-pin.git`
81
+ 4. `cd rolling-pin`
82
+ 5. `chmod +x bin/rolling-pin`
83
+ 6. `bin/rolling-pin docker-start`
84
+ - If building on a M1 Mac run `export DOCKER_DEFAULT_PLATFORM=linux/amd64` first.
85
+
86
+ The service should take a few minutes to start up.
87
+
88
+ Run `bin/rolling-pin --help` for more help on the command line tool.
89
+
90
+ ### ZSH Setup
91
+ 1. `bin/rolling-pin` must be run from this repository's top level directory.
92
+ 2. Therefore, if using zsh, it is recommended that you paste the following line
93
+ in your ~/.zshrc file:
94
+ - `alias rolling-pin="cd [parent dir]/rolling-pin; bin/rolling-pin"`
95
+ - Replace `[parent dir]` with the parent directory of this repository
96
+ 3. Consider adding the following line to your ~/.zshrc if you are using a M1 Mac:
97
+ - `export DOCKER_DEFAULT_PLATFORM=linux/amd64`
98
+ 4. Running the `zsh-complete` command will enable tab completions of the cli
99
+ commands, in the next shell session.
100
+
101
+ For example:
102
+ - `rolling-pin [tab]` will show you all the cli options, which you can press
103
+ tab to cycle through
104
+ - `rolling-pin docker-[tab]` will show you only the cli options that begin with
105
+ "docker-"
106
+
107
+ # Installation for Production
108
+
109
+ ### Python
110
+ `pip install rolling-pin`
111
+
112
+ ### Docker
113
+ 1. Install [docker-desktop](https://docs.docker.com/desktop/)
114
+ 2. `docker pull theNewFlesh/rolling-pin:[version]`
115
+
116
+
117
+ ---
118
+
119
+ # Quickstart Guide
120
+ This repository contains a suite commands for the whole development process.
121
+ This includes everything from testing, to documentation generation and
122
+ publishing pip packages.
123
+
124
+ These commands can be accessed through:
125
+
126
+ - The VSCode task runner
127
+ - The VSCode task runner side bar
128
+ - A terminal running on the host OS
129
+ - A terminal within this repositories docker container
130
+
131
+ Running the `zsh-complete` command will enable tab completions of the CLI.
132
+ See the zsh setup section for more information.
133
+
134
+ ### Command Groups
135
+
136
+ Development commands are grouped by one of 10 prefixes:
137
+
138
+ | Command | Description |
139
+ | ---------- | ---------------------------------------------------------------------------------- |
140
+ | build | Commands for building packages for testing and pip publishing |
141
+ | docker | Common docker commands such as build, start and stop |
142
+ | docs | Commands for generating documentation and code metrics |
143
+ | library | Commands for managing python package dependencies |
144
+ | session | Commands for starting interactive sessions such as jupyter lab and python |
145
+ | state | Command to display the current state of the repo and container |
146
+ | test | Commands for running tests, linter and type annotations |
147
+ | version | Commands for bumping project versions |
148
+ | quickstart | Display this quickstart guide |
149
+ | zsh | Commands for running a zsh session in the container and generating zsh completions |
150
+
151
+ ### Common Commands
152
+
153
+ Here are some frequently used commands to get you started:
154
+
155
+ | Command | Description |
156
+ | ----------------- | --------------------------------------------------------- |
157
+ | docker-restart | Restart container |
158
+ | docker-start | Start container |
159
+ | docker-stop | Stop container |
160
+ | docs-full | Generate documentation, coverage report, diagram and code |
161
+ | library-add | Add a given package to a given dependency group |
162
+ | library-graph-dev | Graph dependencies in dev environment |
163
+ | library-remove | Remove a given package from a given dependency group |
164
+ | library-search | Search for pip packages |
165
+ | library-update | Update dev dependencies |
166
+ | session-lab | Run jupyter lab server |
167
+ | state | State of |
168
+ | test-dev | Run all tests |
169
+ | test-lint | Run linting and type checking |
170
+ | zsh | Run ZSH session inside container |
171
+ | zsh-complete | Generate ZSH completion script |
172
+
173
+ ---
174
+
175
+ # Development CLI
176
+ bin/rolling-pin is a command line interface (defined in cli.py) that
177
+ works with any version of python 2.7 and above, as it has no dependencies.
178
+ Commands generally do not expect any arguments or flags.
179
+
180
+ Its usage pattern is: `bin/rolling-pin COMMAND [-a --args]=ARGS [-h --help] [--dryrun]`
181
+
182
+ ### Commands
183
+ The following is a complete list of all available development commands:
184
+
185
+ | Command | Description |
186
+ | ----------------------- | ------------------------------------------------------------------- |
187
+ | build-package | Build production version of repo for publishing |
188
+ | build-prod | Publish pip package of repo to PyPi |
189
+ | build-publish | Run production tests first then publish pip package of repo to PyPi |
190
+ | build-test | Build test version of repo for prod testing |
191
+ | docker-build | Build Docker image |
192
+ | docker-build-from-cache | Build Docker image from cached image |
193
+ | docker-build-prod | Build production image |
194
+ | docker-container | Display the Docker container id |
195
+ | docker-destroy | Shutdown container and destroy its image |
196
+ | docker-destroy-prod | Shutdown production container and destroy its image |
197
+ | docker-image | Display the Docker image id |
198
+ | docker-prod | Start production container |
199
+ | docker-pull-dev | Pull development image from Docker registry |
200
+ | docker-pull-prod | Pull production image from Docker registry |
201
+ | docker-push-dev | Push development image to Docker registry |
202
+ | docker-push-dev-latest | Push development image to Docker registry with dev-latest tag |
203
+ | docker-push-prod | Push production image to Docker registry |
204
+ | docker-push-prod-latest | Push production image to Docker registry with prod-latest tag |
205
+ | docker-remove | Remove Docker image |
206
+ | docker-restart | Restart Docker container |
207
+ | docker-start | Start Docker container |
208
+ | docker-stop | Stop Docker container |
209
+ | docs | Generate sphinx documentation |
210
+ | docs-architecture | Generate architecture.svg diagram from all import statements |
211
+ | docs-full | Generate documentation, coverage report, diagram and code |
212
+ | docs-metrics | Generate code metrics report, plots and tables |
213
+ | library-add | Add a given package to a given dependency group |
214
+ | library-graph-dev | Graph dependencies in dev environment |
215
+ | library-graph-prod | Graph dependencies in prod environment |
216
+ | library-install-dev | Install all dependencies into dev environment |
217
+ | library-install-prod | Install all dependencies into prod environment |
218
+ | library-list-dev | List packages in dev environment |
219
+ | library-list-prod | List packages in prod environment |
220
+ | library-lock-dev | Resolve dev.lock file |
221
+ | library-lock-prod | Resolve prod.lock file |
222
+ | library-remove | Remove a given package from a given dependency group |
223
+ | library-search | Search for pip packages |
224
+ | library-sync-dev | Sync dev environment with packages listed in dev.lock |
225
+ | library-sync-prod | Sync prod environment with packages listed in prod.lock |
226
+ | library-update | Update dev dependencies |
227
+ | library-update-pdm | Update PDM |
228
+ | quickstart | Display quickstart guide |
229
+ | session-lab | Run jupyter lab server |
230
+ | session-python | Run python session with dev dependencies |
231
+ | session-server | Runn application server inside Docker container |
232
+ | state | State of repository and Docker container |
233
+ | test-coverage | Generate test coverage report |
234
+ | test-dev | Run all tests |
235
+ | test-fast | Test all code excepts tests marked with SKIP_SLOWS_TESTS decorator |
236
+ | test-lint | Run linting and type checking |
237
+ | test-prod | Run tests across all support python versions |
238
+ | version | Full resolution of repo: dependencies, linting, tests, docs, etc |
239
+ | version-bump-major | Bump pyproject major version |
240
+ | version-bump-minor | Bump pyproject minor version |
241
+ | version-bump-patch | Bump pyproject patch version |
242
+ | version-commit | Tag with version and commit changes to master |
243
+ | zsh | Run ZSH session inside Docker container |
244
+ | zsh-complete | Generate oh-my-zsh completions |
245
+ | zsh-root | Run ZSH session as root inside Docker container |
246
+
247
+ ### Flags
248
+
249
+ | Short | Long | Description |
250
+ | ----- | --------- | ---------------------------------------------------- |
251
+ | -a | --args | Additional arguments, this can generally be ignored |
252
+ | -h | --help | Prints command help message to stdout |
253
+ | | --dryrun | Prints command that would otherwise be run to stdout |
254
+
255
+ ---
256
+
257
+ # Production CLI
258
+
259
+ Rolling-pin comes with a command line interface defined in command.py.
260
+
261
+ Its usage pattern is: `rolling-pin COMMAND [ARGS] [FLAGS] [-h --help]`
262
+
263
+ ## Commands
264
+
265
+ ---
266
+
267
+ ### bash-completion
268
+ Prints BASH completion code to be written to a _rolling-pin completion file
269
+
270
+ Usage: `rolling-pin bash-completion`
271
+
272
+ ---
273
+
274
+ ### zsh-completion
275
+ Prints ZSH completion code to be written to a _rolling-pin completion file
276
+
277
+ Usage: `rolling-pin zsh-completion`
278
+
279
+ ---
280
+
281
+ ### conform
282
+ Copies source files to target filepaths according to given conform file.
283
+
284
+ Usage: `rolling-pin conform [OPTIONS] SOURCE`
285
+
286
+ | Argument | Description |
287
+ | -------- | --------------------- |
288
+ | source | conform YAML filepath |
289
+
290
+ | Flag | Argument | Description | Default |
291
+ | --------- | -------- | ---------------------------------------------- | ------- |
292
+ | --groups | text | comma separated list of groups to be conformed | all |
293
+ | --dryrun | <p></p> | Print out conform table instead of run conform | <p></p> |
294
+ | --help | <p></p> | print help message | <p></p> |
295
+
296
+ ---
297
+
298
+ ### graph
299
+ Generate a dependency graph of a source repository and write it to a given filepath
300
+
301
+ Usage: `rolling-pin graph [OPTIONS] SOURCE TARGET`
302
+
303
+ | Argument | Description |
304
+ | -------- | --------------- |
305
+ | source | repository path |
306
+ | target | target filepath |
307
+
308
+ | Flag | Argument | Description | Default |
309
+ | --------- | -------- | ------------------------------------------- | --------- |
310
+ | --include | text | include files that match this regex pattern | .*\.py$' |
311
+ | --exclude | text | exclude files that match this regex pattern | test|mock |
312
+ | --orient | text | graph orientation | lr |
313
+ | --help | <p></p> | print help message | <p></p> |
314
+
315
+ ---
316
+
317
+ ### plot
318
+ Write radon metrics plots of given repository to given filepath.
319
+
320
+ Usage: `rolling-pin plot [OPTIONS] SOURCE TARGET`
321
+
322
+ | Argument | Description |
323
+ | -------- | --------------- |
324
+ | source | repository path |
325
+ | target | plot filepath |
326
+
327
+ | Flag | Description |
328
+ | ------ | ------------------ |
329
+ | --help | print help message |
330
+
331
+ ---
332
+
333
+ ### table
334
+ Write radon metrics tables of given repository to given directory.
335
+
336
+ Usage: `rolling-pin table [OPTIONS] SOURCE TARGET`
337
+
338
+ | Argument | Description |
339
+ | -------- | --------------- |
340
+ | source | repository path |
341
+ | target | table directory |
342
+
343
+ | Flag | Description |
344
+ | ------ | ------------------ |
345
+ | --help | print help message |
346
+
347
+ ---
348
+
349
+ ### toml
350
+ Generate a copy of a given TOML file with given edits indicated by flags. Flags
351
+ are evalauted in the following order: edit, delete, search. Flags may be
352
+ arbitrarily combined. Edit and delete flags may appear multiple times.
353
+
354
+ Usage: `rolling-pin toml [OPTIONS] SOURCE`
355
+
356
+ | Argument | Description |
357
+ | -------- | ------------- |
358
+ | source | TOML filepath |
359
+
360
+ | Flag | Argument | Description |
361
+ | --------- | -------- | ----------------------------------------------------------------------------------------- |
362
+ | --edit | text | replace key's value with given value, text is "=" separated key value pair in TOML format |
363
+ | --delete | text | delete keys that match this regular expression |
364
+ | --search | text | search for keys that match this regular expression |
365
+ | --target | text | target filepath to write to |
366
+ | --help | <p></p> | print help message |
367
+
368
+ #### *Example Usage*
369
+ **example file**
370
+ ```
371
+ >>>cat example.toml
372
+ [root]
373
+ a = 1
374
+ b = 2
375
+
376
+ [root.foo.bar]
377
+ x = "y"
378
+
379
+ [world]
380
+ hello = true
381
+ ```
382
+
383
+ **edit flag**
384
+ ```
385
+ >>>rolling-pin toml foobar.toml --edit 'root.a=999'
386
+ [root]
387
+ a = 999
388
+ b = 2...
389
+
390
+ >>>rolling-pin toml foobar.toml \
391
+ --edit 'root.a=[1, 2]' \
392
+ --edit 'root.b="xxx"'
393
+ [root]
394
+ a = [
395
+ 1,
396
+ 2,
397
+ ]
398
+ b = "xxx"...
399
+
400
+ >>>rolling-pin toml foobar.toml --edit 'root.foo.bar="baz"'
401
+ ...
402
+ hello = true
403
+
404
+ [root.foo]
405
+ bar = "baz"...
406
+ ```
407
+
408
+ **delete flag**
409
+ ```
410
+ >>>rolling-pin toml foobar.toml \
411
+ --delete 'root.foo.bar' \
412
+ --delete 'root.a'
413
+ [root]
414
+ b = 2
415
+
416
+ [world]
417
+ hello = true
418
+ ```
419
+
420
+ **search flag**
421
+ ```
422
+ >>>rolling-pin toml foobar.toml --search 'root.foo|world'
423
+ [world]
424
+ hello = true
425
+
426
+ [root.foo.bar]
427
+ x = "y"
428
+ ```
429
+