unitysvc-services 0.1.1__tar.gz → 0.1.5__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.
Files changed (71) hide show
  1. unitysvc_services-0.1.5/PKG-INFO +182 -0
  2. unitysvc_services-0.1.5/README.md +140 -0
  3. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/docs/api-reference.md +276 -54
  4. unitysvc_services-0.1.5/docs/cli-reference.md +796 -0
  5. unitysvc_services-0.1.5/docs/code-examples.md +731 -0
  6. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/docs/data-structure.md +10 -2
  7. unitysvc_services-0.1.5/docs/documenting-services.md +643 -0
  8. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/docs/file-schemas.md +11 -0
  9. unitysvc_services-0.1.5/docs/getting-started.md +227 -0
  10. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/docs/workflows.md +146 -125
  11. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/pyproject.toml +3 -2
  12. unitysvc_services-0.1.5/src/unitysvc_services/api.py +321 -0
  13. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/src/unitysvc_services/cli.py +2 -1
  14. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/src/unitysvc_services/format_data.py +2 -7
  15. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/src/unitysvc_services/list.py +14 -43
  16. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/src/unitysvc_services/models/base.py +169 -102
  17. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/src/unitysvc_services/models/listing_v1.py +25 -9
  18. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/src/unitysvc_services/models/provider_v1.py +19 -8
  19. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/src/unitysvc_services/models/seller_v1.py +10 -8
  20. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/src/unitysvc_services/models/service_v1.py +8 -1
  21. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/src/unitysvc_services/populate.py +20 -6
  22. unitysvc_services-0.1.5/src/unitysvc_services/publisher.py +1320 -0
  23. unitysvc_services-0.1.5/src/unitysvc_services/query.py +682 -0
  24. unitysvc_services-0.1.5/src/unitysvc_services/test.py +769 -0
  25. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/src/unitysvc_services/update.py +4 -13
  26. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/src/unitysvc_services/utils.py +55 -6
  27. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/src/unitysvc_services/validator.py +117 -86
  28. unitysvc_services-0.1.5/src/unitysvc_services.egg-info/PKG-INFO +182 -0
  29. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/src/unitysvc_services.egg-info/SOURCES.txt +5 -0
  30. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/src/unitysvc_services.egg-info/entry_points.txt +1 -0
  31. unitysvc_services-0.1.5/tests/example_data/provider2/README.md +0 -0
  32. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/tests/test_validator.py +15 -14
  33. unitysvc_services-0.1.1/PKG-INFO +0 -173
  34. unitysvc_services-0.1.1/README.md +0 -131
  35. unitysvc_services-0.1.1/docs/cli-reference.md +0 -528
  36. unitysvc_services-0.1.1/docs/getting-started.md +0 -205
  37. unitysvc_services-0.1.1/src/unitysvc_services/publisher.py +0 -885
  38. unitysvc_services-0.1.1/src/unitysvc_services/query.py +0 -489
  39. unitysvc_services-0.1.1/src/unitysvc_services.egg-info/PKG-INFO +0 -173
  40. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/CONTRIBUTING.md +0 -0
  41. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/HISTORY.md +0 -0
  42. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/LICENSE +0 -0
  43. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/MANIFEST.in +0 -0
  44. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/docs/contributing.md +0 -0
  45. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/docs/development.md +0 -0
  46. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/docs/index.md +0 -0
  47. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/docs/installation.md +0 -0
  48. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/docs/usage.md +0 -0
  49. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/setup.cfg +0 -0
  50. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/src/unitysvc_services/__init__.py +0 -0
  51. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/src/unitysvc_services/models/__init__.py +0 -0
  52. /unitysvc_services-0.1.1/tests/example_data/provider1/README.md → /unitysvc_services-0.1.5/src/unitysvc_services/py.typed +0 -0
  53. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/src/unitysvc_services/scaffold.py +0 -0
  54. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/src/unitysvc_services.egg-info/dependency_links.txt +0 -0
  55. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/src/unitysvc_services.egg-info/requires.txt +0 -0
  56. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/src/unitysvc_services.egg-info/top_level.txt +0 -0
  57. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/tests/__init__.py +0 -0
  58. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/tests/example_data/README.md +0 -0
  59. {unitysvc_services-0.1.1/tests/example_data/provider2 → unitysvc_services-0.1.5/tests/example_data/provider1}/README.md +0 -0
  60. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/tests/example_data/provider1/provider.toml +0 -0
  61. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/tests/example_data/provider1/services/service1/code-example.md +0 -0
  62. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/tests/example_data/provider1/services/service1/service.toml +0 -0
  63. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/tests/example_data/provider1/services/service1/svcreseller.toml +0 -0
  64. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/tests/example_data/provider1/terms-of-service.md +0 -0
  65. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/tests/example_data/provider2/provider.json +0 -0
  66. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/tests/example_data/provider2/services/service2/code-example.md +0 -0
  67. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/tests/example_data/provider2/services/service2/service.json +0 -0
  68. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/tests/example_data/provider2/services/service2/svcreseller.json +0 -0
  69. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/tests/example_data/provider2/terms-of-service.md +0 -0
  70. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/tests/example_data/seller.json +0 -0
  71. {unitysvc_services-0.1.1 → unitysvc_services-0.1.5}/tests/test_utils.py +0 -0
@@ -0,0 +1,182 @@
1
+ Metadata-Version: 2.4
2
+ Name: unitysvc-services
3
+ Version: 0.1.5
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
+
110
+ ## Workflows
111
+
112
+ ### Manual Workflow (small catalogs)
113
+
114
+ ```bash
115
+ init → edit files → validate → test → format → publish → verify
116
+ ```
117
+
118
+ ### Automated Workflow (large/dynamic catalogs)
119
+
120
+ ```bash
121
+ init → configure populate script → populate → validate → publish
122
+ ```
123
+
124
+ See [Workflows Documentation](https://unitysvc-services.readthedocs.io/en/latest/workflows/) for details.
125
+
126
+ ## Data Structure
127
+
128
+ ```
129
+ data/
130
+ ├── seller.json # One seller per repo
131
+ ├── ${provider_name}/
132
+ │ ├── provider.json # Provider metadata
133
+ │ ├── docs/ # Shared documentation
134
+ │ └── services/
135
+ │ └── ${service_name}/
136
+ │ ├── service.json # Service offering
137
+ │ └── listing-*.json # Service listing(s)
138
+ ```
139
+
140
+ See [Data Structure Documentation](https://unitysvc-services.readthedocs.io/en/latest/data-structure/) for complete details.
141
+
142
+ ## CLI Commands
143
+
144
+ | Command | Description |
145
+ | ---------- | ------------------------------------------------ |
146
+ | `init` | Initialize new data files from schemas |
147
+ | `list` | List local data files |
148
+ | `query` | Query backend API for published data |
149
+ | `publish` | Publish data to backend |
150
+ | `update` | Update local file fields |
151
+ | `validate` | Validate data consistency |
152
+ | `format` | Format data files |
153
+ | `populate` | Execute provider populate scripts |
154
+ | `test` | Test code examples with upstream API credentials |
155
+
156
+ Run `usvc --help` or see [CLI Reference](https://unitysvc-services.readthedocs.io/en/latest/cli-reference/) for complete documentation.
157
+
158
+ ## Documentation
159
+
160
+ - **[Getting Started](https://unitysvc-services.readthedocs.io/en/latest/getting-started/)** - Installation and first steps
161
+ - **[Data Structure](https://unitysvc-services.readthedocs.io/en/latest/data-structure/)** - File organization rules
162
+ - **[Workflows](https://unitysvc-services.readthedocs.io/en/latest/workflows/)** - Manual and automated patterns
163
+ - **[Documenting Service Listings](https://unitysvc-services.readthedocs.io/en/latest/documenting-services/)** - Add documentation to services
164
+ - **[Creating Code Examples](https://unitysvc-services.readthedocs.io/en/latest/code-examples/)** - Develop and test code examples
165
+ - **[CLI Reference](https://unitysvc-services.readthedocs.io/en/latest/cli-reference/)** - All commands and options
166
+ - **[File Schemas](https://unitysvc-services.readthedocs.io/en/latest/file-schemas/)** - Schema specifications
167
+ - **[Python API](https://unitysvc-services.readthedocs.io/en/latest/api-reference/)** - Programmatic usage
168
+
169
+ ## Links
170
+
171
+ - **PyPI**: https://pypi.org/project/unitysvc-services/
172
+ - **Documentation**: https://unitysvc-services.readthedocs.io
173
+ - **Source Code**: https://github.com/unitysvc/unitysvc-services
174
+ - **Issue Tracker**: https://github.com/unitysvc/unitysvc-services/issues
175
+
176
+ ## License
177
+
178
+ MIT License - see [LICENSE](LICENSE) file for details.
179
+
180
+ ## Contributing
181
+
182
+ Contributions welcome! See [Contributing Guide](https://unitysvc-services.readthedocs.io/en/latest/contributing/) for details.
@@ -0,0 +1,140 @@
1
+ # UnitySVC Services SDK
2
+
3
+ ![PyPI version](https://img.shields.io/pypi/v/unitysvc-services.svg)
4
+ [![Documentation Status](https://readthedocs.org/projects/unitysvc-services/badge/?version=latest)](https://unitysvc-services.readthedocs.io/en/latest/?version=latest)
5
+
6
+ Client library and CLI tools for sellers and providers of digital service to interact with the UnitySVC platform.
7
+
8
+ **📚 [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/)**
9
+
10
+ ## Overview
11
+
12
+ UnitySVC Services SDK enables digital service sellers and providers to manage their service offerings through a **local-first, version-controlled workflow**:
13
+
14
+ - **Define** service data using schema-validated files (JSON/TOML)
15
+ - **Manage** everything locally in git-controlled directories
16
+ - **Validate** data against schemas
17
+ - **Test** code examples using provider credentials
18
+ - **Publish** to UnitySVC platform when ready
19
+ - **Automate** with populate scripts for dynamic catalogs
20
+
21
+ ## Installation
22
+
23
+ ```bash
24
+ pip install unitysvc-services
25
+ ```
26
+
27
+ Requires Python 3.11+
28
+
29
+ **CLI Alias:** The command `unitysvc_services` can also be invoked using the shorter alias `usvc`.
30
+
31
+ ## Quick Example
32
+
33
+ ```bash
34
+ # Initialize provider and service (using short alias 'usvc')
35
+ usvc init provider my-provider
36
+ usvc init offering my-service
37
+ usvc init seller my-marketplace
38
+
39
+ # Validate and format
40
+ usvc validate
41
+ usvc format
42
+
43
+ # Test code examples with upstream credentials
44
+ usvc test list --provider fireworks
45
+ usvc test run --provider fireworks --services "llama*"
46
+
47
+ # if you write a script to manage services
48
+ usvc populate
49
+
50
+ # Publish to platform (publishes all: sellers, providers, offerings, listings)
51
+ export UNITYSVC_BASE_URL="https://api.unitysvc.com/api/v1"
52
+ export UNITYSVC_API_KEY="your-api-key"
53
+ usvc publish
54
+
55
+ # Query unitysvc backend to verify data
56
+ usvc query providers --fields id,name,contact_email
57
+ ```
58
+
59
+ ## Key Features
60
+
61
+ - 📋 **Pydantic Models** - Type-safe data models for all entities
62
+ - ✅ **Data Validation** - Comprehensive schema validation
63
+ - 🔄 **Local-First** - Work offline, commit to git, publish when ready
64
+ - 🚀 **CLI Tools** - Complete command-line interface
65
+ - 🤖 **Automation** - Script-based service generation
66
+ - 📝 **Multiple Formats** - Support for JSON and TOML
67
+
68
+ ## Workflows
69
+
70
+ ### Manual Workflow (small catalogs)
71
+
72
+ ```bash
73
+ init → edit files → validate → test → format → publish → verify
74
+ ```
75
+
76
+ ### Automated Workflow (large/dynamic catalogs)
77
+
78
+ ```bash
79
+ init → configure populate script → populate → validate → publish
80
+ ```
81
+
82
+ See [Workflows Documentation](https://unitysvc-services.readthedocs.io/en/latest/workflows/) for details.
83
+
84
+ ## Data Structure
85
+
86
+ ```
87
+ data/
88
+ ├── seller.json # One seller per repo
89
+ ├── ${provider_name}/
90
+ │ ├── provider.json # Provider metadata
91
+ │ ├── docs/ # Shared documentation
92
+ │ └── services/
93
+ │ └── ${service_name}/
94
+ │ ├── service.json # Service offering
95
+ │ └── listing-*.json # Service listing(s)
96
+ ```
97
+
98
+ See [Data Structure Documentation](https://unitysvc-services.readthedocs.io/en/latest/data-structure/) for complete details.
99
+
100
+ ## CLI Commands
101
+
102
+ | Command | Description |
103
+ | ---------- | ------------------------------------------------ |
104
+ | `init` | Initialize new data files from schemas |
105
+ | `list` | List local data files |
106
+ | `query` | Query backend API for published data |
107
+ | `publish` | Publish data to backend |
108
+ | `update` | Update local file fields |
109
+ | `validate` | Validate data consistency |
110
+ | `format` | Format data files |
111
+ | `populate` | Execute provider populate scripts |
112
+ | `test` | Test code examples with upstream API credentials |
113
+
114
+ Run `usvc --help` or see [CLI Reference](https://unitysvc-services.readthedocs.io/en/latest/cli-reference/) for complete documentation.
115
+
116
+ ## Documentation
117
+
118
+ - **[Getting Started](https://unitysvc-services.readthedocs.io/en/latest/getting-started/)** - Installation and first steps
119
+ - **[Data Structure](https://unitysvc-services.readthedocs.io/en/latest/data-structure/)** - File organization rules
120
+ - **[Workflows](https://unitysvc-services.readthedocs.io/en/latest/workflows/)** - Manual and automated patterns
121
+ - **[Documenting Service Listings](https://unitysvc-services.readthedocs.io/en/latest/documenting-services/)** - Add documentation to services
122
+ - **[Creating Code Examples](https://unitysvc-services.readthedocs.io/en/latest/code-examples/)** - Develop and test code examples
123
+ - **[CLI Reference](https://unitysvc-services.readthedocs.io/en/latest/cli-reference/)** - All commands and options
124
+ - **[File Schemas](https://unitysvc-services.readthedocs.io/en/latest/file-schemas/)** - Schema specifications
125
+ - **[Python API](https://unitysvc-services.readthedocs.io/en/latest/api-reference/)** - Programmatic usage
126
+
127
+ ## Links
128
+
129
+ - **PyPI**: https://pypi.org/project/unitysvc-services/
130
+ - **Documentation**: https://unitysvc-services.readthedocs.io
131
+ - **Source Code**: https://github.com/unitysvc/unitysvc-services
132
+ - **Issue Tracker**: https://github.com/unitysvc/unitysvc-services/issues
133
+
134
+ ## License
135
+
136
+ MIT License - see [LICENSE](LICENSE) file for details.
137
+
138
+ ## Contributing
139
+
140
+ Contributions welcome! See [Contributing Guide](https://unitysvc-services.readthedocs.io/en/latest/contributing/) for details.