pyvegh 0.7.0__cp310-abi3-win_amd64.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.
- pyvegh-0.7.0.dist-info/METADATA +241 -0
- pyvegh-0.7.0.dist-info/RECORD +9 -0
- pyvegh-0.7.0.dist-info/WHEEL +4 -0
- pyvegh-0.7.0.dist-info/entry_points.txt +3 -0
- pyvegh-0.7.0.dist-info/licenses/LICENSE +21 -0
- vegh/__init__.py +24 -0
- vegh/_core.pyd +0 -0
- vegh/analytics.py +621 -0
- vegh/cli.py +1588 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pyvegh
|
|
3
|
+
Version: 0.7.0
|
|
4
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
5
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
6
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
7
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
10
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
11
|
+
Classifier: Programming Language :: Rust
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
15
|
+
Classifier: Topic :: Utilities
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
18
|
+
Requires-Dist: typer>=0.20.0
|
|
19
|
+
Requires-Dist: rich>=14.2.0
|
|
20
|
+
Requires-Dist: shellingham>=1.5.4
|
|
21
|
+
Requires-Dist: requests>=2.32.5
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Summary: Python bindings for Vegh - The Snapshot Tool.
|
|
24
|
+
Keywords: snapshot,backup,rust,binding,loc,analytics
|
|
25
|
+
Author: CodeTease
|
|
26
|
+
Requires-Python: >=3.10
|
|
27
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
28
|
+
|
|
29
|
+
# 🥬 PyVegh
|
|
30
|
+
|
|
31
|
+
**PyVegh** is the official Python binding for the Vegh snapshot engine, developed by **CodeTease**.
|
|
32
|
+
|
|
33
|
+
It delivers the raw performance of Rust (Zstd multithreaded compression, Tar archiving, Blake3 hashing) wrapped in a modern, flexible Python interface.
|
|
34
|
+
|
|
35
|
+
> "Tight packing, swift unpacking, no nonsense."
|
|
36
|
+
|
|
37
|
+
## Features
|
|
38
|
+
|
|
39
|
+
* **Blazing Fast:** Core logic is implemented in Rust using PyO3, utilizing **Zstd Multithreading** and the next-gen **Blake3** hashing algorithm.
|
|
40
|
+
* **AI-Ready Context:** Generate clean, token-optimized XML prompts for ChatGPT/Claude in milliseconds.
|
|
41
|
+
* **Analytics Dashboard:** Instantly visualize your project's Lines of Code (LOC) with a beautiful terminal dashboard, no extraction required.
|
|
42
|
+
* **Dry-Run Mode:** Simulate snapshot creation to check file sizes and detect sensitive data risks before packing.
|
|
43
|
+
* **Integrity v2:** Verify data integrity at lightning speed with **Blake3** and inspect metadata (author, timestamp, tool version) without unpacking.
|
|
44
|
+
* **Smart Upload:** Built-in `send` command supporting concurrent **Chunked Uploads** for large files.
|
|
45
|
+
* **Smart Filtering:** Automatically respects `.veghignore` and `.gitignore` rules.
|
|
46
|
+
* **Vegh Hooks:** Allow you to custom automation shell command while snapping.
|
|
47
|
+
* **Deep Inspection:** Peek into files (`cat`) and compare snapshots (`diff`) without unpacking.
|
|
48
|
+
|
|
49
|
+
## Installation
|
|
50
|
+
|
|
51
|
+
Install directly from PyPI:
|
|
52
|
+
```bash
|
|
53
|
+
pip install pyvegh
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Or build from source (requires Rust):
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
maturin develop --release
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## CLI Usage
|
|
63
|
+
|
|
64
|
+
PyVegh provides a powerful command-line interface via the `vegh` (or `pyvegh`) command.
|
|
65
|
+
|
|
66
|
+
### 1\. Configuration
|
|
67
|
+
|
|
68
|
+
Set up your default server URL and Auth Token so you don't have to type them every time.
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
vegh config
|
|
72
|
+
# Or one-liner:
|
|
73
|
+
vegh config send --url https://api.teaserverse.online/test --auth YOUR_TOKEN
|
|
74
|
+
|
|
75
|
+
# List current configuration
|
|
76
|
+
vegh config list
|
|
77
|
+
|
|
78
|
+
# Reset configuration to defaults
|
|
79
|
+
vegh config reset
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### 2\. Create Snapshot
|
|
83
|
+
|
|
84
|
+
Pack a directory into a highly compressed snapshot.
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# Basic snapshot
|
|
88
|
+
vegh snap ./my-project --output backup.vegh
|
|
89
|
+
|
|
90
|
+
# Dry-Run (Simulation) - Check for large/sensitive files
|
|
91
|
+
vegh snap ./my-project --dry-run
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### 3\. LOC
|
|
95
|
+
|
|
96
|
+
View the Analytics Dashboard to break down your project by language and lines of code.
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
vegh loc backup.vegh
|
|
100
|
+
|
|
101
|
+
# Show Source Lines of Code (SLOC) instead of total LOC
|
|
102
|
+
# Excludes blank lines and comments
|
|
103
|
+
vegh loc backup.vegh --sloc
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### 4\. Prompt
|
|
107
|
+
|
|
108
|
+
Generate a structured XML context of your codebase to feed directly into ChatGPT, Claude, or Gemini.
|
|
109
|
+
```bash
|
|
110
|
+
# Generate XML context to stdout
|
|
111
|
+
vegh prompt .
|
|
112
|
+
|
|
113
|
+
# Clean Mode (Recommended):
|
|
114
|
+
# Removes lock files (package-lock.json, Cargo.lock), logs, secrets and other unnecessary files.
|
|
115
|
+
vegh prompt . --clean
|
|
116
|
+
|
|
117
|
+
# Copy to Clipboard (One-shot):
|
|
118
|
+
vegh prompt . --clean --copy
|
|
119
|
+
|
|
120
|
+
# Save to file
|
|
121
|
+
vegh prompt . --clean --output context.xml
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### 5\. Prune
|
|
125
|
+
|
|
126
|
+
Clean up old snapshots to free disk space.
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# Keep only the 5 most recent snapshots in the current directory
|
|
130
|
+
vegh prune --keep 5
|
|
131
|
+
|
|
132
|
+
# Force clean without confirmation (useful for CI/CD)
|
|
133
|
+
vegh prune --keep 1 --force
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### 6\. Check
|
|
137
|
+
|
|
138
|
+
Check file integrity (Blake3) and view embedded metadata.
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
vegh check backup.vegh
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### 7\. Restore
|
|
145
|
+
|
|
146
|
+
Restore the snapshot to a target directory. Supports **Partial Restore**.
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
# Full restore
|
|
150
|
+
vegh restore backup.vegh ./restored-folder
|
|
151
|
+
|
|
152
|
+
# Partial restore (Specific files or folders)
|
|
153
|
+
vegh restore backup.vegh ./restored-folder --path src/main.rs --path config/
|
|
154
|
+
|
|
155
|
+
# Flatten directory structure (Extract files directly to output dir)
|
|
156
|
+
vegh restore backup.vegh ./restored-folder --flatten
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### 8\. Cat & Diff
|
|
160
|
+
|
|
161
|
+
Inspect content without extracting.
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
# View a file's content inside the snapshot
|
|
165
|
+
vegh cat backup.vegh src/main.rs
|
|
166
|
+
|
|
167
|
+
# View raw content (Useful for piping binary files)
|
|
168
|
+
vegh cat backup.vegh image.png --raw > extracted_image.png
|
|
169
|
+
|
|
170
|
+
# Compare snapshot with a directory
|
|
171
|
+
vegh diff backup.vegh ./current-project
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### 9\. Send
|
|
175
|
+
|
|
176
|
+
Send the snapshot to a remote server. Supports **Chunked Uploads** for reliability.
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
# Auto-detects if chunking is needed, or force it:
|
|
180
|
+
vegh send backup.vegh --force-chunk
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### 10\. Doctor
|
|
184
|
+
|
|
185
|
+
Check your environment and installation health.
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
vegh doctor
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### 11\. Hooks example
|
|
192
|
+
|
|
193
|
+
Create a `.veghhooks.json` in your workspace.
|
|
194
|
+
|
|
195
|
+
```json
|
|
196
|
+
{
|
|
197
|
+
"hooks": {
|
|
198
|
+
"pre": [
|
|
199
|
+
"echo '🚀 Pre-snap hook started...'",
|
|
200
|
+
"echo 'Preparing to backup...'",
|
|
201
|
+
"echo 'Backing up database...'",
|
|
202
|
+
"echo 'Backup completed.'"
|
|
203
|
+
],
|
|
204
|
+
"post": [
|
|
205
|
+
"echo '🎉 Snapshot completed!'",
|
|
206
|
+
"echo 'Cleaning up...'"
|
|
207
|
+
]
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## Library Usage
|
|
213
|
+
|
|
214
|
+
You can also use PyVegh as a library in your own Python scripts:
|
|
215
|
+
|
|
216
|
+
```python
|
|
217
|
+
import json
|
|
218
|
+
from vegh import create_snap, restore_snap, check_integrity, get_metadata
|
|
219
|
+
|
|
220
|
+
# 1. Create a snapshot
|
|
221
|
+
# Returns the number of files compressed
|
|
222
|
+
count = create_snap("src_folder", "backup.vegh", comment="Automated backup")
|
|
223
|
+
print(f"Compressed {count} files.")
|
|
224
|
+
|
|
225
|
+
# 2. Check integrity (Now uses Blake3)
|
|
226
|
+
checksum = check_integrity("backup.vegh")
|
|
227
|
+
print(f"Blake3 Hash: {checksum}")
|
|
228
|
+
|
|
229
|
+
# 3. Read Metadata (Fast, no unpacking)
|
|
230
|
+
raw_meta = get_metadata("backup.vegh")
|
|
231
|
+
meta = json.loads(raw_meta)
|
|
232
|
+
print(f"Snapshot created by: {meta.get('author')}")
|
|
233
|
+
|
|
234
|
+
# 4. Restore
|
|
235
|
+
restore_snap("backup.vegh", "dest_folder")
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
## License
|
|
239
|
+
|
|
240
|
+
This project is under the **MIT License**.
|
|
241
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
pyvegh-0.7.0.dist-info\METADATA,sha256=_UmEloaYqGaUXQbLqeFlUbUsfKX5l5GspR1oz2wj4vE,6715
|
|
2
|
+
pyvegh-0.7.0.dist-info\WHEEL,sha256=ZMDDxh9OPoaLQ4P2dJmgI1XsENYSzjzq8fErKKVw5iE,96
|
|
3
|
+
pyvegh-0.7.0.dist-info\entry_points.txt,sha256=WNhHyba1tppGRLA2R4dOILWdifp2vTP6dtvyOzPjtzk,56
|
|
4
|
+
pyvegh-0.7.0.dist-info\licenses\LICENSE,sha256=5d9Msgs0I6oS2jCQpP8Y4eioop_lWZpqiDmsEINaA70,1087
|
|
5
|
+
vegh\__init__.py,sha256=3aVDu-X8vk9GGe0JyRViYHU0tBDKkki2WLAmCtQacds,459
|
|
6
|
+
vegh\_core.pyd,sha256=Tkk7-qg-apd6qFlESzevl8_8N6bkfo7ADHV13o3U_KA,4230656
|
|
7
|
+
vegh\analytics.py,sha256=Po4rGncIqiKPe7SODW8Uodd5jLpsHS_4T3PlwAKi_Us,19587
|
|
8
|
+
vegh\cli.py,sha256=_ZyEhLY_7f8VgkMDxu1sKSQtadH4zW7giO2-7uHEZCo,55907
|
|
9
|
+
pyvegh-0.7.0.dist-info\RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 CodeTease
|
|
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.
|
vegh/__init__.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# PyVegh - The CodeTease Snapshot Tool (Python Binding)
|
|
2
|
+
# Copyright (c) 2025 CodeTease
|
|
3
|
+
|
|
4
|
+
from ._core import (
|
|
5
|
+
create_snap,
|
|
6
|
+
dry_run_snap,
|
|
7
|
+
restore_snap,
|
|
8
|
+
check_integrity,
|
|
9
|
+
get_metadata,
|
|
10
|
+
count_locs,
|
|
11
|
+
scan_locs_dir,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
__version__ = "0.7.0"
|
|
15
|
+
__all__ = [
|
|
16
|
+
"create_snap",
|
|
17
|
+
"dry_run_snap",
|
|
18
|
+
"restore_snap",
|
|
19
|
+
"check_integrity",
|
|
20
|
+
"get_metadata",
|
|
21
|
+
"count_locs",
|
|
22
|
+
"scan_locs_dir",
|
|
23
|
+
"__version__",
|
|
24
|
+
]
|
vegh/_core.pyd
ADDED
|
Binary file
|