unitysvc-data 0.1.0__py3-none-any.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.
- unitysvc_data/__init__.py +119 -0
- unitysvc_data/_manifest.json +91 -0
- unitysvc_data/_version.py +1 -0
- unitysvc_data/cli.py +222 -0
- unitysvc_data/examples/api/connectivity/README.md +45 -0
- unitysvc_data/examples/api/connectivity/connectivity-v1.sh.j2 +42 -0
- unitysvc_data/examples/llm/request-template/README.md +50 -0
- unitysvc_data/examples/llm/request-template/request-template-v1.json +13 -0
- unitysvc_data/examples/s3/code-example/README.md +49 -0
- unitysvc_data/examples/s3/code-example/code-example-v1.py.j2 +48 -0
- unitysvc_data/examples/s3/connectivity/README.md +53 -0
- unitysvc_data/examples/s3/connectivity/connectivity-v1.py.j2 +63 -0
- unitysvc_data/examples/s3/description/README.md +45 -0
- unitysvc_data/examples/s3/description/description-v1.md +21 -0
- unitysvc_data/examples/smtp/connectivity/README.md +50 -0
- unitysvc_data/examples/smtp/connectivity/connectivity-v1.sh.j2 +34 -0
- unitysvc_data/presets.py +259 -0
- unitysvc_data/py.typed +0 -0
- unitysvc_data-0.1.0.dist-info/METADATA +189 -0
- unitysvc_data-0.1.0.dist-info/RECORD +24 -0
- unitysvc_data-0.1.0.dist-info/WHEEL +5 -0
- unitysvc_data-0.1.0.dist-info/entry_points.txt +2 -0
- unitysvc_data-0.1.0.dist-info/licenses/LICENSE +21 -0
- unitysvc_data-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: unitysvc-data
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Standard examples and presets for UnitySVC data packages
|
|
5
|
+
Author-email: Bo Peng <bo.peng@unitysvc.com>
|
|
6
|
+
Maintainer-email: Bo Peng <bo.peng@unitysvc.com>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/unitysvc/unitysvc-data
|
|
9
|
+
Project-URL: Issues, https://github.com/unitysvc/unitysvc-sellers/issues
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Typing :: Typed
|
|
14
|
+
Requires-Python: >=3.11
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Provides-Extra: test
|
|
18
|
+
Requires-Dist: pytest>=7; extra == "test"
|
|
19
|
+
Requires-Dist: ruff; extra == "test"
|
|
20
|
+
Dynamic: license-file
|
|
21
|
+
|
|
22
|
+
# unitysvc-data
|
|
23
|
+
|
|
24
|
+
Standard examples and presets for UnitySVC — primary consumer is
|
|
25
|
+
[unitysvc-sellers](https://github.com/unitysvc/unitysvc-sellers), but the
|
|
26
|
+
same preset / manifest machinery is intended to serve other parts of the
|
|
27
|
+
platform too.
|
|
28
|
+
|
|
29
|
+
A data-first Python package that ships:
|
|
30
|
+
|
|
31
|
+
- Example files (connectivity tests, usage snippets, descriptions)
|
|
32
|
+
organised under `src/unitysvc_data/examples/<gateway>/<family>/`.
|
|
33
|
+
- A generated manifest (`_manifest.json`) mapping every preset name to
|
|
34
|
+
its metadata and bundled file.
|
|
35
|
+
- Two primitives for consumers:
|
|
36
|
+
- `doc_preset(source, **overrides)` — returns a full document
|
|
37
|
+
record (category, description, mime_type, file_path, ...) ready
|
|
38
|
+
to drop into `listing.json`. This is the expansion the SDK
|
|
39
|
+
applies to `$preset` JSON sentinels at upload time.
|
|
40
|
+
- `file_preset(source)` — returns the raw UTF-8 content of the
|
|
41
|
+
preset's bundled file. Useful when the example isn't a listing
|
|
42
|
+
document (embed as snippet, feed to a test harness, etc.).
|
|
43
|
+
|
|
44
|
+
Both accept either a bare name (`"s3_connectivity"`,
|
|
45
|
+
`"s3_connectivity_v1"`) or a `{"$preset": "...", "$with": {...}}`
|
|
46
|
+
sentinel, so the same function works from JSON walkers and from
|
|
47
|
+
programmatic Python code.
|
|
48
|
+
|
|
49
|
+
Sellers reference a preset from their `listing.json` like this:
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"documents": {
|
|
54
|
+
"Connectivity test": { "$preset": "s3_connectivity" },
|
|
55
|
+
"Usage (Python)": { "$preset": "s3_code_example_v1",
|
|
56
|
+
"$with": { "description": "Lists objects in our bucket" } }
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The SDK walks the parsed listing and calls `doc_preset(...)` on each
|
|
62
|
+
sentinel, substituting the bundled file's absolute path into
|
|
63
|
+
`file_path`, then feeds the result into the existing upload pipeline.
|
|
64
|
+
No custom URL scheme, no extra render pass.
|
|
65
|
+
|
|
66
|
+
## CLI
|
|
67
|
+
|
|
68
|
+
Installing the package provides a `usvc_data` command for shell-level
|
|
69
|
+
access to the same data:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
usvc_data list # every preset + aliases
|
|
73
|
+
usvc_data list --json # machine-readable form
|
|
74
|
+
|
|
75
|
+
usvc_data info s3_connectivity # README prose for a preset
|
|
76
|
+
|
|
77
|
+
usvc_data doc-preset s3_connectivity # expanded JSON record
|
|
78
|
+
usvc_data doc-preset s3_connectivity --with '{"description":"ours"}'
|
|
79
|
+
usvc_data doc-preset s3_connectivity --compact # single-line JSON
|
|
80
|
+
|
|
81
|
+
usvc_data file-preset s3_connectivity # raw file content to stdout
|
|
82
|
+
usvc_data file-preset s3_connectivity > /tmp/s3.py # pipe to file (raw template)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Note that `file-preset` returns the raw file content — `.j2` templates
|
|
86
|
+
come through with Jinja2 markers intact. The sellers SDK renders them
|
|
87
|
+
with per-listing context at upload time; if you pipe a `.j2` preset
|
|
88
|
+
directly to an executable file you'll get a template, not a runnable
|
|
89
|
+
script.
|
|
90
|
+
|
|
91
|
+
`--with` accepts a JSON object whose keys are the overridable fields
|
|
92
|
+
(`description`, `is_active`, `is_public`, `meta`). Forbidden keys and
|
|
93
|
+
unknown preset names exit with status 1 and a message on stderr.
|
|
94
|
+
|
|
95
|
+
## Layout
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
src/unitysvc_data/
|
|
99
|
+
├── __init__.py # example_path / read_example / list_examples
|
|
100
|
+
├── presets.py # doc_preset / file_preset / PRESETS / ALIASES
|
|
101
|
+
├── cli.py # usvc_data entry point
|
|
102
|
+
├── _manifest.json # generated — committed — source of truth at runtime
|
|
103
|
+
└── examples/
|
|
104
|
+
├── api/ # generic HTTP services
|
|
105
|
+
│ └── connectivity/
|
|
106
|
+
│ ├── README.md # front-matter + prose
|
|
107
|
+
│ └── connectivity-v1.sh.j2
|
|
108
|
+
├── llm/ # LLM gateway
|
|
109
|
+
│ └── request-template/
|
|
110
|
+
│ ├── README.md
|
|
111
|
+
│ └── request-template-v1.json
|
|
112
|
+
├── s3/ # S3-compatible storage gateway
|
|
113
|
+
│ ├── code-example/ ...
|
|
114
|
+
│ ├── connectivity/ ...
|
|
115
|
+
│ └── description/ ...
|
|
116
|
+
└── smtp/ # SMTP relay
|
|
117
|
+
└── connectivity/ ...
|
|
118
|
+
|
|
119
|
+
tools/
|
|
120
|
+
└── build.py # regenerate _manifest.json + MANIFEST.md
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Each gateway holds one or more **preset families** (e.g. `s3/connectivity/`).
|
|
124
|
+
A family directory contains:
|
|
125
|
+
|
|
126
|
+
- `README.md` with TOML front-matter delimited by `+++` lines. The
|
|
127
|
+
front-matter has every piece of metadata for the family
|
|
128
|
+
(`preset_name`, `category`, `mime_type`, `file`, `description`,
|
|
129
|
+
`is_active`, `is_public`, `meta`). Prose under the front-matter
|
|
130
|
+
documents the example and any per-version differences.
|
|
131
|
+
- One file per version, named `<stem>-v<N>.<suffix>` where stem and
|
|
132
|
+
suffix come from the `file` field — so `file = "connectivity.sh.j2"`
|
|
133
|
+
matches `connectivity-v1.sh.j2`, `connectivity-v2.sh.j2`, ....
|
|
134
|
+
|
|
135
|
+
Versions are **discovered automatically** by scanning the family
|
|
136
|
+
directory; authors never list them explicitly. Adding a new version
|
|
137
|
+
is purely "drop a new `-v<N>.<ext>` file and rebuild."
|
|
138
|
+
|
|
139
|
+
[`MANIFEST.md`](MANIFEST.md) at the repo root is the human-readable
|
|
140
|
+
roster of every preset, also generated by `tools/build.py`.
|
|
141
|
+
|
|
142
|
+
## Preset naming
|
|
143
|
+
|
|
144
|
+
| Form | Resolves to | Use when |
|
|
145
|
+
|-----------------------------------|--------------------------------------------|----------------------|
|
|
146
|
+
| `s3_connectivity_v1` | version 1 of the `s3/connectivity` family | pinning to an exact version |
|
|
147
|
+
| `s3_connectivity` (alias) | latest version of that family | tracking the latest |
|
|
148
|
+
|
|
149
|
+
Seller data that pins to a versioned name stays byte-identical across
|
|
150
|
+
`pip upgrade`s. Data that uses the alias tracks the newest version
|
|
151
|
+
automatically.
|
|
152
|
+
|
|
153
|
+
## Versioning discipline
|
|
154
|
+
|
|
155
|
+
- Example files are **append-only**. `connectivity-v1.py.j2` is
|
|
156
|
+
frozen forever; fixes ship as `connectivity-v2.py.j2` dropped into
|
|
157
|
+
the same directory.
|
|
158
|
+
- The version-less alias always points at the highest-`v` file in the
|
|
159
|
+
family. Landing a new version shifts the alias automatically the
|
|
160
|
+
next time `python tools/build.py` runs.
|
|
161
|
+
- `preset_name` is globally unique across the whole tree — declaring
|
|
162
|
+
the same `preset_name` in two READMEs is a build error.
|
|
163
|
+
- Package version bumps are additive (new version or new family →
|
|
164
|
+
minor bump; never mutate existing `_vN` → no breaking release).
|
|
165
|
+
Bump major only to remove a `_vN` (should be vanishingly rare).
|
|
166
|
+
|
|
167
|
+
## Contributing
|
|
168
|
+
|
|
169
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for the full walkthrough: how
|
|
170
|
+
to add a new family, how to publish a new version, front-matter
|
|
171
|
+
reference, filename conventions, and the pre-submission checklist.
|
|
172
|
+
|
|
173
|
+
In one line: drop your file at
|
|
174
|
+
`src/unitysvc_data/examples/<gateway>/<family>/<stem>-v<N>.<ext>[.j2]`,
|
|
175
|
+
write the family's `README.md`, run `python tools/build.py`, open the PR.
|
|
176
|
+
|
|
177
|
+
## Development
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
uv pip install -e '.[test]'
|
|
181
|
+
pytest -q # runs tests + manifest-freshness check
|
|
182
|
+
python tools/build.py # regenerate manifest + roster
|
|
183
|
+
python tools/build.py --check # CI mode: non-zero exit if stale
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
CI ([`.github/workflows/ci.yml`](.github/workflows/ci.yml)) runs
|
|
187
|
+
`tools/build.py --check`, `ruff`, `pytest` on Python 3.11 and 3.12,
|
|
188
|
+
then builds a wheel and verifies it includes every example file and
|
|
189
|
+
the manifest.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
unitysvc_data/__init__.py,sha256=-Mg_L5BqNopq3EfIEdlgtr7g2EjZEUL1OkQJ9eP_-8w,3959
|
|
2
|
+
unitysvc_data/_manifest.json,sha256=yD2BXbRwm-967Dd3YX52MFCvei5jmx9coPGidfWUgmU,3060
|
|
3
|
+
unitysvc_data/_version.py,sha256=kUR5RAFc7HCeiqdlX36dZOHkUI5wI6V_43RpEcD8b-0,22
|
|
4
|
+
unitysvc_data/cli.py,sha256=kToGFS4rh21UXmcnxc8fQUBBoAZGJYmbUsl03wwZ_ko,7638
|
|
5
|
+
unitysvc_data/presets.py,sha256=7PCqNa0V5oErUb5Ms5Hx12m6iKKhnBOehTzAhs5UILY,9619
|
|
6
|
+
unitysvc_data/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
unitysvc_data/examples/api/connectivity/README.md,sha256=EZf0VpBZn_wHr2nGZsIxVUr2o89V0dfQM4cakwUSxp8,1539
|
|
8
|
+
unitysvc_data/examples/api/connectivity/connectivity-v1.sh.j2,sha256=vGUxlzDFeGJ8wbKZxNUVG1M0n29Wb9J0wYlUWd_WCcc,1543
|
|
9
|
+
unitysvc_data/examples/llm/request-template/README.md,sha256=srOQmgMsDwkUhEqqvDbSoRIV6X3V578DHP1k6ErZ4_4,1487
|
|
10
|
+
unitysvc_data/examples/llm/request-template/request-template-v1.json,sha256=pEF5s-GtkY-_eBjRPw_jNlPesqm2kTKWWMjK_-VBnmc,210
|
|
11
|
+
unitysvc_data/examples/s3/code-example/README.md,sha256=FE2PY7qGCeVA58oXK2S9lveGgS5ITqvq8rEe4KC6c7k,1693
|
|
12
|
+
unitysvc_data/examples/s3/code-example/code-example-v1.py.j2,sha256=n1Lin6fAh-xjMu_xGHuY49-XlfNjvL5UP2HkxSN_Qtg,1499
|
|
13
|
+
unitysvc_data/examples/s3/connectivity/README.md,sha256=sivOsJdxf0aDJOEmh0IJSd7jnT6q4eG8-Ie_3fvUdak,2186
|
|
14
|
+
unitysvc_data/examples/s3/connectivity/connectivity-v1.py.j2,sha256=gj9fjsfi93XKwfDDOJwtQwfuorROs9MvA4eNbuJxywE,2626
|
|
15
|
+
unitysvc_data/examples/s3/description/README.md,sha256=GiHa76dov92xqmrV4sok8qXc9N48xPp-Ap3_aG0AtNM,1594
|
|
16
|
+
unitysvc_data/examples/s3/description/description-v1.md,sha256=GbGvXwKC5O9CNb5B96lku8om8t74jd-flt31FXazxMQ,620
|
|
17
|
+
unitysvc_data/examples/smtp/connectivity/README.md,sha256=cNTZBxYQnPH67lLwCiXhQM8nAqsivlH7c9Q4V7Xilpk,1627
|
|
18
|
+
unitysvc_data/examples/smtp/connectivity/connectivity-v1.sh.j2,sha256=HwNH8fRq86eP_XmkXygAxCktD9gKTX-WhyDgwXczGNw,1203
|
|
19
|
+
unitysvc_data-0.1.0.dist-info/licenses/LICENSE,sha256=nqI6E90zC14DP1BXSSVWY3KgvMtqcwe8gWfIvhgk9mU,1065
|
|
20
|
+
unitysvc_data-0.1.0.dist-info/METADATA,sha256=UfhiF2VMhBDgpxSKvPL69yIv2bvPwGXYxm2qo9_Iq0U,7984
|
|
21
|
+
unitysvc_data-0.1.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
22
|
+
unitysvc_data-0.1.0.dist-info/entry_points.txt,sha256=5d3hgMaHr8sqhCuz-Sbvv6_C88lxzrAhbcHjkwPyobA,53
|
|
23
|
+
unitysvc_data-0.1.0.dist-info/top_level.txt,sha256=4HJ6YIx3VwbJSiWZLO5C07WObytQu27IArcZy9sHPB8,14
|
|
24
|
+
unitysvc_data-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 UnitySVC
|
|
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 @@
|
|
|
1
|
+
unitysvc_data
|