unitysvc-services 0.1.24__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.
Files changed (37) hide show
  1. unitysvc_services/__init__.py +4 -0
  2. unitysvc_services/api.py +421 -0
  3. unitysvc_services/cli.py +23 -0
  4. unitysvc_services/format_data.py +140 -0
  5. unitysvc_services/interactive_prompt.py +1132 -0
  6. unitysvc_services/list.py +216 -0
  7. unitysvc_services/models/__init__.py +71 -0
  8. unitysvc_services/models/base.py +1375 -0
  9. unitysvc_services/models/listing_data.py +118 -0
  10. unitysvc_services/models/listing_v1.py +56 -0
  11. unitysvc_services/models/provider_data.py +79 -0
  12. unitysvc_services/models/provider_v1.py +54 -0
  13. unitysvc_services/models/seller_data.py +120 -0
  14. unitysvc_services/models/seller_v1.py +42 -0
  15. unitysvc_services/models/service_data.py +114 -0
  16. unitysvc_services/models/service_v1.py +81 -0
  17. unitysvc_services/populate.py +207 -0
  18. unitysvc_services/publisher.py +1628 -0
  19. unitysvc_services/py.typed +0 -0
  20. unitysvc_services/query.py +688 -0
  21. unitysvc_services/scaffold.py +1103 -0
  22. unitysvc_services/schema/base.json +777 -0
  23. unitysvc_services/schema/listing_v1.json +1286 -0
  24. unitysvc_services/schema/provider_v1.json +952 -0
  25. unitysvc_services/schema/seller_v1.json +379 -0
  26. unitysvc_services/schema/service_v1.json +1306 -0
  27. unitysvc_services/test.py +965 -0
  28. unitysvc_services/unpublisher.py +505 -0
  29. unitysvc_services/update.py +287 -0
  30. unitysvc_services/utils.py +533 -0
  31. unitysvc_services/validator.py +731 -0
  32. unitysvc_services-0.1.24.dist-info/METADATA +184 -0
  33. unitysvc_services-0.1.24.dist-info/RECORD +37 -0
  34. unitysvc_services-0.1.24.dist-info/WHEEL +5 -0
  35. unitysvc_services-0.1.24.dist-info/entry_points.txt +3 -0
  36. unitysvc_services-0.1.24.dist-info/licenses/LICENSE +21 -0
  37. unitysvc_services-0.1.24.dist-info/top_level.txt +1 -0
@@ -0,0 +1,184 @@
1
+ Metadata-Version: 2.4
2
+ Name: unitysvc-services
3
+ Version: 0.1.24
4
+ Summary: SDK for digital service providers on UnitySVC
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: bugs, https://github.com/unitysvc/unitysvc-services/issues
9
+ Project-URL: changelog, https://github.com/unitysvc/unitysvc-services/blob/master/changelog.md
10
+ Project-URL: homepage, https://github.com/unitysvc/unitysvc-services
11
+ Requires-Python: >=3.11
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: typer
15
+ Requires-Dist: pydantic
16
+ Requires-Dist: email-validator
17
+ Requires-Dist: jsonschema
18
+ Requires-Dist: jinja2
19
+ Requires-Dist: rich
20
+ Requires-Dist: httpx
21
+ Requires-Dist: tomli-w
22
+ Provides-Extra: test
23
+ Requires-Dist: coverage; extra == "test"
24
+ Requires-Dist: pytest; extra == "test"
25
+ Requires-Dist: ruff; extra == "test"
26
+ Requires-Dist: mypy; extra == "test"
27
+ Requires-Dist: ipdb; extra == "test"
28
+ Provides-Extra: dev
29
+ Requires-Dist: coverage; extra == "dev"
30
+ Requires-Dist: pytest; extra == "dev"
31
+ Requires-Dist: ruff; extra == "dev"
32
+ Requires-Dist: ty; extra == "dev"
33
+ Requires-Dist: ipdb; extra == "dev"
34
+ Requires-Dist: mkdocs; extra == "dev"
35
+ Requires-Dist: mkdocs-material; extra == "dev"
36
+ Requires-Dist: mkdocs-autorefs; extra == "dev"
37
+ Provides-Extra: docs
38
+ Requires-Dist: mkdocs; extra == "docs"
39
+ Requires-Dist: mkdocs-material; extra == "docs"
40
+ Requires-Dist: mkdocs-autorefs; extra == "docs"
41
+ Dynamic: license-file
42
+
43
+ # UnitySVC Services SDK
44
+
45
+ ![PyPI version](https://img.shields.io/pypi/v/unitysvc-services.svg)
46
+ [![Documentation Status](https://readthedocs.org/projects/unitysvc-services/badge/?version=latest)](https://unitysvc-services.readthedocs.io/en/latest/?version=latest)
47
+
48
+ Client library and CLI tools for sellers and providers of digital service to interact with the UnitySVC platform.
49
+
50
+ **📚 [Full Documentation](https://unitysvc-services.readthedocs.io)** | **🚀 [Getting Started](https://unitysvc-services.readthedocs.io/en/latest/getting-started/)** | **📖 [CLI Reference](https://unitysvc-services.readthedocs.io/en/latest/cli-reference/)**
51
+
52
+ ## Overview
53
+
54
+ UnitySVC Services SDK enables digital service sellers and providers to manage their service offerings through a **local-first, version-controlled workflow**:
55
+
56
+ - **Define** service data using schema-validated files (JSON/TOML)
57
+ - **Manage** everything locally in git-controlled directories
58
+ - **Validate** data against schemas
59
+ - **Test** code examples using provider credentials
60
+ - **Publish** to UnitySVC platform when ready
61
+ - **Automate** with populate scripts for dynamic catalogs
62
+
63
+ ## Installation
64
+
65
+ ```bash
66
+ pip install unitysvc-services
67
+ ```
68
+
69
+ Requires Python 3.11+
70
+
71
+ **CLI Alias:** The command `unitysvc_services` can also be invoked using the shorter alias `usvc`.
72
+
73
+ ## Quick Example
74
+
75
+ ```bash
76
+ # Initialize provider and service (using short alias 'usvc')
77
+ usvc init provider my-provider
78
+ usvc init offering my-service
79
+ usvc init seller my-marketplace
80
+
81
+ # Validate and format
82
+ usvc validate
83
+ usvc format
84
+
85
+ # Test code examples with upstream credentials
86
+ usvc test list --provider fireworks
87
+ usvc test run --provider fireworks --services "llama*"
88
+
89
+ # if you write a script to manage services
90
+ usvc populate
91
+
92
+ # Publish to platform (publishes all: sellers, providers, offerings, listings)
93
+ export UNITYSVC_BASE_URL="https://api.unitysvc.com/api/v1"
94
+ export UNITYSVC_API_KEY="your-api-key"
95
+ usvc publish
96
+
97
+ # Query unitysvc backend to verify data
98
+ usvc query providers --fields id,name,contact_email
99
+ ```
100
+
101
+ ## Key Features
102
+
103
+ - 📋 **Pydantic Models** - Type-safe data models for all entities
104
+ - ✅ **Data Validation** - Comprehensive schema validation
105
+ - 🔄 **Local-First** - Work offline, commit to git, publish when ready
106
+ - 🚀 **CLI Tools** - Complete command-line interface
107
+ - 🤖 **Automation** - Script-based service generation
108
+ - 📝 **Multiple Formats** - Support for JSON and TOML
109
+ - 🎯 **Smart Routing** - Request routing based on routing keys (e.g., model-specific endpoints)
110
+
111
+ ## Workflows
112
+
113
+ ### Manual Workflow (small catalogs)
114
+
115
+ ```bash
116
+ init → edit files → validate → test → format → publish → verify
117
+ ```
118
+
119
+ ### Automated Workflow (large/dynamic catalogs)
120
+
121
+ ```bash
122
+ init → configure populate script → populate → validate → publish
123
+ ```
124
+
125
+ See [Workflows Documentation](https://unitysvc-services.readthedocs.io/en/latest/workflows/) for details.
126
+
127
+ ## Data Structure
128
+
129
+ ```
130
+ data/
131
+ ├── seller.json # One seller per repo
132
+ ├── ${provider_name}/
133
+ │ ├── provider.json # Provider metadata
134
+ │ ├── docs/ # Shared documentation
135
+ │ └── services/
136
+ │ └── ${service_name}/
137
+ │ ├── service.json # Service offering
138
+ │ └── listing-*.json # Service listing(s)
139
+ ```
140
+
141
+ See [Data Structure Documentation](https://unitysvc-services.readthedocs.io/en/latest/data-structure/) for complete details.
142
+
143
+ ## CLI Commands
144
+
145
+ | Command | Description |
146
+ | ----------- | ------------------------------------------------ |
147
+ | `init` | Initialize new data files from schemas |
148
+ | `list` | List local data files |
149
+ | `query` | Query backend API for published data |
150
+ | `publish` | Publish data to backend |
151
+ | `unpublish` | Unpublish (delete) data from backend |
152
+ | `update` | Update local file fields |
153
+ | `validate` | Validate data consistency |
154
+ | `format` | Format data files |
155
+ | `populate` | Execute provider populate scripts |
156
+ | `test` | Test code examples with upstream API credentials |
157
+
158
+ Run `usvc --help` or see [CLI Reference](https://unitysvc-services.readthedocs.io/en/latest/cli-reference/) for complete documentation.
159
+
160
+ ## Documentation
161
+
162
+ - **[Getting Started](https://unitysvc-services.readthedocs.io/en/latest/getting-started/)** - Installation and first steps
163
+ - **[Data Structure](https://unitysvc-services.readthedocs.io/en/latest/data-structure/)** - File organization rules
164
+ - **[Workflows](https://unitysvc-services.readthedocs.io/en/latest/workflows/)** - Manual and automated patterns
165
+ - **[Documenting Service Listings](https://unitysvc-services.readthedocs.io/en/latest/documenting-services/)** - Add documentation to services
166
+ - **[Creating Code Examples](https://unitysvc-services.readthedocs.io/en/latest/code-examples/)** - Develop and test code examples
167
+ - **[CLI Reference](https://unitysvc-services.readthedocs.io/en/latest/cli-reference/)** - All commands and options
168
+ - **[File Schemas](https://unitysvc-services.readthedocs.io/en/latest/file-schemas/)** - Schema specifications
169
+ - **[Python API](https://unitysvc-services.readthedocs.io/en/latest/api-reference/)** - Programmatic usage
170
+
171
+ ## Links
172
+
173
+ - **PyPI**: https://pypi.org/project/unitysvc-services/
174
+ - **Documentation**: https://unitysvc-services.readthedocs.io
175
+ - **Source Code**: https://github.com/unitysvc/unitysvc-services
176
+ - **Issue Tracker**: https://github.com/unitysvc/unitysvc-services/issues
177
+
178
+ ## License
179
+
180
+ MIT License - see [LICENSE](LICENSE) file for details.
181
+
182
+ ## Contributing
183
+
184
+ Contributions welcome! See [Contributing Guide](https://unitysvc-services.readthedocs.io/en/latest/contributing/) for details.
@@ -0,0 +1,37 @@
1
+ unitysvc_services/__init__.py,sha256=J6F3RlZCJUVjhZoprfbrYCxe3l9ynQQbGO7pf7FyqlM,110
2
+ unitysvc_services/api.py,sha256=PuejbQg6PLKPmHbWNhCmLLjFJXfLMS369-M44m-u6w4,15989
3
+ unitysvc_services/cli.py,sha256=ISJxjWqQ8O5cyhamEDdt-b4hHYCFp0Pf-o3vT60g7js,787
4
+ unitysvc_services/format_data.py,sha256=Jl9Vj3fRX852fHSUa5DzO-oiFQwuQHC3WMCDNIlo1Lc,5460
5
+ unitysvc_services/interactive_prompt.py,sha256=IlKvtYlLziP_SA_b6BdKPAS3QLAH-ZnSmt-zjQcfuVY,39593
6
+ unitysvc_services/list.py,sha256=QDp9BByaoeFeJxXJN9RQ-jU99mH9Guq9ampfXCbpZmI,7033
7
+ unitysvc_services/populate.py,sha256=lAbu-EMbvM3qk9P_MQ0sQc74IyZigcj-u3eUcgi9Qpw,8063
8
+ unitysvc_services/publisher.py,sha256=AgvoEv6Kca2Dq61ZazZRq1NQcTu1VPpUXEIpMjs_z24,68233
9
+ unitysvc_services/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ unitysvc_services/query.py,sha256=-aiUYmgmeKUhT9stjpAZS_mzpmylk7FB4b-NqMM4n0Y,24132
11
+ unitysvc_services/scaffold.py,sha256=jPTtC7i0Uw61Z4uE51OrWQBW2eGlmyFEhvcC3csKyxc,43321
12
+ unitysvc_services/test.py,sha256=LCZaAW1GCmYSTDKsTamTcNaeRZdCeiO0csqmmJ4uRQo,37646
13
+ unitysvc_services/unpublisher.py,sha256=EkUGHdG8VK9qCyIhrqy4yRzk_NH-gTYhyd_xHTfS05Y,16640
14
+ unitysvc_services/update.py,sha256=hkQlEk6sUpVGnySnrTqI6jcGphbLUEf8_KmY-f63p8M,9604
15
+ unitysvc_services/utils.py,sha256=PCRmbk9efJajWGMeL1CFC5jk-HJJbGe5roSZcLu0XSI,18501
16
+ unitysvc_services/validator.py,sha256=pICY5NwDS9rrLMeZAl23c2JHqzq5aIwRsMTU3kMDNBg,30525
17
+ unitysvc_services/models/__init__.py,sha256=iAHGfKKTMNQsQieLPh2v5x8xTicGh_5GwxPzbVTZSVk,1630
18
+ unitysvc_services/models/base.py,sha256=4Ll1JH9jdu0MYBJN2al7VMgEmfKDzav_9ioZJnd901M,47038
19
+ unitysvc_services/models/listing_data.py,sha256=SBpsdV5uvHSe6xqbZIZvT_iQG5TeM7uxguTUG7q5n_c,4090
20
+ unitysvc_services/models/listing_v1.py,sha256=d3zBoTw0-E5NqMSRLw5FfsYrieDFvr8azOL3cI4v9XM,1951
21
+ unitysvc_services/models/provider_data.py,sha256=s3OJrwp2lVJXeGXCpHuuiuTLD-pLRxVf_c9UFTKMgqI,2598
22
+ unitysvc_services/models/provider_v1.py,sha256=yKhqiN2zi9S2Vwo3dO4Qeh0U630bKtV2mhwcxQQw12Q,2088
23
+ unitysvc_services/models/seller_data.py,sha256=f1igTxG1EOPwZWtKR3TXr77oKYgA44WGs13GM0EZvik,3715
24
+ unitysvc_services/models/seller_v1.py,sha256=CeQiG7sumqLG1Mhhw7v6Gt_Vhk2FeHWCnA2LaBMgJ5I,1519
25
+ unitysvc_services/models/service_data.py,sha256=j6hlOBGVuwP16jHwsXmjqtR2NC5eYe-pBMvkC5eymB0,3552
26
+ unitysvc_services/models/service_v1.py,sha256=12njtp8CB1eZ-jXwJLlAjNlOBzFYfAuqPzR9IMa3pKQ,2757
27
+ unitysvc_services/schema/base.json,sha256=toIx658GINXrQgUciGNLvXBcnfXsFUO9zl1UUqROXMA,18289
28
+ unitysvc_services/schema/listing_v1.json,sha256=bkFJiKZJiZxxVtActgGfeekS2DCefsCzSIxgEN_SLys,33374
29
+ unitysvc_services/schema/provider_v1.json,sha256=xz0Nc-G6e3cC-NhJS8OMoTZbqjePPHMW2PRfHOpCclM,23320
30
+ unitysvc_services/schema/seller_v1.json,sha256=B7BWcefqAulkxmUn5I_66oFSjSUDv2sZ-gWoSMgqg8E,9178
31
+ unitysvc_services/schema/service_v1.json,sha256=GQ5bTOdjeHOJROzpexfFmpqIlj6yYRy4V8G-_AbzJ5E,33298
32
+ unitysvc_services-0.1.24.dist-info/licenses/LICENSE,sha256=_p8V6A8OMPu2HIztn3O01v0-urZFwk0Dd3Yk_PTIlL8,1065
33
+ unitysvc_services-0.1.24.dist-info/METADATA,sha256=Tr1T0xLecL5wkUqoo1jK8Dg0ropFq07CD7tCRGrBwz8,7413
34
+ unitysvc_services-0.1.24.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
35
+ unitysvc_services-0.1.24.dist-info/entry_points.txt,sha256=RBhVHKky3rsOly4jVa29c7UAw5ZwNNWnttmtzozr5O0,97
36
+ unitysvc_services-0.1.24.dist-info/top_level.txt,sha256=GIotQj-Ro2ruR7eupM1r58PWqIHTAq647ORL7E2kneo,18
37
+ unitysvc_services-0.1.24.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ unitysvc_services = unitysvc_services.cli:app
3
+ usvc = unitysvc_services.cli:app
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025, Bo Peng
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_services