unitysvc-services 0.2.4__tar.gz → 0.2.6__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 (60) hide show
  1. {unitysvc_services-0.2.4/src/unitysvc_services.egg-info → unitysvc_services-0.2.6}/PKG-INFO +1 -1
  2. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/docs/data-structure.md +10 -2
  3. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/docs/file-schemas.md +11 -0
  4. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/pyproject.toml +1 -1
  5. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/src/unitysvc_services/models/listing_v1.py +6 -6
  6. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/src/unitysvc_services/publisher.py +4 -0
  7. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/src/unitysvc_services/query.py +6 -17
  8. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6/src/unitysvc_services.egg-info}/PKG-INFO +1 -1
  9. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/CONTRIBUTING.md +0 -0
  10. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/HISTORY.md +0 -0
  11. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/LICENSE +0 -0
  12. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/MANIFEST.in +0 -0
  13. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/README.md +0 -0
  14. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/docs/api-reference.md +0 -0
  15. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/docs/cli-reference.md +0 -0
  16. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/docs/contributing.md +0 -0
  17. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/docs/development.md +0 -0
  18. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/docs/getting-started.md +0 -0
  19. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/docs/index.md +0 -0
  20. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/docs/installation.md +0 -0
  21. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/docs/usage.md +0 -0
  22. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/docs/workflows.md +0 -0
  23. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/setup.cfg +0 -0
  24. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/src/unitysvc_services/__init__.py +0 -0
  25. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/src/unitysvc_services/cli.py +0 -0
  26. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/src/unitysvc_services/format_data.py +0 -0
  27. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/src/unitysvc_services/list.py +0 -0
  28. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/src/unitysvc_services/models/__init__.py +0 -0
  29. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/src/unitysvc_services/models/base.py +0 -0
  30. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/src/unitysvc_services/models/provider_v1.py +0 -0
  31. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/src/unitysvc_services/models/seller_v1.py +0 -0
  32. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/src/unitysvc_services/models/service_v1.py +0 -0
  33. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/src/unitysvc_services/populate.py +0 -0
  34. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/src/unitysvc_services/py.typed +0 -0
  35. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/src/unitysvc_services/scaffold.py +0 -0
  36. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/src/unitysvc_services/update.py +0 -0
  37. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/src/unitysvc_services/utils.py +0 -0
  38. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/src/unitysvc_services/validator.py +0 -0
  39. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/src/unitysvc_services.egg-info/SOURCES.txt +0 -0
  40. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/src/unitysvc_services.egg-info/dependency_links.txt +0 -0
  41. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/src/unitysvc_services.egg-info/entry_points.txt +0 -0
  42. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/src/unitysvc_services.egg-info/requires.txt +0 -0
  43. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/src/unitysvc_services.egg-info/top_level.txt +0 -0
  44. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/tests/__init__.py +0 -0
  45. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/tests/example_data/README.md +0 -0
  46. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/tests/example_data/provider1/README.md +0 -0
  47. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/tests/example_data/provider1/provider.toml +0 -0
  48. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/tests/example_data/provider1/services/service1/code-example.md +0 -0
  49. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/tests/example_data/provider1/services/service1/service.toml +0 -0
  50. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/tests/example_data/provider1/services/service1/svcreseller.toml +0 -0
  51. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/tests/example_data/provider1/terms-of-service.md +0 -0
  52. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/tests/example_data/provider2/README.md +0 -0
  53. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/tests/example_data/provider2/provider.json +0 -0
  54. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/tests/example_data/provider2/services/service2/code-example.md +0 -0
  55. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/tests/example_data/provider2/services/service2/service.json +0 -0
  56. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/tests/example_data/provider2/services/service2/svcreseller.json +0 -0
  57. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/tests/example_data/provider2/terms-of-service.md +0 -0
  58. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/tests/example_data/seller.json +0 -0
  59. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/tests/test_utils.py +0 -0
  60. {unitysvc_services-0.2.4 → unitysvc_services-0.2.6}/tests/test_validator.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: unitysvc-services
3
- Version: 0.2.4
3
+ Version: 0.2.6
4
4
  Summary: SDK for digital service providers on UnitySVC
5
5
  Author-email: Bo Peng <bo.peng@unitysvc.com>
6
6
  Maintainer-email: Bo Peng <bo.peng@unitysvc.com>
@@ -80,6 +80,13 @@ data/
80
80
  - Location: `${provider_name}/services/${service_name}/listing-*.json`
81
81
  - Both offerings and listings are defined in the same service directory under the provider
82
82
 
83
+ #### Multiple Listings Per Service
84
+ When a single service offering has multiple listings (e.g., different pricing tiers, different marketplaces), the filename becomes significant:
85
+
86
+ - **Filename as identifier**: If the `name` field is not provided in the listing file, the filename (without extension) is automatically used as the listing name
87
+ - **Example**: `listing-premium.json`, `listing-basic.json`, `listing-enterprise.json` for different tiers
88
+ - **Best practice**: Use descriptive filenames that indicate the listing variant, or explicitly set the `name` field in each file
89
+
83
90
  ### 7. External Files (Documentation, Code Examples, etc.)
84
91
  - External files like code examples, documentation, images can be placed anywhere in the directory structure
85
92
  - They are referenced by **relative paths** from the referencing file
@@ -181,10 +188,11 @@ data/
181
188
  │ └── services/
182
189
  │ ├── gpt-4/ # Service: "gpt-4"
183
190
  │ │ ├── service.json # name = "gpt-4"
184
- │ │ └── listing-svcreseller.json # seller_name = "svcreseller"
191
+ │ │ ├── listing-premium.json # name = "listing-premium" (or defaults to filename)
192
+ │ │ └── listing-basic.json # name = "listing-basic" (multiple listings for one service)
185
193
  │ └── gpt-3.5-turbo/ # Service: "gpt-3.5-turbo"
186
194
  │ ├── service.json # name = "gpt-3.5-turbo"
187
- │ └── listing-svcreseller.json
195
+ │ └── listing-svcreseller.json # Single listing
188
196
  └── anthropic/ # Provider: "anthropic"
189
197
  ├── provider.json # name = "anthropic"
190
198
  └── services/
@@ -194,6 +194,7 @@ Listing files define how a seller presents/sells a service (downstream/marketpla
194
194
  | Field | Type | Description |
195
195
  |-------|------|-------------|
196
196
  | `schema` | string | Must be `"listing_v1"` |
197
+ | `name` | string | Listing identifier (defaults to filename without extension if not provided) |
197
198
  | `seller_name` | string | Seller identifier (references seller file) |
198
199
  | `listing_status` | string | Listing status (see Status Values) |
199
200
 
@@ -209,6 +210,15 @@ Listing files define how a seller presents/sells a service (downstream/marketpla
209
210
  | `documents` | array | Documentation files |
210
211
  | `tags` | array | Search/filter tags |
211
212
 
213
+ ### Listing Name Field
214
+
215
+ The `name` field identifies the listing and is especially important when multiple listings exist for a single service offering:
216
+
217
+ - **Automatic naming**: If the `name` field is not provided, the SDK automatically uses the filename (without extension) as the listing name
218
+ - **Multiple listings**: When you have multiple listings for one service (e.g., different tiers or marketplaces), use descriptive filenames
219
+ - **Example**: A file named `listing-premium.json` will automatically get `name = "listing-premium"` if the field is omitted
220
+ - **Best practice**: Use explicit `name` fields for clarity, or use descriptive filenames that will serve as meaningful listing identifiers
221
+
212
222
  ### listing_status Values
213
223
 
214
224
  - `unknown` - Status not yet determined
@@ -223,6 +233,7 @@ Listing files define how a seller presents/sells a service (downstream/marketpla
223
233
 
224
234
  ```toml
225
235
  schema = "listing_v1"
236
+ name = "listing-premium"
226
237
  seller_name = "svcreseller"
227
238
  service_name = "gpt-4"
228
239
  listing_status = "in_service"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "unitysvc-services"
3
- version = "0.2.4"
3
+ version = "0.2.6"
4
4
  description = "SDK for digital service providers on UnitySVC"
5
5
  readme = "README.md"
6
6
  authors = [{ name = "Bo Peng", email = "bo.peng@unitysvc.com" }]
@@ -3,12 +3,7 @@ from typing import Any
3
3
 
4
4
  from pydantic import BaseModel, ConfigDict, Field
5
5
 
6
- from unitysvc_services.models.base import (
7
- AccessInterface,
8
- Document,
9
- ListingStatusEnum,
10
- Pricing,
11
- )
6
+ from unitysvc_services.models.base import AccessInterface, Document, ListingStatusEnum, Pricing
12
7
 
13
8
 
14
9
  class ListingV1(BaseModel):
@@ -32,6 +27,11 @@ class ListingV1(BaseModel):
32
27
 
33
28
  seller_name: str | None = Field(default=None, description="Name of the seller offering this service listing")
34
29
 
30
+ name: str | None = Field(
31
+ default=None,
32
+ max_length=255,
33
+ description="Name identifier for the service listing, default to filename",
34
+ )
35
35
  # unique name for each provider, usually following upstream naming convention
36
36
  # status of the service, public, deprecated etc
37
37
  listing_status: ListingStatusEnum = Field(
@@ -159,6 +159,10 @@ class ServiceDataPublisher:
159
159
  # Load the listing data file
160
160
  data = self.load_data_file(data_file)
161
161
 
162
+ # If name is not provided, use filename (without extension)
163
+ if "name" not in data or not data.get("name"):
164
+ data["name"] = data_file.stem
165
+
162
166
  # Resolve file references and include content
163
167
  base_path = data_file.parent
164
168
  data_with_content = self.resolve_file_references(data, base_path)
@@ -46,10 +46,7 @@ class ServiceDataQuery:
46
46
  skip: Number of records to skip (for pagination)
47
47
  limit: Maximum number of records to return
48
48
  """
49
- response = self.client.get(
50
- f"{self.base_url}/publish/offerings",
51
- params={"skip": skip, "limit": limit}
52
- )
49
+ response = self.client.get(f"{self.base_url}/publish/offerings", params={"skip": skip, "limit": limit})
53
50
  response.raise_for_status()
54
51
  result = response.json()
55
52
  return result.get("data", result) if isinstance(result, dict) else result
@@ -61,10 +58,7 @@ class ServiceDataQuery:
61
58
  skip: Number of records to skip (for pagination)
62
59
  limit: Maximum number of records to return
63
60
  """
64
- response = self.client.get(
65
- f"{self.base_url}/publish/listings",
66
- params={"skip": skip, "limit": limit}
67
- )
61
+ response = self.client.get(f"{self.base_url}/publish/listings", params={"skip": skip, "limit": limit})
68
62
  response.raise_for_status()
69
63
  result = response.json()
70
64
  return result.get("data", result) if isinstance(result, dict) else result
@@ -76,10 +70,7 @@ class ServiceDataQuery:
76
70
  skip: Number of records to skip (for pagination)
77
71
  limit: Maximum number of records to return
78
72
  """
79
- response = self.client.get(
80
- f"{self.base_url}/publish/providers",
81
- params={"skip": skip, "limit": limit}
82
- )
73
+ response = self.client.get(f"{self.base_url}/publish/providers", params={"skip": skip, "limit": limit})
83
74
  response.raise_for_status()
84
75
  result = response.json()
85
76
  return result.get("data", result) if isinstance(result, dict) else result
@@ -91,10 +82,7 @@ class ServiceDataQuery:
91
82
  skip: Number of records to skip (for pagination)
92
83
  limit: Maximum number of records to return
93
84
  """
94
- response = self.client.get(
95
- f"{self.base_url}/publish/sellers",
96
- params={"skip": skip, "limit": limit}
97
- )
85
+ response = self.client.get(f"{self.base_url}/publish/sellers", params={"skip": skip, "limit": limit})
98
86
  response.raise_for_status()
99
87
  result = response.json()
100
88
  return result.get("data", result) if isinstance(result, dict) else result
@@ -590,7 +578,7 @@ def query_listings(
590
578
 
591
579
  # Show all available fields
592
580
  unitysvc_services query listings --fields \\
593
- id,service_name,service_type,seller_name,listing_type,status,provider_name
581
+ id,name,service_name,service_type,seller_name,listing_type,status,provider_name
594
582
  """
595
583
  # Parse fields list
596
584
  field_list = [f.strip() for f in fields.split(",")]
@@ -598,6 +586,7 @@ def query_listings(
598
586
  # Define allowed fields from ServiceListingPublic model
599
587
  allowed_fields = {
600
588
  "id",
589
+ "name",
601
590
  "offering_id",
602
591
  "offering_status",
603
592
  "seller_id",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: unitysvc-services
3
- Version: 0.2.4
3
+ Version: 0.2.6
4
4
  Summary: SDK for digital service providers on UnitySVC
5
5
  Author-email: Bo Peng <bo.peng@unitysvc.com>
6
6
  Maintainer-email: Bo Peng <bo.peng@unitysvc.com>