vd3 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.
- vd3-0.1.0/.gitignore +29 -0
- vd3-0.1.0/PKG-INFO +208 -0
- vd3-0.1.0/README.md +172 -0
- vd3-0.1.0/pyproject.toml +78 -0
- vd3-0.1.0/scripts/publish.sh +55 -0
- vd3-0.1.0/src/vd3storage/__init__.py +10 -0
- vd3-0.1.0/src/vd3storage/cli/__init__.py +5 -0
- vd3-0.1.0/src/vd3storage/cli/app.py +43 -0
- vd3-0.1.0/src/vd3storage/cli/commands/__init__.py +0 -0
- vd3-0.1.0/src/vd3storage/cli/commands/add.py +134 -0
- vd3-0.1.0/src/vd3storage/cli/commands/export.py +52 -0
- vd3-0.1.0/src/vd3storage/cli/commands/info.py +18 -0
- vd3-0.1.0/src/vd3storage/cli/commands/init.py +23 -0
- vd3-0.1.0/src/vd3storage/cli/commands/list_.py +95 -0
- vd3-0.1.0/src/vd3storage/cli/commands/query.py +39 -0
- vd3-0.1.0/src/vd3storage/cli/commands/remote.py +252 -0
- vd3-0.1.0/src/vd3storage/cli/commands/remove.py +37 -0
- vd3-0.1.0/src/vd3storage/cli/commands/show.py +44 -0
- vd3-0.1.0/src/vd3storage/cli/commands/workspace.py +212 -0
- vd3-0.1.0/src/vd3storage/cli/formatters.py +126 -0
- vd3-0.1.0/src/vd3storage/cli/utils.py +33 -0
- vd3-0.1.0/src/vd3storage/constants.py +55 -0
- vd3-0.1.0/src/vd3storage/dvc/__init__.py +0 -0
- vd3-0.1.0/src/vd3storage/dvc/manager.py +197 -0
- vd3-0.1.0/src/vd3storage/importers/__init__.py +0 -0
- vd3-0.1.0/src/vd3storage/importers/vd3json.py +123 -0
- vd3-0.1.0/src/vd3storage/media/__init__.py +0 -0
- vd3-0.1.0/src/vd3storage/media/mcap_augmenter.py +196 -0
- vd3-0.1.0/src/vd3storage/media/mcap_reader.py +209 -0
- vd3-0.1.0/src/vd3storage/media/mcap_writer.py +180 -0
- vd3-0.1.0/src/vd3storage/media/schemas.py +31 -0
- vd3-0.1.0/src/vd3storage/media/transcoder.py +160 -0
- vd3-0.1.0/src/vd3storage/models/__init__.py +9 -0
- vd3-0.1.0/src/vd3storage/models/asset.py +51 -0
- vd3-0.1.0/src/vd3storage/models/base.py +89 -0
- vd3-0.1.0/src/vd3storage/models/tag.py +20 -0
- vd3-0.1.0/src/vd3storage/models/workspace.py +24 -0
- vd3-0.1.0/src/vd3storage/models/workspace_asset.py +25 -0
- vd3-0.1.0/src/vd3storage/orm/__init__.py +7 -0
- vd3-0.1.0/src/vd3storage/orm/engine.py +116 -0
- vd3-0.1.0/src/vd3storage/orm/migrations.py +10 -0
- vd3-0.1.0/src/vd3storage/orm/query.py +135 -0
- vd3-0.1.0/src/vd3storage/orm/table.py +66 -0
- vd3-0.1.0/src/vd3storage/py.typed +0 -0
- vd3-0.1.0/src/vd3storage/storage.py +902 -0
- vd3-0.1.0/tests/__init__.py +0 -0
- vd3-0.1.0/tests/conftest.py +14 -0
- vd3-0.1.0/tests/test_cli.py +260 -0
- vd3-0.1.0/tests/test_dvc.py +163 -0
- vd3-0.1.0/tests/test_importer.py +276 -0
- vd3-0.1.0/tests/test_mcap.py +262 -0
- vd3-0.1.0/tests/test_models.py +77 -0
- vd3-0.1.0/tests/test_orm.py +82 -0
- vd3-0.1.0/tests/test_storage.py +216 -0
- vd3-0.1.0/uv.lock +3380 -0
vd3-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.pyc
|
|
4
|
+
*.pyo
|
|
5
|
+
*.egg-info/
|
|
6
|
+
dist/
|
|
7
|
+
build/
|
|
8
|
+
.venv/
|
|
9
|
+
|
|
10
|
+
# Testing
|
|
11
|
+
.pytest_cache/
|
|
12
|
+
.coverage
|
|
13
|
+
htmlcov/
|
|
14
|
+
|
|
15
|
+
# Linting
|
|
16
|
+
.ruff_cache/
|
|
17
|
+
|
|
18
|
+
# OS
|
|
19
|
+
.DS_Store
|
|
20
|
+
Thumbs.db
|
|
21
|
+
|
|
22
|
+
# IDE
|
|
23
|
+
.idea/
|
|
24
|
+
.vscode/
|
|
25
|
+
*.swp
|
|
26
|
+
*.swo
|
|
27
|
+
|
|
28
|
+
#
|
|
29
|
+
.pypirc
|
vd3-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vd3
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Content database library and CLI for VisData 3
|
|
5
|
+
Project-URL: Homepage, https://github.com/jmuncaster/vd3
|
|
6
|
+
Project-URL: Repository, https://github.com/jmuncaster/vd3
|
|
7
|
+
Project-URL: Issues, https://github.com/jmuncaster/vd3/issues
|
|
8
|
+
Author-email: Justin Muncaster <justin@muncasterconsulting.com>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
Keywords: computer-vision,dataset,dvc,foxglove,mcap,video
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Topic :: Multimedia :: Video
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
19
|
+
Requires-Python: >=3.12
|
|
20
|
+
Requires-Dist: duckdb>=1.1.0
|
|
21
|
+
Requires-Dist: dvc-azure>=3.0
|
|
22
|
+
Requires-Dist: dvc-gs>=3.0
|
|
23
|
+
Requires-Dist: dvc-s3>=3.0
|
|
24
|
+
Requires-Dist: dvc>=3.50.0
|
|
25
|
+
Requires-Dist: ffmpeg-python>=0.2.0
|
|
26
|
+
Requires-Dist: foxglove-schemas-protobuf>=0.3.0
|
|
27
|
+
Requires-Dist: mcap-protobuf-support>=0.5.4
|
|
28
|
+
Requires-Dist: mcap>=1.1.0
|
|
29
|
+
Requires-Dist: orjson>=3.10.0
|
|
30
|
+
Requires-Dist: pillow>=10.0.0
|
|
31
|
+
Requires-Dist: protobuf>=5.0
|
|
32
|
+
Requires-Dist: pydantic>=2.0
|
|
33
|
+
Requires-Dist: rich>=13.0.0
|
|
34
|
+
Requires-Dist: typer>=0.12.0
|
|
35
|
+
Description-Content-Type: text/markdown
|
|
36
|
+
|
|
37
|
+
# VD3Storage
|
|
38
|
+
|
|
39
|
+
Content database library and CLI for VisData 3. Manages video assets, annotations, and workspaces backed by MCAP files and CSV-based metadata.
|
|
40
|
+
|
|
41
|
+
## Installation
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
uv sync
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
To use as a dependency in a content database project:
|
|
48
|
+
|
|
49
|
+
```toml
|
|
50
|
+
# pyproject.toml
|
|
51
|
+
[project]
|
|
52
|
+
dependencies = ["vd3storage"]
|
|
53
|
+
|
|
54
|
+
[tool.uv.sources]
|
|
55
|
+
vd3storage = { path = "./vd3storage", editable = true }
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Quick Start
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# Initialize a new content database
|
|
62
|
+
vd3 init /path/to/mydb
|
|
63
|
+
|
|
64
|
+
# Add a video
|
|
65
|
+
vd3 add video clip.mp4 -c my-collection -p /path/to/mydb
|
|
66
|
+
|
|
67
|
+
# Add multiple videos with a glob
|
|
68
|
+
vd3 add video '*.mp4' -c my-collection -p /path/to/mydb
|
|
69
|
+
|
|
70
|
+
# List assets
|
|
71
|
+
vd3 list assets -p /path/to/mydb
|
|
72
|
+
|
|
73
|
+
# Check status
|
|
74
|
+
vd3 status -p /path/to/mydb
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Remote Storage
|
|
78
|
+
|
|
79
|
+
VD3Storage uses [DVC](https://dvc.org) under the hood to push and pull large media files to/from remote storage.
|
|
80
|
+
|
|
81
|
+
### Google Cloud Storage
|
|
82
|
+
|
|
83
|
+
1. Authenticate with GCS:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
gcloud auth application-default login
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
2. Add a GCS remote:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
vd3 remote add gcs gs://my-bucket/vd3-data -p /path/to/mydb
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
3. Push media to remote:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
vd3 push --all -p /path/to/mydb
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
4. Pull media from remote (e.g. on another machine):
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
vd3 pull --all -p /path/to/mydb
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Amazon S3
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# Ensure AWS credentials are configured (aws configure, env vars, etc.)
|
|
111
|
+
vd3 remote add s3remote s3://my-bucket/vd3-data -p /path/to/mydb
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Local / NAS
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
vd3 remote add backup /mnt/nas/vd3-backup -p /path/to/mydb
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Listing Remotes
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
vd3 remote list -p /path/to/mydb
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Workspaces
|
|
127
|
+
|
|
128
|
+
Workspaces let you organize subsets of assets into named groups with optional packages (folders).
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
# Create a workspace
|
|
132
|
+
vd3 workspace create "My Experiment" -p /path/to/mydb
|
|
133
|
+
|
|
134
|
+
# Add assets by name, ID, or media file glob
|
|
135
|
+
vd3 workspace add-asset my-experiment 'db/media/videos/fc/*.mcap' -p /path/to/mydb
|
|
136
|
+
|
|
137
|
+
# List workspaces
|
|
138
|
+
vd3 workspace list -p /path/to/mydb
|
|
139
|
+
|
|
140
|
+
# Show workspace details
|
|
141
|
+
vd3 workspace show my-experiment -p /path/to/mydb
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Adding Videos
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
# Single file
|
|
148
|
+
vd3 add video clip.mp4 -c dashcam
|
|
149
|
+
|
|
150
|
+
# Glob pattern (quote to prevent shell expansion)
|
|
151
|
+
vd3 add video '*.mp4' -c dashcam
|
|
152
|
+
|
|
153
|
+
# Recursive glob
|
|
154
|
+
vd3 add video 'rawdata/**/*.mp4' -c dashcam
|
|
155
|
+
|
|
156
|
+
# Force re-import of a duplicate
|
|
157
|
+
vd3 add video clip.mp4 -c dashcam --force
|
|
158
|
+
|
|
159
|
+
# Add and assign to a workspace
|
|
160
|
+
vd3 add video clip.mp4 -c dashcam -w my-workspace -k batch1
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Duplicate detection uses SHA-256 hashing of the source file. Use `--force` to overwrite an existing asset with the same content.
|
|
164
|
+
|
|
165
|
+
## Adding Results
|
|
166
|
+
|
|
167
|
+
Import VD3 JSON detection/track results into an asset's MCAP:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
vd3 add result results.json -a clip -p /path/to/mydb
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## Viewing in Foxglove
|
|
174
|
+
|
|
175
|
+
MCAP files are written with `foxglove.CompressedImage` protobuf messages on the `/video/frames` topic, compatible with [Foxglove Studio](https://foxglove.dev) and Lichtblick.
|
|
176
|
+
|
|
177
|
+
Open any `.mcap` file under `db/media/videos/` directly in Foxglove to view the video and any annotation overlays.
|
|
178
|
+
|
|
179
|
+
## CLI Reference
|
|
180
|
+
|
|
181
|
+
```
|
|
182
|
+
vd3 --help Top-level help
|
|
183
|
+
vd3 <command> --help Help for a specific command
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
| Command | Description |
|
|
187
|
+
|---|---|
|
|
188
|
+
| `init` | Initialize a new content database |
|
|
189
|
+
| `info` | Show database information |
|
|
190
|
+
| `add video` | Import video files |
|
|
191
|
+
| `add result` | Import detection/track results |
|
|
192
|
+
| `list assets` | List assets |
|
|
193
|
+
| `list collections` | List collections |
|
|
194
|
+
| `show` | Show asset details |
|
|
195
|
+
| `query` | Run raw SQL against the database |
|
|
196
|
+
| `remove` | Delete an asset |
|
|
197
|
+
| `workspace create` | Create a workspace |
|
|
198
|
+
| `workspace add-asset` | Add assets to a workspace |
|
|
199
|
+
| `workspace remove-asset` | Remove an asset from a workspace |
|
|
200
|
+
| `workspace list` | List workspaces |
|
|
201
|
+
| `workspace show` | Show workspace details |
|
|
202
|
+
| `workspace delete` | Delete a workspace |
|
|
203
|
+
| `status` | Show media availability (use `-l` to list all) |
|
|
204
|
+
| `push` | Push media to remote storage |
|
|
205
|
+
| `pull` | Pull media from remote storage |
|
|
206
|
+
| `remote add` | Add a remote storage backend |
|
|
207
|
+
| `remote list` | List configured remotes |
|
|
208
|
+
| `export` | Export data from the database |
|
vd3-0.1.0/README.md
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# VD3Storage
|
|
2
|
+
|
|
3
|
+
Content database library and CLI for VisData 3. Manages video assets, annotations, and workspaces backed by MCAP files and CSV-based metadata.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
uv sync
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
To use as a dependency in a content database project:
|
|
12
|
+
|
|
13
|
+
```toml
|
|
14
|
+
# pyproject.toml
|
|
15
|
+
[project]
|
|
16
|
+
dependencies = ["vd3storage"]
|
|
17
|
+
|
|
18
|
+
[tool.uv.sources]
|
|
19
|
+
vd3storage = { path = "./vd3storage", editable = true }
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# Initialize a new content database
|
|
26
|
+
vd3 init /path/to/mydb
|
|
27
|
+
|
|
28
|
+
# Add a video
|
|
29
|
+
vd3 add video clip.mp4 -c my-collection -p /path/to/mydb
|
|
30
|
+
|
|
31
|
+
# Add multiple videos with a glob
|
|
32
|
+
vd3 add video '*.mp4' -c my-collection -p /path/to/mydb
|
|
33
|
+
|
|
34
|
+
# List assets
|
|
35
|
+
vd3 list assets -p /path/to/mydb
|
|
36
|
+
|
|
37
|
+
# Check status
|
|
38
|
+
vd3 status -p /path/to/mydb
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Remote Storage
|
|
42
|
+
|
|
43
|
+
VD3Storage uses [DVC](https://dvc.org) under the hood to push and pull large media files to/from remote storage.
|
|
44
|
+
|
|
45
|
+
### Google Cloud Storage
|
|
46
|
+
|
|
47
|
+
1. Authenticate with GCS:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
gcloud auth application-default login
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
2. Add a GCS remote:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
vd3 remote add gcs gs://my-bucket/vd3-data -p /path/to/mydb
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
3. Push media to remote:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
vd3 push --all -p /path/to/mydb
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
4. Pull media from remote (e.g. on another machine):
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
vd3 pull --all -p /path/to/mydb
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Amazon S3
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# Ensure AWS credentials are configured (aws configure, env vars, etc.)
|
|
75
|
+
vd3 remote add s3remote s3://my-bucket/vd3-data -p /path/to/mydb
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Local / NAS
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
vd3 remote add backup /mnt/nas/vd3-backup -p /path/to/mydb
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Listing Remotes
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
vd3 remote list -p /path/to/mydb
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Workspaces
|
|
91
|
+
|
|
92
|
+
Workspaces let you organize subsets of assets into named groups with optional packages (folders).
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# Create a workspace
|
|
96
|
+
vd3 workspace create "My Experiment" -p /path/to/mydb
|
|
97
|
+
|
|
98
|
+
# Add assets by name, ID, or media file glob
|
|
99
|
+
vd3 workspace add-asset my-experiment 'db/media/videos/fc/*.mcap' -p /path/to/mydb
|
|
100
|
+
|
|
101
|
+
# List workspaces
|
|
102
|
+
vd3 workspace list -p /path/to/mydb
|
|
103
|
+
|
|
104
|
+
# Show workspace details
|
|
105
|
+
vd3 workspace show my-experiment -p /path/to/mydb
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Adding Videos
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
# Single file
|
|
112
|
+
vd3 add video clip.mp4 -c dashcam
|
|
113
|
+
|
|
114
|
+
# Glob pattern (quote to prevent shell expansion)
|
|
115
|
+
vd3 add video '*.mp4' -c dashcam
|
|
116
|
+
|
|
117
|
+
# Recursive glob
|
|
118
|
+
vd3 add video 'rawdata/**/*.mp4' -c dashcam
|
|
119
|
+
|
|
120
|
+
# Force re-import of a duplicate
|
|
121
|
+
vd3 add video clip.mp4 -c dashcam --force
|
|
122
|
+
|
|
123
|
+
# Add and assign to a workspace
|
|
124
|
+
vd3 add video clip.mp4 -c dashcam -w my-workspace -k batch1
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Duplicate detection uses SHA-256 hashing of the source file. Use `--force` to overwrite an existing asset with the same content.
|
|
128
|
+
|
|
129
|
+
## Adding Results
|
|
130
|
+
|
|
131
|
+
Import VD3 JSON detection/track results into an asset's MCAP:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
vd3 add result results.json -a clip -p /path/to/mydb
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Viewing in Foxglove
|
|
138
|
+
|
|
139
|
+
MCAP files are written with `foxglove.CompressedImage` protobuf messages on the `/video/frames` topic, compatible with [Foxglove Studio](https://foxglove.dev) and Lichtblick.
|
|
140
|
+
|
|
141
|
+
Open any `.mcap` file under `db/media/videos/` directly in Foxglove to view the video and any annotation overlays.
|
|
142
|
+
|
|
143
|
+
## CLI Reference
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
vd3 --help Top-level help
|
|
147
|
+
vd3 <command> --help Help for a specific command
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
| Command | Description |
|
|
151
|
+
|---|---|
|
|
152
|
+
| `init` | Initialize a new content database |
|
|
153
|
+
| `info` | Show database information |
|
|
154
|
+
| `add video` | Import video files |
|
|
155
|
+
| `add result` | Import detection/track results |
|
|
156
|
+
| `list assets` | List assets |
|
|
157
|
+
| `list collections` | List collections |
|
|
158
|
+
| `show` | Show asset details |
|
|
159
|
+
| `query` | Run raw SQL against the database |
|
|
160
|
+
| `remove` | Delete an asset |
|
|
161
|
+
| `workspace create` | Create a workspace |
|
|
162
|
+
| `workspace add-asset` | Add assets to a workspace |
|
|
163
|
+
| `workspace remove-asset` | Remove an asset from a workspace |
|
|
164
|
+
| `workspace list` | List workspaces |
|
|
165
|
+
| `workspace show` | Show workspace details |
|
|
166
|
+
| `workspace delete` | Delete a workspace |
|
|
167
|
+
| `status` | Show media availability (use `-l` to list all) |
|
|
168
|
+
| `push` | Push media to remote storage |
|
|
169
|
+
| `pull` | Pull media from remote storage |
|
|
170
|
+
| `remote add` | Add a remote storage backend |
|
|
171
|
+
| `remote list` | List configured remotes |
|
|
172
|
+
| `export` | Export data from the database |
|
vd3-0.1.0/pyproject.toml
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling", "hatch-vcs"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "vd3"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Content database library and CLI for VisData 3"
|
|
9
|
+
requires-python = ">=3.12"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
authors = [
|
|
12
|
+
{ name = "Justin Muncaster", email = "justin@muncasterconsulting.com" },
|
|
13
|
+
]
|
|
14
|
+
readme = "README.md"
|
|
15
|
+
keywords = ["video", "dataset", "mcap", "foxglove", "dvc", "computer-vision"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 3 - Alpha",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"Intended Audience :: Science/Research",
|
|
20
|
+
"License :: OSI Approved :: MIT License",
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
24
|
+
"Topic :: Multimedia :: Video",
|
|
25
|
+
]
|
|
26
|
+
dependencies = [
|
|
27
|
+
"duckdb>=1.1.0",
|
|
28
|
+
"pydantic>=2.0",
|
|
29
|
+
"mcap>=1.1.0",
|
|
30
|
+
"ffmpeg-python>=0.2.0",
|
|
31
|
+
"pillow>=10.0.0",
|
|
32
|
+
"typer>=0.12.0",
|
|
33
|
+
"rich>=13.0.0",
|
|
34
|
+
"orjson>=3.10.0",
|
|
35
|
+
"foxglove-schemas-protobuf>=0.3.0",
|
|
36
|
+
"protobuf>=5.0",
|
|
37
|
+
"mcap-protobuf-support>=0.5.4",
|
|
38
|
+
"dvc>=3.50.0",
|
|
39
|
+
"dvc-gs>=3.0",
|
|
40
|
+
"dvc-s3>=3.0",
|
|
41
|
+
"dvc-azure>=3.0",
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
[project.urls]
|
|
45
|
+
Homepage = "https://github.com/jmuncaster/vd3"
|
|
46
|
+
Repository = "https://github.com/jmuncaster/vd3"
|
|
47
|
+
Issues = "https://github.com/jmuncaster/vd3/issues"
|
|
48
|
+
|
|
49
|
+
[dependency-groups]
|
|
50
|
+
dev = [
|
|
51
|
+
"pytest>=8.0",
|
|
52
|
+
"ruff>=0.8.0",
|
|
53
|
+
"ty>=0.0.1a1",
|
|
54
|
+
"prek>=0.0.1",
|
|
55
|
+
"hatch-vcs>=0.5.0",
|
|
56
|
+
"hatchling>=1.28.0",
|
|
57
|
+
"build>=1.0",
|
|
58
|
+
"twine>=6.0",
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
[project.scripts]
|
|
62
|
+
vd3 = "vd3storage.cli:cli"
|
|
63
|
+
|
|
64
|
+
[tool.hatch.build.targets.wheel]
|
|
65
|
+
packages = ["src/vd3storage"]
|
|
66
|
+
|
|
67
|
+
[tool.ruff]
|
|
68
|
+
line-length = 120
|
|
69
|
+
|
|
70
|
+
[tool.ruff.lint]
|
|
71
|
+
select = ["E", "F", "I", "UP", "B", "SIM"]
|
|
72
|
+
ignore = ["UP046", "UP047"] # Allow Generic[T] pattern (more readable than PEP 695 type params)
|
|
73
|
+
|
|
74
|
+
[tool.ruff.lint.per-file-ignores]
|
|
75
|
+
"src/vd3storage/cli/**" = ["B008"] # typer.Argument/Option in defaults is the standard pattern
|
|
76
|
+
|
|
77
|
+
[tool.pytest.ini_options]
|
|
78
|
+
testpaths = ["tests"]
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Build and publish to PyPI.
|
|
3
|
+
#
|
|
4
|
+
# Usage:
|
|
5
|
+
# ./scripts/publish.sh # publish to PyPI
|
|
6
|
+
# ./scripts/publish.sh --test # publish to Test PyPI
|
|
7
|
+
#
|
|
8
|
+
# Requires ~/.pypirc or TWINE_USERNAME/TWINE_PASSWORD env vars.
|
|
9
|
+
|
|
10
|
+
set -euo pipefail
|
|
11
|
+
|
|
12
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
13
|
+
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
|
|
14
|
+
cd "$PROJECT_DIR"
|
|
15
|
+
|
|
16
|
+
REPO_FLAG=()
|
|
17
|
+
if [[ "${1:-}" == "--test" ]]; then
|
|
18
|
+
REPO_FLAG=(--repository testpypi)
|
|
19
|
+
echo "Publishing to Test PyPI"
|
|
20
|
+
else
|
|
21
|
+
echo "Publishing to PyPI"
|
|
22
|
+
fi
|
|
23
|
+
|
|
24
|
+
# Clean previous builds
|
|
25
|
+
rm -rf dist/
|
|
26
|
+
|
|
27
|
+
# Lint
|
|
28
|
+
echo "Running ruff..."
|
|
29
|
+
uv run ruff check src/
|
|
30
|
+
|
|
31
|
+
# Build
|
|
32
|
+
echo "Building..."
|
|
33
|
+
uv run python -m build
|
|
34
|
+
|
|
35
|
+
# Show what we built
|
|
36
|
+
echo ""
|
|
37
|
+
echo "Built:"
|
|
38
|
+
ls -lh dist/
|
|
39
|
+
|
|
40
|
+
# Confirm
|
|
41
|
+
PKG_INFO=$(uv run python -c "import tomllib; t=tomllib.load(open('pyproject.toml','rb'))['project']; print(t['name'], t['version'])")
|
|
42
|
+
PKG_NAME="${PKG_INFO% *}"
|
|
43
|
+
VERSION="${PKG_INFO#* }"
|
|
44
|
+
echo ""
|
|
45
|
+
read -rp "Publish ${PKG_NAME} v${VERSION}? [y/N] " confirm
|
|
46
|
+
if [[ "$confirm" != [yY] ]]; then
|
|
47
|
+
echo "Aborted."
|
|
48
|
+
exit 1
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
# Upload
|
|
52
|
+
uv run twine upload "${REPO_FLAG[@]}" dist/*
|
|
53
|
+
|
|
54
|
+
echo ""
|
|
55
|
+
echo "Published ${PKG_NAME} v${VERSION}"
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"""VD3Storage CLI — Typer application."""
|
|
2
|
+
|
|
3
|
+
import typer
|
|
4
|
+
|
|
5
|
+
from vd3storage.cli.commands.add import add_app
|
|
6
|
+
from vd3storage.cli.commands.export import export_app
|
|
7
|
+
from vd3storage.cli.commands.info import info_command
|
|
8
|
+
from vd3storage.cli.commands.init import init_command
|
|
9
|
+
from vd3storage.cli.commands.list_ import list_app
|
|
10
|
+
from vd3storage.cli.commands.query import query_command
|
|
11
|
+
from vd3storage.cli.commands.remote import pull_command, push_command, remote_app, status_command
|
|
12
|
+
from vd3storage.cli.commands.remove import remove_command
|
|
13
|
+
from vd3storage.cli.commands.show import show_command
|
|
14
|
+
from vd3storage.cli.commands.workspace import workspace_app
|
|
15
|
+
|
|
16
|
+
app = typer.Typer(
|
|
17
|
+
name="vd3",
|
|
18
|
+
help="VD3Storage — Content database management for VisData 3",
|
|
19
|
+
add_completion=False,
|
|
20
|
+
rich_markup_mode="rich",
|
|
21
|
+
no_args_is_help=True,
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
# Top-level commands
|
|
25
|
+
app.command("init")(init_command)
|
|
26
|
+
app.command("info")(info_command)
|
|
27
|
+
app.command("show")(show_command)
|
|
28
|
+
app.command("query")(query_command)
|
|
29
|
+
app.command("remove")(remove_command)
|
|
30
|
+
app.command("pull")(pull_command)
|
|
31
|
+
app.command("push")(push_command)
|
|
32
|
+
app.command("status")(status_command)
|
|
33
|
+
|
|
34
|
+
# Sub-command groups
|
|
35
|
+
app.add_typer(add_app, name="add")
|
|
36
|
+
app.add_typer(list_app, name="list")
|
|
37
|
+
app.add_typer(workspace_app, name="workspace")
|
|
38
|
+
app.add_typer(export_app, name="export")
|
|
39
|
+
app.add_typer(remote_app, name="remote")
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def cli() -> None:
|
|
43
|
+
app()
|
|
File without changes
|