developer-utility-toolkit 0.1.1__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.
- developer_utility_toolkit-0.1.1/LICENSE +21 -0
- developer_utility_toolkit-0.1.1/PKG-INFO +197 -0
- developer_utility_toolkit-0.1.1/README.md +149 -0
- developer_utility_toolkit-0.1.1/pyproject.toml +100 -0
- developer_utility_toolkit-0.1.1/setup.cfg +4 -0
- developer_utility_toolkit-0.1.1/src/developer_utility_toolkit.egg-info/PKG-INFO +197 -0
- developer_utility_toolkit-0.1.1/src/developer_utility_toolkit.egg-info/SOURCES.txt +40 -0
- developer_utility_toolkit-0.1.1/src/developer_utility_toolkit.egg-info/dependency_links.txt +1 -0
- developer_utility_toolkit-0.1.1/src/developer_utility_toolkit.egg-info/entry_points.txt +2 -0
- developer_utility_toolkit-0.1.1/src/developer_utility_toolkit.egg-info/requires.txt +31 -0
- developer_utility_toolkit-0.1.1/src/developer_utility_toolkit.egg-info/top_level.txt +1 -0
- developer_utility_toolkit-0.1.1/src/toolkit/__init__.py +4 -0
- developer_utility_toolkit-0.1.1/src/toolkit/cli.py +284 -0
- developer_utility_toolkit-0.1.1/src/toolkit/core/__init__.py +1 -0
- developer_utility_toolkit-0.1.1/src/toolkit/core/base_transformer.py +16 -0
- developer_utility_toolkit-0.1.1/src/toolkit/core/detector.py +78 -0
- developer_utility_toolkit-0.1.1/src/toolkit/core/io_utils.py +35 -0
- developer_utility_toolkit-0.1.1/src/toolkit/core/registry.py +71 -0
- developer_utility_toolkit-0.1.1/src/toolkit/formatters/__init__.py +1 -0
- developer_utility_toolkit-0.1.1/src/toolkit/formatters/json_tools.py +32 -0
- developer_utility_toolkit-0.1.1/src/toolkit/formatters/xml_tools.py +34 -0
- developer_utility_toolkit-0.1.1/src/toolkit/history/__init__.py +1 -0
- developer_utility_toolkit-0.1.1/src/toolkit/history/manager.py +71 -0
- developer_utility_toolkit-0.1.1/src/toolkit/image_tools/__init__.py +1 -0
- developer_utility_toolkit-0.1.1/src/toolkit/image_tools/pixelate.py +30 -0
- developer_utility_toolkit-0.1.1/src/toolkit/transformers/__init__.py +1 -0
- developer_utility_toolkit-0.1.1/src/toolkit/transformers/encoding.py +52 -0
- developer_utility_toolkit-0.1.1/src/toolkit/transformers/optional_modules.py +3 -0
- developer_utility_toolkit-0.1.1/src/toolkit/transformers/structured.py +73 -0
- developer_utility_toolkit-0.1.1/src/toolkit/transformers/text_case.py +36 -0
- developer_utility_toolkit-0.1.1/src/toolkit/web_tools/__init__.py +1 -0
- developer_utility_toolkit-0.1.1/src/toolkit/web_tools/sitemap.py +64 -0
- developer_utility_toolkit-0.1.1/tests/test_cli.py +136 -0
- developer_utility_toolkit-0.1.1/tests/test_detector.py +29 -0
- developer_utility_toolkit-0.1.1/tests/test_history.py +31 -0
- developer_utility_toolkit-0.1.1/tests/test_io_utils.py +36 -0
- developer_utility_toolkit-0.1.1/tests/test_json_tools.py +20 -0
- developer_utility_toolkit-0.1.1/tests/test_pixelate.py +57 -0
- developer_utility_toolkit-0.1.1/tests/test_registry_transformers.py +36 -0
- developer_utility_toolkit-0.1.1/tests/test_sitemap.py +45 -0
- developer_utility_toolkit-0.1.1/tests/test_transformers_extra.py +45 -0
- developer_utility_toolkit-0.1.1/tests/test_xml_tools.py +20 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Artenis Alija
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: developer-utility-toolkit
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Security-focused modular developer multi-tool CLI.
|
|
5
|
+
Author: Developer Utility Toolkit Contributors
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/artenisalija/developer-utility-kit
|
|
8
|
+
Project-URL: Repository, https://github.com/artenisalija/developer-utility-kit
|
|
9
|
+
Project-URL: Issues, https://github.com/artenisalija/developer-utility-kit/issues
|
|
10
|
+
Keywords: cli,developer-tools,security,formatting,conversion
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
19
|
+
Classifier: Topic :: Utilities
|
|
20
|
+
Requires-Python: >=3.11
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: typer==0.16.0
|
|
24
|
+
Requires-Dist: defusedxml==0.7.1
|
|
25
|
+
Provides-Extra: image
|
|
26
|
+
Requires-Dist: pillow==11.1.0; extra == "image"
|
|
27
|
+
Provides-Extra: web
|
|
28
|
+
Requires-Dist: requests==2.32.4; extra == "web"
|
|
29
|
+
Provides-Extra: xml
|
|
30
|
+
Requires-Dist: lxml==5.3.0; extra == "xml"
|
|
31
|
+
Provides-Extra: yaml
|
|
32
|
+
Requires-Dist: pyyaml==6.0.2; extra == "yaml"
|
|
33
|
+
Provides-Extra: all
|
|
34
|
+
Requires-Dist: pillow==11.1.0; extra == "all"
|
|
35
|
+
Requires-Dist: requests==2.32.4; extra == "all"
|
|
36
|
+
Requires-Dist: lxml==5.3.0; extra == "all"
|
|
37
|
+
Requires-Dist: pyyaml==6.0.2; extra == "all"
|
|
38
|
+
Provides-Extra: dev
|
|
39
|
+
Requires-Dist: black==24.10.0; extra == "dev"
|
|
40
|
+
Requires-Dist: ruff==0.9.6; extra == "dev"
|
|
41
|
+
Requires-Dist: mypy==1.14.1; extra == "dev"
|
|
42
|
+
Requires-Dist: pytest==8.3.4; extra == "dev"
|
|
43
|
+
Requires-Dist: pytest-cov==6.0.0; extra == "dev"
|
|
44
|
+
Requires-Dist: bandit==1.8.2; extra == "dev"
|
|
45
|
+
Requires-Dist: pip-audit==2.7.3; extra == "dev"
|
|
46
|
+
Requires-Dist: safety==3.2.14; extra == "dev"
|
|
47
|
+
Requires-Dist: types-requests==2.32.0.20241016; extra == "dev"
|
|
48
|
+
|
|
49
|
+
# Developer Utility Toolkit
|
|
50
|
+
|
|
51
|
+
[](https://github.com/artenisalija/developer-utility-kit/actions/workflows/ci.yml)
|
|
52
|
+
[](https://github.com/artenisalija/developer-utility-kit/actions/workflows/security.yml)
|
|
53
|
+
[](https://github.com/artenisalija/developer-utility-kit)
|
|
54
|
+
|
|
55
|
+
Security-focused, modular, format-aware Python CLI for common developer tasks.
|
|
56
|
+
|
|
57
|
+
## Features
|
|
58
|
+
|
|
59
|
+
- Automatic input detection for text, JSON, XML, Base64, URL, and file extension types
|
|
60
|
+
- Direct format conversion using a plugin-based transformer registry
|
|
61
|
+
- JSON and XML formatting, minification, and validation
|
|
62
|
+
- Encoding tools (Base64 and URL encode/decode)
|
|
63
|
+
- Image pixelation utility (optional `pillow`)
|
|
64
|
+
- Sitemap generator and sitemap fetcher with URL validation and request timeouts
|
|
65
|
+
- Local command history (`~/.developer_utility_toolkit/history/history.jsonl`)
|
|
66
|
+
|
|
67
|
+
## Architecture
|
|
68
|
+
|
|
69
|
+
- `src/toolkit/core`: abstractions, registry, detector, and safe I/O helpers
|
|
70
|
+
- `src/toolkit/transformers`: pluggable one-step transformers
|
|
71
|
+
- `src/toolkit/formatters`: JSON/XML format/minify/validate services
|
|
72
|
+
- `src/toolkit/image_tools`: image utilities
|
|
73
|
+
- `src/toolkit/web_tools`: sitemap generation/fetching
|
|
74
|
+
- `src/toolkit/history`: local history service
|
|
75
|
+
- `src/toolkit/cli.py`: Typer entrypoint and command wiring
|
|
76
|
+
|
|
77
|
+
Design choices:
|
|
78
|
+
- No chained transformations by default (one direct transform per request target)
|
|
79
|
+
- Safe XML parsing via `defusedxml`
|
|
80
|
+
- Controlled output writes via sanitized filename + output directory constraints
|
|
81
|
+
- Clear failure modes with explicit non-zero exit codes
|
|
82
|
+
|
|
83
|
+
## Installation
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
python -m pip install --upgrade pip
|
|
87
|
+
pip install .
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Install all optional features:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
pip install ".[all]"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Install directly from GitHub:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
pip install "git+https://github.com/artenisalija/developer-utility-kit.git"
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Install a specific version tag (recommended):
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
pip install "git+https://github.com/artenisalija/developer-utility-kit.git@v0.1.1"
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Install from GitHub with all extras:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
pip install "developer-utility-toolkit[all] @ git+https://github.com/artenisalija/developer-utility-kit.git@v0.1.1"
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Install developer tooling:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
pip install ".[all,dev]"
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Usage
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
toolkit analyze --text '{"name":"dev"}'
|
|
124
|
+
toolkit convert --from text --to base64 --text "hello"
|
|
125
|
+
toolkit format --kind json --text '{"b":2,"a":1}'
|
|
126
|
+
toolkit validate --kind xml --text '<root><a>1</a></root>'
|
|
127
|
+
toolkit minify --kind json --text '{"b":2,"a":1}'
|
|
128
|
+
toolkit image pixelate --input-file ./input.png --output-name output.png
|
|
129
|
+
toolkit sitemap generate --base-url https://example.com --path / --path /docs
|
|
130
|
+
toolkit sitemap fetch --url https://example.com/sitemap.xml
|
|
131
|
+
toolkit recent show --limit 10
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Security Philosophy
|
|
135
|
+
|
|
136
|
+
- Secure defaults and explicit input validation
|
|
137
|
+
- Defused XML parser to prevent XXE/entity expansion attacks
|
|
138
|
+
- No `eval`/`exec` usage
|
|
139
|
+
- Timeout-controlled network calls
|
|
140
|
+
- Sanitized output file names with constrained output directories
|
|
141
|
+
- Graceful errors with explicit status codes
|
|
142
|
+
|
|
143
|
+
## Development
|
|
144
|
+
|
|
145
|
+
Run local quality gates:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
ruff check .
|
|
149
|
+
black --check .
|
|
150
|
+
mypy src tests
|
|
151
|
+
pytest
|
|
152
|
+
bandit -r src -ll
|
|
153
|
+
pip-audit --strict
|
|
154
|
+
safety check --full-report
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Pre-commit:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
pre-commit install
|
|
161
|
+
pre-commit run --all-files
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## CI/CD
|
|
165
|
+
|
|
166
|
+
- `ci.yml`: lint + format + mypy + tests + coverage (>=85%) on Python 3.11/3.12
|
|
167
|
+
- `security.yml`: Bandit + pip-audit + Safety
|
|
168
|
+
- `release.yml`: runs on version tags (`v*.*.*`), builds wheel/sdist, runs tests, publishes to PyPI, creates GitHub release notes
|
|
169
|
+
- Dependabot enabled for Python packages and GitHub Actions
|
|
170
|
+
|
|
171
|
+
## Publishing to PyPI
|
|
172
|
+
|
|
173
|
+
1. Create a PyPI API token.
|
|
174
|
+
2. Add `PYPI_API_TOKEN` in GitHub repository secrets.
|
|
175
|
+
3. Bump version in `pyproject.toml`.
|
|
176
|
+
4. Tag and push:
|
|
177
|
+
```bash
|
|
178
|
+
git tag v0.1.1
|
|
179
|
+
git push origin v0.1.1
|
|
180
|
+
```
|
|
181
|
+
5. GitHub Action `release.yml` publishes automatically.
|
|
182
|
+
|
|
183
|
+
## Build Standalone Executable
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
pip install pyinstaller
|
|
187
|
+
pyinstaller --onefile --name toolkit src/toolkit/cli.py
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
The executable will be available under `dist/`.
|
|
191
|
+
|
|
192
|
+
## Contribution Guidelines
|
|
193
|
+
|
|
194
|
+
1. Create a branch for your change.
|
|
195
|
+
2. Add or update tests.
|
|
196
|
+
3. Run all local quality checks and security scans.
|
|
197
|
+
4. Open a pull request with rationale and risk notes.
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# Developer Utility Toolkit
|
|
2
|
+
|
|
3
|
+
[](https://github.com/artenisalija/developer-utility-kit/actions/workflows/ci.yml)
|
|
4
|
+
[](https://github.com/artenisalija/developer-utility-kit/actions/workflows/security.yml)
|
|
5
|
+
[](https://github.com/artenisalija/developer-utility-kit)
|
|
6
|
+
|
|
7
|
+
Security-focused, modular, format-aware Python CLI for common developer tasks.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- Automatic input detection for text, JSON, XML, Base64, URL, and file extension types
|
|
12
|
+
- Direct format conversion using a plugin-based transformer registry
|
|
13
|
+
- JSON and XML formatting, minification, and validation
|
|
14
|
+
- Encoding tools (Base64 and URL encode/decode)
|
|
15
|
+
- Image pixelation utility (optional `pillow`)
|
|
16
|
+
- Sitemap generator and sitemap fetcher with URL validation and request timeouts
|
|
17
|
+
- Local command history (`~/.developer_utility_toolkit/history/history.jsonl`)
|
|
18
|
+
|
|
19
|
+
## Architecture
|
|
20
|
+
|
|
21
|
+
- `src/toolkit/core`: abstractions, registry, detector, and safe I/O helpers
|
|
22
|
+
- `src/toolkit/transformers`: pluggable one-step transformers
|
|
23
|
+
- `src/toolkit/formatters`: JSON/XML format/minify/validate services
|
|
24
|
+
- `src/toolkit/image_tools`: image utilities
|
|
25
|
+
- `src/toolkit/web_tools`: sitemap generation/fetching
|
|
26
|
+
- `src/toolkit/history`: local history service
|
|
27
|
+
- `src/toolkit/cli.py`: Typer entrypoint and command wiring
|
|
28
|
+
|
|
29
|
+
Design choices:
|
|
30
|
+
- No chained transformations by default (one direct transform per request target)
|
|
31
|
+
- Safe XML parsing via `defusedxml`
|
|
32
|
+
- Controlled output writes via sanitized filename + output directory constraints
|
|
33
|
+
- Clear failure modes with explicit non-zero exit codes
|
|
34
|
+
|
|
35
|
+
## Installation
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
python -m pip install --upgrade pip
|
|
39
|
+
pip install .
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Install all optional features:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pip install ".[all]"
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Install directly from GitHub:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pip install "git+https://github.com/artenisalija/developer-utility-kit.git"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Install a specific version tag (recommended):
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pip install "git+https://github.com/artenisalija/developer-utility-kit.git@v0.1.1"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Install from GitHub with all extras:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
pip install "developer-utility-toolkit[all] @ git+https://github.com/artenisalija/developer-utility-kit.git@v0.1.1"
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Install developer tooling:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
pip install ".[all,dev]"
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Usage
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
toolkit analyze --text '{"name":"dev"}'
|
|
76
|
+
toolkit convert --from text --to base64 --text "hello"
|
|
77
|
+
toolkit format --kind json --text '{"b":2,"a":1}'
|
|
78
|
+
toolkit validate --kind xml --text '<root><a>1</a></root>'
|
|
79
|
+
toolkit minify --kind json --text '{"b":2,"a":1}'
|
|
80
|
+
toolkit image pixelate --input-file ./input.png --output-name output.png
|
|
81
|
+
toolkit sitemap generate --base-url https://example.com --path / --path /docs
|
|
82
|
+
toolkit sitemap fetch --url https://example.com/sitemap.xml
|
|
83
|
+
toolkit recent show --limit 10
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Security Philosophy
|
|
87
|
+
|
|
88
|
+
- Secure defaults and explicit input validation
|
|
89
|
+
- Defused XML parser to prevent XXE/entity expansion attacks
|
|
90
|
+
- No `eval`/`exec` usage
|
|
91
|
+
- Timeout-controlled network calls
|
|
92
|
+
- Sanitized output file names with constrained output directories
|
|
93
|
+
- Graceful errors with explicit status codes
|
|
94
|
+
|
|
95
|
+
## Development
|
|
96
|
+
|
|
97
|
+
Run local quality gates:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
ruff check .
|
|
101
|
+
black --check .
|
|
102
|
+
mypy src tests
|
|
103
|
+
pytest
|
|
104
|
+
bandit -r src -ll
|
|
105
|
+
pip-audit --strict
|
|
106
|
+
safety check --full-report
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Pre-commit:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
pre-commit install
|
|
113
|
+
pre-commit run --all-files
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## CI/CD
|
|
117
|
+
|
|
118
|
+
- `ci.yml`: lint + format + mypy + tests + coverage (>=85%) on Python 3.11/3.12
|
|
119
|
+
- `security.yml`: Bandit + pip-audit + Safety
|
|
120
|
+
- `release.yml`: runs on version tags (`v*.*.*`), builds wheel/sdist, runs tests, publishes to PyPI, creates GitHub release notes
|
|
121
|
+
- Dependabot enabled for Python packages and GitHub Actions
|
|
122
|
+
|
|
123
|
+
## Publishing to PyPI
|
|
124
|
+
|
|
125
|
+
1. Create a PyPI API token.
|
|
126
|
+
2. Add `PYPI_API_TOKEN` in GitHub repository secrets.
|
|
127
|
+
3. Bump version in `pyproject.toml`.
|
|
128
|
+
4. Tag and push:
|
|
129
|
+
```bash
|
|
130
|
+
git tag v0.1.1
|
|
131
|
+
git push origin v0.1.1
|
|
132
|
+
```
|
|
133
|
+
5. GitHub Action `release.yml` publishes automatically.
|
|
134
|
+
|
|
135
|
+
## Build Standalone Executable
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
pip install pyinstaller
|
|
139
|
+
pyinstaller --onefile --name toolkit src/toolkit/cli.py
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
The executable will be available under `dist/`.
|
|
143
|
+
|
|
144
|
+
## Contribution Guidelines
|
|
145
|
+
|
|
146
|
+
1. Create a branch for your change.
|
|
147
|
+
2. Add or update tests.
|
|
148
|
+
3. Run all local quality checks and security scans.
|
|
149
|
+
4. Open a pull request with rationale and risk notes.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools==75.8.0", "wheel==0.45.1"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "developer-utility-toolkit"
|
|
7
|
+
version = "0.1.1"
|
|
8
|
+
description = "Security-focused modular developer multi-tool CLI."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Developer Utility Toolkit Contributors" }
|
|
14
|
+
]
|
|
15
|
+
keywords = ["cli", "developer-tools", "security", "formatting", "conversion"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Environment :: Console",
|
|
19
|
+
"Intended Audience :: Developers",
|
|
20
|
+
"License :: OSI Approved :: MIT License",
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"Programming Language :: Python :: 3.11",
|
|
23
|
+
"Programming Language :: Python :: 3.12",
|
|
24
|
+
"Topic :: Software Development :: Build Tools",
|
|
25
|
+
"Topic :: Utilities"
|
|
26
|
+
]
|
|
27
|
+
dependencies = [
|
|
28
|
+
"typer==0.16.0",
|
|
29
|
+
"defusedxml==0.7.1"
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[project.optional-dependencies]
|
|
33
|
+
image = ["pillow==11.1.0"]
|
|
34
|
+
web = ["requests==2.32.4"]
|
|
35
|
+
xml = ["lxml==5.3.0"]
|
|
36
|
+
yaml = ["pyyaml==6.0.2"]
|
|
37
|
+
all = [
|
|
38
|
+
"pillow==11.1.0",
|
|
39
|
+
"requests==2.32.4",
|
|
40
|
+
"lxml==5.3.0",
|
|
41
|
+
"pyyaml==6.0.2"
|
|
42
|
+
]
|
|
43
|
+
dev = [
|
|
44
|
+
"black==24.10.0",
|
|
45
|
+
"ruff==0.9.6",
|
|
46
|
+
"mypy==1.14.1",
|
|
47
|
+
"pytest==8.3.4",
|
|
48
|
+
"pytest-cov==6.0.0",
|
|
49
|
+
"bandit==1.8.2",
|
|
50
|
+
"pip-audit==2.7.3",
|
|
51
|
+
"safety==3.2.14",
|
|
52
|
+
"types-requests==2.32.0.20241016"
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
[project.urls]
|
|
56
|
+
Homepage = "https://github.com/artenisalija/developer-utility-kit"
|
|
57
|
+
Repository = "https://github.com/artenisalija/developer-utility-kit"
|
|
58
|
+
Issues = "https://github.com/artenisalija/developer-utility-kit/issues"
|
|
59
|
+
|
|
60
|
+
[project.scripts]
|
|
61
|
+
toolkit = "toolkit.cli:app"
|
|
62
|
+
|
|
63
|
+
[tool.setuptools]
|
|
64
|
+
package-dir = {"" = "src"}
|
|
65
|
+
|
|
66
|
+
[tool.setuptools.packages.find]
|
|
67
|
+
where = ["src"]
|
|
68
|
+
|
|
69
|
+
[tool.black]
|
|
70
|
+
line-length = 100
|
|
71
|
+
target-version = ["py311", "py312"]
|
|
72
|
+
|
|
73
|
+
[tool.ruff]
|
|
74
|
+
line-length = 100
|
|
75
|
+
target-version = "py311"
|
|
76
|
+
|
|
77
|
+
[tool.ruff.lint]
|
|
78
|
+
select = ["E", "F", "I", "B", "UP", "S", "N"]
|
|
79
|
+
ignore = ["S603", "S607"]
|
|
80
|
+
|
|
81
|
+
[tool.ruff.lint.per-file-ignores]
|
|
82
|
+
"tests/*.py" = ["S101"]
|
|
83
|
+
|
|
84
|
+
[tool.mypy]
|
|
85
|
+
python_version = "3.11"
|
|
86
|
+
strict = true
|
|
87
|
+
warn_return_any = true
|
|
88
|
+
warn_unused_configs = true
|
|
89
|
+
disallow_untyped_defs = true
|
|
90
|
+
disallow_any_generics = true
|
|
91
|
+
no_implicit_optional = true
|
|
92
|
+
plugins = []
|
|
93
|
+
|
|
94
|
+
[tool.pytest.ini_options]
|
|
95
|
+
addopts = "--cov=toolkit --cov-report=term-missing --cov-fail-under=85"
|
|
96
|
+
testpaths = ["tests"]
|
|
97
|
+
|
|
98
|
+
[tool.bandit]
|
|
99
|
+
exclude_dirs = ["tests"]
|
|
100
|
+
skips = ["B101"]
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: developer-utility-toolkit
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Security-focused modular developer multi-tool CLI.
|
|
5
|
+
Author: Developer Utility Toolkit Contributors
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/artenisalija/developer-utility-kit
|
|
8
|
+
Project-URL: Repository, https://github.com/artenisalija/developer-utility-kit
|
|
9
|
+
Project-URL: Issues, https://github.com/artenisalija/developer-utility-kit/issues
|
|
10
|
+
Keywords: cli,developer-tools,security,formatting,conversion
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
19
|
+
Classifier: Topic :: Utilities
|
|
20
|
+
Requires-Python: >=3.11
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: typer==0.16.0
|
|
24
|
+
Requires-Dist: defusedxml==0.7.1
|
|
25
|
+
Provides-Extra: image
|
|
26
|
+
Requires-Dist: pillow==11.1.0; extra == "image"
|
|
27
|
+
Provides-Extra: web
|
|
28
|
+
Requires-Dist: requests==2.32.4; extra == "web"
|
|
29
|
+
Provides-Extra: xml
|
|
30
|
+
Requires-Dist: lxml==5.3.0; extra == "xml"
|
|
31
|
+
Provides-Extra: yaml
|
|
32
|
+
Requires-Dist: pyyaml==6.0.2; extra == "yaml"
|
|
33
|
+
Provides-Extra: all
|
|
34
|
+
Requires-Dist: pillow==11.1.0; extra == "all"
|
|
35
|
+
Requires-Dist: requests==2.32.4; extra == "all"
|
|
36
|
+
Requires-Dist: lxml==5.3.0; extra == "all"
|
|
37
|
+
Requires-Dist: pyyaml==6.0.2; extra == "all"
|
|
38
|
+
Provides-Extra: dev
|
|
39
|
+
Requires-Dist: black==24.10.0; extra == "dev"
|
|
40
|
+
Requires-Dist: ruff==0.9.6; extra == "dev"
|
|
41
|
+
Requires-Dist: mypy==1.14.1; extra == "dev"
|
|
42
|
+
Requires-Dist: pytest==8.3.4; extra == "dev"
|
|
43
|
+
Requires-Dist: pytest-cov==6.0.0; extra == "dev"
|
|
44
|
+
Requires-Dist: bandit==1.8.2; extra == "dev"
|
|
45
|
+
Requires-Dist: pip-audit==2.7.3; extra == "dev"
|
|
46
|
+
Requires-Dist: safety==3.2.14; extra == "dev"
|
|
47
|
+
Requires-Dist: types-requests==2.32.0.20241016; extra == "dev"
|
|
48
|
+
|
|
49
|
+
# Developer Utility Toolkit
|
|
50
|
+
|
|
51
|
+
[](https://github.com/artenisalija/developer-utility-kit/actions/workflows/ci.yml)
|
|
52
|
+
[](https://github.com/artenisalija/developer-utility-kit/actions/workflows/security.yml)
|
|
53
|
+
[](https://github.com/artenisalija/developer-utility-kit)
|
|
54
|
+
|
|
55
|
+
Security-focused, modular, format-aware Python CLI for common developer tasks.
|
|
56
|
+
|
|
57
|
+
## Features
|
|
58
|
+
|
|
59
|
+
- Automatic input detection for text, JSON, XML, Base64, URL, and file extension types
|
|
60
|
+
- Direct format conversion using a plugin-based transformer registry
|
|
61
|
+
- JSON and XML formatting, minification, and validation
|
|
62
|
+
- Encoding tools (Base64 and URL encode/decode)
|
|
63
|
+
- Image pixelation utility (optional `pillow`)
|
|
64
|
+
- Sitemap generator and sitemap fetcher with URL validation and request timeouts
|
|
65
|
+
- Local command history (`~/.developer_utility_toolkit/history/history.jsonl`)
|
|
66
|
+
|
|
67
|
+
## Architecture
|
|
68
|
+
|
|
69
|
+
- `src/toolkit/core`: abstractions, registry, detector, and safe I/O helpers
|
|
70
|
+
- `src/toolkit/transformers`: pluggable one-step transformers
|
|
71
|
+
- `src/toolkit/formatters`: JSON/XML format/minify/validate services
|
|
72
|
+
- `src/toolkit/image_tools`: image utilities
|
|
73
|
+
- `src/toolkit/web_tools`: sitemap generation/fetching
|
|
74
|
+
- `src/toolkit/history`: local history service
|
|
75
|
+
- `src/toolkit/cli.py`: Typer entrypoint and command wiring
|
|
76
|
+
|
|
77
|
+
Design choices:
|
|
78
|
+
- No chained transformations by default (one direct transform per request target)
|
|
79
|
+
- Safe XML parsing via `defusedxml`
|
|
80
|
+
- Controlled output writes via sanitized filename + output directory constraints
|
|
81
|
+
- Clear failure modes with explicit non-zero exit codes
|
|
82
|
+
|
|
83
|
+
## Installation
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
python -m pip install --upgrade pip
|
|
87
|
+
pip install .
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Install all optional features:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
pip install ".[all]"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Install directly from GitHub:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
pip install "git+https://github.com/artenisalija/developer-utility-kit.git"
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Install a specific version tag (recommended):
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
pip install "git+https://github.com/artenisalija/developer-utility-kit.git@v0.1.1"
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Install from GitHub with all extras:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
pip install "developer-utility-toolkit[all] @ git+https://github.com/artenisalija/developer-utility-kit.git@v0.1.1"
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Install developer tooling:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
pip install ".[all,dev]"
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Usage
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
toolkit analyze --text '{"name":"dev"}'
|
|
124
|
+
toolkit convert --from text --to base64 --text "hello"
|
|
125
|
+
toolkit format --kind json --text '{"b":2,"a":1}'
|
|
126
|
+
toolkit validate --kind xml --text '<root><a>1</a></root>'
|
|
127
|
+
toolkit minify --kind json --text '{"b":2,"a":1}'
|
|
128
|
+
toolkit image pixelate --input-file ./input.png --output-name output.png
|
|
129
|
+
toolkit sitemap generate --base-url https://example.com --path / --path /docs
|
|
130
|
+
toolkit sitemap fetch --url https://example.com/sitemap.xml
|
|
131
|
+
toolkit recent show --limit 10
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Security Philosophy
|
|
135
|
+
|
|
136
|
+
- Secure defaults and explicit input validation
|
|
137
|
+
- Defused XML parser to prevent XXE/entity expansion attacks
|
|
138
|
+
- No `eval`/`exec` usage
|
|
139
|
+
- Timeout-controlled network calls
|
|
140
|
+
- Sanitized output file names with constrained output directories
|
|
141
|
+
- Graceful errors with explicit status codes
|
|
142
|
+
|
|
143
|
+
## Development
|
|
144
|
+
|
|
145
|
+
Run local quality gates:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
ruff check .
|
|
149
|
+
black --check .
|
|
150
|
+
mypy src tests
|
|
151
|
+
pytest
|
|
152
|
+
bandit -r src -ll
|
|
153
|
+
pip-audit --strict
|
|
154
|
+
safety check --full-report
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Pre-commit:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
pre-commit install
|
|
161
|
+
pre-commit run --all-files
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## CI/CD
|
|
165
|
+
|
|
166
|
+
- `ci.yml`: lint + format + mypy + tests + coverage (>=85%) on Python 3.11/3.12
|
|
167
|
+
- `security.yml`: Bandit + pip-audit + Safety
|
|
168
|
+
- `release.yml`: runs on version tags (`v*.*.*`), builds wheel/sdist, runs tests, publishes to PyPI, creates GitHub release notes
|
|
169
|
+
- Dependabot enabled for Python packages and GitHub Actions
|
|
170
|
+
|
|
171
|
+
## Publishing to PyPI
|
|
172
|
+
|
|
173
|
+
1. Create a PyPI API token.
|
|
174
|
+
2. Add `PYPI_API_TOKEN` in GitHub repository secrets.
|
|
175
|
+
3. Bump version in `pyproject.toml`.
|
|
176
|
+
4. Tag and push:
|
|
177
|
+
```bash
|
|
178
|
+
git tag v0.1.1
|
|
179
|
+
git push origin v0.1.1
|
|
180
|
+
```
|
|
181
|
+
5. GitHub Action `release.yml` publishes automatically.
|
|
182
|
+
|
|
183
|
+
## Build Standalone Executable
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
pip install pyinstaller
|
|
187
|
+
pyinstaller --onefile --name toolkit src/toolkit/cli.py
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
The executable will be available under `dist/`.
|
|
191
|
+
|
|
192
|
+
## Contribution Guidelines
|
|
193
|
+
|
|
194
|
+
1. Create a branch for your change.
|
|
195
|
+
2. Add or update tests.
|
|
196
|
+
3. Run all local quality checks and security scans.
|
|
197
|
+
4. Open a pull request with rationale and risk notes.
|