peasy-convert 0.1.0__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.
- peasy_convert-0.1.0/.gitignore +9 -0
- peasy_convert-0.1.0/PKG-INFO +215 -0
- peasy_convert-0.1.0/README.md +172 -0
- peasy_convert-0.1.0/pyproject.toml +62 -0
- peasy_convert-0.1.0/src/peasy_convert/__init__.py +3 -0
- peasy_convert-0.1.0/src/peasy_convert/cli.py +115 -0
- peasy_convert-0.1.0/src/peasy_convert/py.typed +0 -0
- peasy_convert-0.1.0/tests/test_cli.py +53 -0
- peasy_convert-0.1.0/uv.lock +596 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: peasy-convert
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Unified CLI for all Peasy tools — PDF, image, text, and CSS utilities in one command.
|
|
5
|
+
Project-URL: Homepage, https://peasytools.com
|
|
6
|
+
Project-URL: Repository, https://github.com/peasytools/peasy-convert
|
|
7
|
+
Project-URL: Issues, https://github.com/peasytools/peasy-convert/issues
|
|
8
|
+
Author: Peasy Tools
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
Keywords: cli,converter,css,image,pdf,peasy,text
|
|
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.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
22
|
+
Classifier: Topic :: Utilities
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Requires-Dist: typer>=0.9
|
|
25
|
+
Provides-Extra: all
|
|
26
|
+
Requires-Dist: peasy-css>=0.1; extra == 'all'
|
|
27
|
+
Requires-Dist: peasy-image>=0.1; extra == 'all'
|
|
28
|
+
Requires-Dist: peasy-pdf>=0.1; extra == 'all'
|
|
29
|
+
Requires-Dist: peasytext>=0.1; extra == 'all'
|
|
30
|
+
Provides-Extra: css
|
|
31
|
+
Requires-Dist: peasy-css>=0.1; extra == 'css'
|
|
32
|
+
Provides-Extra: dev
|
|
33
|
+
Requires-Dist: mypy>=1.10; extra == 'dev'
|
|
34
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
35
|
+
Requires-Dist: ruff>=0.4; extra == 'dev'
|
|
36
|
+
Provides-Extra: image
|
|
37
|
+
Requires-Dist: peasy-image>=0.1; extra == 'image'
|
|
38
|
+
Provides-Extra: pdf
|
|
39
|
+
Requires-Dist: peasy-pdf>=0.1; extra == 'pdf'
|
|
40
|
+
Provides-Extra: text
|
|
41
|
+
Requires-Dist: peasytext>=0.1; extra == 'text'
|
|
42
|
+
Description-Content-Type: text/markdown
|
|
43
|
+
|
|
44
|
+
# peasy-convert
|
|
45
|
+
|
|
46
|
+
[](https://pypi.org/project/peasy-convert/)
|
|
47
|
+
[](https://pypi.org/project/peasy-convert/)
|
|
48
|
+
[](https://opensource.org/licenses/MIT)
|
|
49
|
+
|
|
50
|
+
Unified CLI for all Peasy tools — PDF, image, text, and CSS utilities in one `peasy` command. Install only what you need with optional extras.
|
|
51
|
+
|
|
52
|
+
Built from [Peasy Tools](https://peasytools.com), the platform with 255 free browser-based developer tools across 15 categories.
|
|
53
|
+
|
|
54
|
+
> **Try the interactive tools at [peasytools.com](https://peasytools.com)** — [PDF Tools](https://peasypdf.com), [Image Tools](https://peasyimage.com), [Text Tools](https://peasytext.com), [CSS Tools](https://peasycss.com)
|
|
55
|
+
|
|
56
|
+
## Table of Contents
|
|
57
|
+
|
|
58
|
+
- [Install](#install)
|
|
59
|
+
- [Quick Start](#quick-start)
|
|
60
|
+
- [Available Tool Suites](#available-tool-suites)
|
|
61
|
+
- [PDF Tools](#pdf-tools)
|
|
62
|
+
- [Image Tools](#image-tools)
|
|
63
|
+
- [Text Tools](#text-tools)
|
|
64
|
+
- [CSS Tools](#css-tools)
|
|
65
|
+
- [Info Command](#info-command)
|
|
66
|
+
- [Peasy Developer Tools](#peasy-developer-tools)
|
|
67
|
+
- [License](#license)
|
|
68
|
+
|
|
69
|
+
## Install
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# Install with all tools
|
|
73
|
+
pip install "peasy-convert[all]"
|
|
74
|
+
|
|
75
|
+
# Install specific tool suites only
|
|
76
|
+
pip install "peasy-convert[pdf]" # PDF tools
|
|
77
|
+
pip install "peasy-convert[image]" # Image tools
|
|
78
|
+
pip install "peasy-convert[text]" # Text tools
|
|
79
|
+
pip install "peasy-convert[css]" # CSS tools
|
|
80
|
+
|
|
81
|
+
# Mix and match
|
|
82
|
+
pip install "peasy-convert[pdf,image]"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Quick Start
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# PDF operations
|
|
89
|
+
peasy pdf merge file1.pdf file2.pdf -o combined.pdf
|
|
90
|
+
peasy pdf split document.pdf --pages 1-5 -o section.pdf
|
|
91
|
+
peasy pdf compress large.pdf -o smaller.pdf
|
|
92
|
+
|
|
93
|
+
# Image operations
|
|
94
|
+
peasy image resize photo.png --width 800 -o thumb.png
|
|
95
|
+
peasy image convert photo.png --format webp -o photo.webp
|
|
96
|
+
peasy image grayscale color.jpg -o bw.jpg
|
|
97
|
+
|
|
98
|
+
# Text operations
|
|
99
|
+
peasy text reverse "Hello World"
|
|
100
|
+
peasy text hash "password123" --algorithm sha256
|
|
101
|
+
|
|
102
|
+
# CSS generation
|
|
103
|
+
peasy css gradient --colors "#ff6b35" "#f7c948" "#2ec4b6"
|
|
104
|
+
peasy css shadow --y 4px --blur 12px --color "rgba(0,0,0,0.15)"
|
|
105
|
+
peasy css flexbox --justify center --align center --gap 1rem
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Available Tool Suites
|
|
109
|
+
|
|
110
|
+
### PDF Tools
|
|
111
|
+
|
|
112
|
+
Install: `pip install "peasy-convert[pdf]"`
|
|
113
|
+
|
|
114
|
+
Powered by [peasy-pdf](https://pypi.org/project/peasy-pdf/) — PDF manipulation with pypdf.
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
peasy pdf merge a.pdf b.pdf -o merged.pdf # Merge multiple PDFs
|
|
118
|
+
peasy pdf split doc.pdf --pages 1-5 -o out.pdf # Extract page range
|
|
119
|
+
peasy pdf compress big.pdf -o small.pdf # Reduce file size
|
|
120
|
+
peasy pdf rotate doc.pdf --degrees 90 -o r.pdf # Rotate pages
|
|
121
|
+
peasy pdf info document.pdf # Show PDF metadata
|
|
122
|
+
peasy pdf text document.pdf # Extract text content
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Learn more: [PeasyPDF](https://peasypdf.com) · [peasy-pdf on PyPI](https://pypi.org/project/peasy-pdf/)
|
|
126
|
+
|
|
127
|
+
### Image Tools
|
|
128
|
+
|
|
129
|
+
Install: `pip install "peasy-convert[image]"`
|
|
130
|
+
|
|
131
|
+
Powered by [peasy-image](https://pypi.org/project/peasy-image/) — image processing with Pillow.
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
peasy image resize photo.png --width 800 # Resize by width
|
|
135
|
+
peasy image crop img.png --left 10 --top 10 ... # Crop region
|
|
136
|
+
peasy image convert photo.png --format webp # Format conversion
|
|
137
|
+
peasy image compress photo.jpg --quality 75 # JPEG compression
|
|
138
|
+
peasy image grayscale color.jpg -o bw.jpg # Convert to grayscale
|
|
139
|
+
peasy image blur photo.png --radius 5 -o blur.png # Apply Gaussian blur
|
|
140
|
+
peasy image info photo.jpg # Show image metadata
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Learn more: [PeasyImage](https://peasyimage.com) · [peasy-image on PyPI](https://pypi.org/project/peasy-image/)
|
|
144
|
+
|
|
145
|
+
### Text Tools
|
|
146
|
+
|
|
147
|
+
Install: `pip install "peasy-convert[text]"`
|
|
148
|
+
|
|
149
|
+
Powered by [peasytext](https://pypi.org/project/peasytext/) — text analysis and transformation.
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
peasy text case "hello world" --to upper # Case conversion
|
|
153
|
+
peasy text slug "Hello World! 2024" # URL slug generation
|
|
154
|
+
peasy text count "Lorem ipsum dolor sit amet" # Word/char/sentence count
|
|
155
|
+
peasy text hash "input" --algorithm sha256 # Cryptographic hashing
|
|
156
|
+
peasy text reverse "Hello World" # Reverse text
|
|
157
|
+
peasy text base64-encode "Hello World" # Base64 encoding
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Learn more: [PeasyText](https://peasytext.com) · [peasytext on PyPI](https://pypi.org/project/peasytext/)
|
|
161
|
+
|
|
162
|
+
### CSS Tools
|
|
163
|
+
|
|
164
|
+
Install: `pip install "peasy-convert[css]"`
|
|
165
|
+
|
|
166
|
+
Powered by [peasy-css](https://pypi.org/project/peasy-css/) — CSS code generation (zero dependencies).
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
peasy css gradient --colors "#ff6b35" "#f7c948" # Linear gradient
|
|
170
|
+
peasy css shadow --y 4px --blur 12px # Box shadow
|
|
171
|
+
peasy css flexbox --justify center --align center # Flexbox layout
|
|
172
|
+
peasy css grid --columns "repeat(3, 1fr)" --gap 2rem # CSS Grid
|
|
173
|
+
peasy css glass --blur 20px # Glassmorphism
|
|
174
|
+
peasy css border-radius --all 8px # Border radius
|
|
175
|
+
peasy css clamp --min 1rem --preferred 2.5vw --max 3rem # Fluid sizing
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Learn more: [PeasyCSS](https://peasycss.com) · [peasy-css on PyPI](https://pypi.org/project/peasy-css/)
|
|
179
|
+
|
|
180
|
+
## Info Command
|
|
181
|
+
|
|
182
|
+
Check which tool suites are installed:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
peasy info
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Output:
|
|
189
|
+
```
|
|
190
|
+
Peasy Convert — Installed packages:
|
|
191
|
+
|
|
192
|
+
peasy-convert 0.1.0
|
|
193
|
+
peasy-pdf 0.1.0
|
|
194
|
+
peasy-image 0.1.0
|
|
195
|
+
peasytext 0.1.0
|
|
196
|
+
peasy-css 0.1.0
|
|
197
|
+
|
|
198
|
+
Install extras: pip install 'peasy-convert[all]'
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Peasy Developer Tools
|
|
202
|
+
|
|
203
|
+
| Package | PyPI | npm | Description |
|
|
204
|
+
|---------|------|-----|-------------|
|
|
205
|
+
| peasytext | [PyPI](https://pypi.org/project/peasytext/) | [npm](https://www.npmjs.com/package/peasytext) | Text analysis — case, encoding, hashing, diff |
|
|
206
|
+
| peasy-pdf | [PyPI](https://pypi.org/project/peasy-pdf/) | — | PDF processing — merge, split, compress, rotate |
|
|
207
|
+
| peasy-image | [PyPI](https://pypi.org/project/peasy-image/) | — | Image ops — resize, crop, convert, filter |
|
|
208
|
+
| peasy-css | [PyPI](https://pypi.org/project/peasy-css/) | [npm](https://www.npmjs.com/package/peasy-css) | CSS generation — gradients, shadows, flexbox, grid |
|
|
209
|
+
| **peasy-convert** | **[PyPI](https://pypi.org/project/peasy-convert/)** | — | **Unified CLI — all tools in one command** |
|
|
210
|
+
|
|
211
|
+
Part of the [Peasy](https://peasytools.com) developer tools ecosystem — 255 free tools across 15 categories.
|
|
212
|
+
|
|
213
|
+
## License
|
|
214
|
+
|
|
215
|
+
MIT
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# peasy-convert
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/peasy-convert/)
|
|
4
|
+
[](https://pypi.org/project/peasy-convert/)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
|
|
7
|
+
Unified CLI for all Peasy tools — PDF, image, text, and CSS utilities in one `peasy` command. Install only what you need with optional extras.
|
|
8
|
+
|
|
9
|
+
Built from [Peasy Tools](https://peasytools.com), the platform with 255 free browser-based developer tools across 15 categories.
|
|
10
|
+
|
|
11
|
+
> **Try the interactive tools at [peasytools.com](https://peasytools.com)** — [PDF Tools](https://peasypdf.com), [Image Tools](https://peasyimage.com), [Text Tools](https://peasytext.com), [CSS Tools](https://peasycss.com)
|
|
12
|
+
|
|
13
|
+
## Table of Contents
|
|
14
|
+
|
|
15
|
+
- [Install](#install)
|
|
16
|
+
- [Quick Start](#quick-start)
|
|
17
|
+
- [Available Tool Suites](#available-tool-suites)
|
|
18
|
+
- [PDF Tools](#pdf-tools)
|
|
19
|
+
- [Image Tools](#image-tools)
|
|
20
|
+
- [Text Tools](#text-tools)
|
|
21
|
+
- [CSS Tools](#css-tools)
|
|
22
|
+
- [Info Command](#info-command)
|
|
23
|
+
- [Peasy Developer Tools](#peasy-developer-tools)
|
|
24
|
+
- [License](#license)
|
|
25
|
+
|
|
26
|
+
## Install
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# Install with all tools
|
|
30
|
+
pip install "peasy-convert[all]"
|
|
31
|
+
|
|
32
|
+
# Install specific tool suites only
|
|
33
|
+
pip install "peasy-convert[pdf]" # PDF tools
|
|
34
|
+
pip install "peasy-convert[image]" # Image tools
|
|
35
|
+
pip install "peasy-convert[text]" # Text tools
|
|
36
|
+
pip install "peasy-convert[css]" # CSS tools
|
|
37
|
+
|
|
38
|
+
# Mix and match
|
|
39
|
+
pip install "peasy-convert[pdf,image]"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Quick Start
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# PDF operations
|
|
46
|
+
peasy pdf merge file1.pdf file2.pdf -o combined.pdf
|
|
47
|
+
peasy pdf split document.pdf --pages 1-5 -o section.pdf
|
|
48
|
+
peasy pdf compress large.pdf -o smaller.pdf
|
|
49
|
+
|
|
50
|
+
# Image operations
|
|
51
|
+
peasy image resize photo.png --width 800 -o thumb.png
|
|
52
|
+
peasy image convert photo.png --format webp -o photo.webp
|
|
53
|
+
peasy image grayscale color.jpg -o bw.jpg
|
|
54
|
+
|
|
55
|
+
# Text operations
|
|
56
|
+
peasy text reverse "Hello World"
|
|
57
|
+
peasy text hash "password123" --algorithm sha256
|
|
58
|
+
|
|
59
|
+
# CSS generation
|
|
60
|
+
peasy css gradient --colors "#ff6b35" "#f7c948" "#2ec4b6"
|
|
61
|
+
peasy css shadow --y 4px --blur 12px --color "rgba(0,0,0,0.15)"
|
|
62
|
+
peasy css flexbox --justify center --align center --gap 1rem
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Available Tool Suites
|
|
66
|
+
|
|
67
|
+
### PDF Tools
|
|
68
|
+
|
|
69
|
+
Install: `pip install "peasy-convert[pdf]"`
|
|
70
|
+
|
|
71
|
+
Powered by [peasy-pdf](https://pypi.org/project/peasy-pdf/) — PDF manipulation with pypdf.
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
peasy pdf merge a.pdf b.pdf -o merged.pdf # Merge multiple PDFs
|
|
75
|
+
peasy pdf split doc.pdf --pages 1-5 -o out.pdf # Extract page range
|
|
76
|
+
peasy pdf compress big.pdf -o small.pdf # Reduce file size
|
|
77
|
+
peasy pdf rotate doc.pdf --degrees 90 -o r.pdf # Rotate pages
|
|
78
|
+
peasy pdf info document.pdf # Show PDF metadata
|
|
79
|
+
peasy pdf text document.pdf # Extract text content
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Learn more: [PeasyPDF](https://peasypdf.com) · [peasy-pdf on PyPI](https://pypi.org/project/peasy-pdf/)
|
|
83
|
+
|
|
84
|
+
### Image Tools
|
|
85
|
+
|
|
86
|
+
Install: `pip install "peasy-convert[image]"`
|
|
87
|
+
|
|
88
|
+
Powered by [peasy-image](https://pypi.org/project/peasy-image/) — image processing with Pillow.
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
peasy image resize photo.png --width 800 # Resize by width
|
|
92
|
+
peasy image crop img.png --left 10 --top 10 ... # Crop region
|
|
93
|
+
peasy image convert photo.png --format webp # Format conversion
|
|
94
|
+
peasy image compress photo.jpg --quality 75 # JPEG compression
|
|
95
|
+
peasy image grayscale color.jpg -o bw.jpg # Convert to grayscale
|
|
96
|
+
peasy image blur photo.png --radius 5 -o blur.png # Apply Gaussian blur
|
|
97
|
+
peasy image info photo.jpg # Show image metadata
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Learn more: [PeasyImage](https://peasyimage.com) · [peasy-image on PyPI](https://pypi.org/project/peasy-image/)
|
|
101
|
+
|
|
102
|
+
### Text Tools
|
|
103
|
+
|
|
104
|
+
Install: `pip install "peasy-convert[text]"`
|
|
105
|
+
|
|
106
|
+
Powered by [peasytext](https://pypi.org/project/peasytext/) — text analysis and transformation.
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
peasy text case "hello world" --to upper # Case conversion
|
|
110
|
+
peasy text slug "Hello World! 2024" # URL slug generation
|
|
111
|
+
peasy text count "Lorem ipsum dolor sit amet" # Word/char/sentence count
|
|
112
|
+
peasy text hash "input" --algorithm sha256 # Cryptographic hashing
|
|
113
|
+
peasy text reverse "Hello World" # Reverse text
|
|
114
|
+
peasy text base64-encode "Hello World" # Base64 encoding
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Learn more: [PeasyText](https://peasytext.com) · [peasytext on PyPI](https://pypi.org/project/peasytext/)
|
|
118
|
+
|
|
119
|
+
### CSS Tools
|
|
120
|
+
|
|
121
|
+
Install: `pip install "peasy-convert[css]"`
|
|
122
|
+
|
|
123
|
+
Powered by [peasy-css](https://pypi.org/project/peasy-css/) — CSS code generation (zero dependencies).
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
peasy css gradient --colors "#ff6b35" "#f7c948" # Linear gradient
|
|
127
|
+
peasy css shadow --y 4px --blur 12px # Box shadow
|
|
128
|
+
peasy css flexbox --justify center --align center # Flexbox layout
|
|
129
|
+
peasy css grid --columns "repeat(3, 1fr)" --gap 2rem # CSS Grid
|
|
130
|
+
peasy css glass --blur 20px # Glassmorphism
|
|
131
|
+
peasy css border-radius --all 8px # Border radius
|
|
132
|
+
peasy css clamp --min 1rem --preferred 2.5vw --max 3rem # Fluid sizing
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Learn more: [PeasyCSS](https://peasycss.com) · [peasy-css on PyPI](https://pypi.org/project/peasy-css/)
|
|
136
|
+
|
|
137
|
+
## Info Command
|
|
138
|
+
|
|
139
|
+
Check which tool suites are installed:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
peasy info
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Output:
|
|
146
|
+
```
|
|
147
|
+
Peasy Convert — Installed packages:
|
|
148
|
+
|
|
149
|
+
peasy-convert 0.1.0
|
|
150
|
+
peasy-pdf 0.1.0
|
|
151
|
+
peasy-image 0.1.0
|
|
152
|
+
peasytext 0.1.0
|
|
153
|
+
peasy-css 0.1.0
|
|
154
|
+
|
|
155
|
+
Install extras: pip install 'peasy-convert[all]'
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Peasy Developer Tools
|
|
159
|
+
|
|
160
|
+
| Package | PyPI | npm | Description |
|
|
161
|
+
|---------|------|-----|-------------|
|
|
162
|
+
| peasytext | [PyPI](https://pypi.org/project/peasytext/) | [npm](https://www.npmjs.com/package/peasytext) | Text analysis — case, encoding, hashing, diff |
|
|
163
|
+
| peasy-pdf | [PyPI](https://pypi.org/project/peasy-pdf/) | — | PDF processing — merge, split, compress, rotate |
|
|
164
|
+
| peasy-image | [PyPI](https://pypi.org/project/peasy-image/) | — | Image ops — resize, crop, convert, filter |
|
|
165
|
+
| peasy-css | [PyPI](https://pypi.org/project/peasy-css/) | [npm](https://www.npmjs.com/package/peasy-css) | CSS generation — gradients, shadows, flexbox, grid |
|
|
166
|
+
| **peasy-convert** | **[PyPI](https://pypi.org/project/peasy-convert/)** | — | **Unified CLI — all tools in one command** |
|
|
167
|
+
|
|
168
|
+
Part of the [Peasy](https://peasytools.com) developer tools ecosystem — 255 free tools across 15 categories.
|
|
169
|
+
|
|
170
|
+
## License
|
|
171
|
+
|
|
172
|
+
MIT
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "peasy-convert"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Unified CLI for all Peasy tools — PDF, image, text, and CSS utilities in one command."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
|
+
authors = [{ name = "Peasy Tools" }]
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Development Status :: 4 - Beta",
|
|
15
|
+
"Environment :: Console",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
"License :: OSI Approved :: MIT License",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3.10",
|
|
20
|
+
"Programming Language :: Python :: 3.11",
|
|
21
|
+
"Programming Language :: Python :: 3.12",
|
|
22
|
+
"Programming Language :: Python :: 3.13",
|
|
23
|
+
"Programming Language :: Python :: 3.14",
|
|
24
|
+
"Topic :: Software Development :: Libraries",
|
|
25
|
+
"Topic :: Utilities",
|
|
26
|
+
]
|
|
27
|
+
keywords = ["cli", "converter", "pdf", "image", "text", "css", "peasy"]
|
|
28
|
+
dependencies = ["typer>=0.9"]
|
|
29
|
+
|
|
30
|
+
[project.optional-dependencies]
|
|
31
|
+
pdf = ["peasy-pdf>=0.1"]
|
|
32
|
+
image = ["peasy-image>=0.1"]
|
|
33
|
+
text = ["peasytext>=0.1"]
|
|
34
|
+
css = ["peasy-css>=0.1"]
|
|
35
|
+
all = [
|
|
36
|
+
"peasy-pdf>=0.1",
|
|
37
|
+
"peasy-image>=0.1",
|
|
38
|
+
"peasytext>=0.1",
|
|
39
|
+
"peasy-css>=0.1",
|
|
40
|
+
]
|
|
41
|
+
dev = ["mypy>=1.10", "pytest>=8.0", "ruff>=0.4"]
|
|
42
|
+
|
|
43
|
+
[project.scripts]
|
|
44
|
+
peasy = "peasy_convert.cli:app"
|
|
45
|
+
|
|
46
|
+
[project.urls]
|
|
47
|
+
Homepage = "https://peasytools.com"
|
|
48
|
+
Repository = "https://github.com/peasytools/peasy-convert"
|
|
49
|
+
Issues = "https://github.com/peasytools/peasy-convert/issues"
|
|
50
|
+
|
|
51
|
+
[tool.hatch.build.targets.wheel]
|
|
52
|
+
packages = ["src/peasy_convert"]
|
|
53
|
+
|
|
54
|
+
[tool.ruff]
|
|
55
|
+
line-length = 100
|
|
56
|
+
target-version = "py310"
|
|
57
|
+
|
|
58
|
+
[tool.ruff.lint]
|
|
59
|
+
select = ["E", "F", "W", "I", "B", "UP", "RUF"]
|
|
60
|
+
|
|
61
|
+
[tool.pytest.ini_options]
|
|
62
|
+
testpaths = ["tests"]
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"""peasy-convert CLI — Unified entry point for all Peasy tools.
|
|
2
|
+
|
|
3
|
+
Usage::
|
|
4
|
+
|
|
5
|
+
peasy pdf merge file1.pdf file2.pdf -o merged.pdf
|
|
6
|
+
peasy image resize input.png --width 800 -o output.png
|
|
7
|
+
peasy text reverse "Hello World"
|
|
8
|
+
peasy css gradient --colors "#ff6b35" "#2ec4b6"
|
|
9
|
+
peasy --version
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from __future__ import annotations
|
|
13
|
+
|
|
14
|
+
import typer
|
|
15
|
+
|
|
16
|
+
app = typer.Typer(
|
|
17
|
+
name="peasy",
|
|
18
|
+
help="Unified CLI for Peasy tools — PDF, image, text, and CSS utilities.",
|
|
19
|
+
no_args_is_help=True,
|
|
20
|
+
pretty_exceptions_enable=False,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _version_callback(value: bool) -> None:
|
|
25
|
+
if value:
|
|
26
|
+
from peasy_convert import __version__
|
|
27
|
+
|
|
28
|
+
typer.echo(f"peasy-convert {__version__}")
|
|
29
|
+
raise typer.Exit
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@app.callback()
|
|
33
|
+
def main(
|
|
34
|
+
version: bool = typer.Option(
|
|
35
|
+
False,
|
|
36
|
+
"--version",
|
|
37
|
+
"-V",
|
|
38
|
+
help="Show version and exit.",
|
|
39
|
+
callback=_version_callback,
|
|
40
|
+
is_eager=True,
|
|
41
|
+
),
|
|
42
|
+
) -> None:
|
|
43
|
+
"""Peasy — All your file & text tools in one CLI."""
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
# ── Mount sub-commands from installed packages ──────────────────
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def _register_pdf() -> None:
|
|
50
|
+
try:
|
|
51
|
+
from peasy_pdf.cli import app as pdf_app
|
|
52
|
+
|
|
53
|
+
app.add_typer(pdf_app, name="pdf", help="PDF tools — merge, split, compress, rotate.")
|
|
54
|
+
except ImportError:
|
|
55
|
+
pass
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def _register_image() -> None:
|
|
59
|
+
try:
|
|
60
|
+
from peasy_image.cli import app as image_app
|
|
61
|
+
|
|
62
|
+
app.add_typer(image_app, name="image", help="Image tools — resize, crop, convert, filter.")
|
|
63
|
+
except ImportError:
|
|
64
|
+
pass
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def _register_text() -> None:
|
|
68
|
+
try:
|
|
69
|
+
from peasytext.cli import app as text_app
|
|
70
|
+
|
|
71
|
+
app.add_typer(text_app, name="text", help="Text tools — case, encode, hash, diff.")
|
|
72
|
+
except ImportError:
|
|
73
|
+
pass
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def _register_css() -> None:
|
|
77
|
+
try:
|
|
78
|
+
from peasy_css.cli import app as css_app
|
|
79
|
+
|
|
80
|
+
app.add_typer(css_app, name="css", help="CSS tools — gradient, shadow, flexbox, grid.")
|
|
81
|
+
except ImportError:
|
|
82
|
+
pass
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
_register_pdf()
|
|
86
|
+
_register_image()
|
|
87
|
+
_register_text()
|
|
88
|
+
_register_css()
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
@app.command()
|
|
92
|
+
def info() -> None:
|
|
93
|
+
"""Show installed Peasy packages and versions."""
|
|
94
|
+
packages = [
|
|
95
|
+
("peasy-pdf", "peasy_pdf"),
|
|
96
|
+
("peasy-image", "peasy_image"),
|
|
97
|
+
("peasytext", "peasytext"),
|
|
98
|
+
("peasy-css", "peasy_css"),
|
|
99
|
+
]
|
|
100
|
+
|
|
101
|
+
typer.echo("Peasy Convert — Installed packages:\n")
|
|
102
|
+
|
|
103
|
+
from peasy_convert import __version__
|
|
104
|
+
|
|
105
|
+
typer.echo(f" peasy-convert {__version__}")
|
|
106
|
+
|
|
107
|
+
for display_name, module_name in packages:
|
|
108
|
+
try:
|
|
109
|
+
mod = __import__(module_name)
|
|
110
|
+
version = getattr(mod, "__version__", "?")
|
|
111
|
+
typer.echo(f" {display_name:<14} {version}")
|
|
112
|
+
except ImportError:
|
|
113
|
+
typer.echo(f" {display_name:<14} (not installed)")
|
|
114
|
+
|
|
115
|
+
typer.echo("\nInstall extras: pip install 'peasy-convert[all]'")
|
|
File without changes
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"""Tests for peasy-convert CLI."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typer.testing import CliRunner
|
|
6
|
+
|
|
7
|
+
from peasy_convert.cli import app
|
|
8
|
+
|
|
9
|
+
runner = CliRunner()
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class TestMain:
|
|
13
|
+
def test_version(self) -> None:
|
|
14
|
+
result = runner.invoke(app, ["--version"])
|
|
15
|
+
assert result.exit_code == 0
|
|
16
|
+
assert "peasy-convert" in result.output
|
|
17
|
+
|
|
18
|
+
def test_no_args_shows_help(self) -> None:
|
|
19
|
+
result = runner.invoke(app, [])
|
|
20
|
+
assert "Peasy" in result.output or "Usage" in result.output
|
|
21
|
+
|
|
22
|
+
def test_info(self) -> None:
|
|
23
|
+
result = runner.invoke(app, ["info"])
|
|
24
|
+
assert result.exit_code == 0
|
|
25
|
+
assert "peasy-convert" in result.output
|
|
26
|
+
|
|
27
|
+
def test_info_shows_packages(self) -> None:
|
|
28
|
+
result = runner.invoke(app, ["info"])
|
|
29
|
+
assert result.exit_code == 0
|
|
30
|
+
# Should list all 4 package names
|
|
31
|
+
assert "peasy-pdf" in result.output
|
|
32
|
+
assert "peasy-image" in result.output
|
|
33
|
+
assert "peasytext" in result.output
|
|
34
|
+
assert "peasy-css" in result.output
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class TestSubCommands:
|
|
38
|
+
def test_css_subcommand_registered(self) -> None:
|
|
39
|
+
result = runner.invoke(app, ["css", "--help"])
|
|
40
|
+
# If peasy-css is installed, this should work
|
|
41
|
+
assert result.exit_code == 0
|
|
42
|
+
|
|
43
|
+
def test_pdf_subcommand_registered(self) -> None:
|
|
44
|
+
result = runner.invoke(app, ["pdf", "--help"])
|
|
45
|
+
assert result.exit_code == 0
|
|
46
|
+
|
|
47
|
+
def test_text_subcommand_registered(self) -> None:
|
|
48
|
+
result = runner.invoke(app, ["text", "--help"])
|
|
49
|
+
assert result.exit_code == 0
|
|
50
|
+
|
|
51
|
+
def test_image_subcommand_registered(self) -> None:
|
|
52
|
+
result = runner.invoke(app, ["image", "--help"])
|
|
53
|
+
assert result.exit_code == 0
|