You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Added PyYAML dependency (pyyaml>=6.0,<7)
- Extended file reader to support .yaml and .yml extensions
- Implemented format-aware file loading (YAML vs JSON)
- Updated all class references in files_reader.py to use Gts* names
- Added comprehensive format support documentation
- Documented TypeSpec pre-compilation workflow
YAML files are automatically detected and parsed. TypeSpec requires
external compilation to JSON Schema before use.
Copy file name to clipboardExpand all lines: gts/README.md
+45-3Lines changed: 45 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,48 @@
1
1
# GTS Python Library
2
2
3
-
A minimal, idiomatic Python library for working with **GTS** ([Global Type System](https://github.com/gts-spec/gts-spec)) identifiers and JSON/JSON Schema artifacts.
3
+
A minimal, idiomatic Python library for working with **GTS** ([Global Type System](https://github.com/gts-spec/gts-spec)) identifiers and type definitions.
4
+
5
+
## File Format Support
6
+
7
+
GTS Python supports multiple file formats for schemas and instances:
8
+
9
+
### JSON (Native)
10
+
Standard JSON format with `.json`, `.jsonc`, and `.gts` extensions.
11
+
12
+
### YAML
13
+
Full YAML support with `.yaml` and `.yml` extensions. YAML files are automatically parsed and treated identically to JSON.
14
+
15
+
```python
16
+
from gts import GtsFileReader
17
+
18
+
# Reads both JSON and YAML files
19
+
reader = GtsFileReader("path/to/schemas/")
20
+
for entity in reader:
21
+
print(f"{entity.gts_id.id}: {entity.file.name}")
22
+
```
23
+
24
+
### TypeSpec
25
+
TypeSpec (`.tsp`) schemas must be pre-compiled to JSON Schema before use with gts-python.
0 commit comments