jsoncompat 0.2.0__cp311-cp311-win32.whl → 0.2.2__cp311-cp311-win32.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.
- jsoncompat/__init__.pyi +12 -0
- jsoncompat/jsoncompat.cp311-win32.pyd +0 -0
- jsoncompat/py.typed +0 -0
- jsoncompat-0.2.2.dist-info/METADATA +3 -0
- jsoncompat-0.2.2.dist-info/RECORD +7 -0
- {jsoncompat-0.2.0.dist-info → jsoncompat-0.2.2.dist-info}/WHEEL +1 -1
- jsoncompat-0.2.0.dist-info/METADATA +0 -50
- jsoncompat-0.2.0.dist-info/RECORD +0 -5
jsoncompat/__init__.pyi
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""Typing stubs for jsoncompat Python package"""
|
|
2
|
+
|
|
3
|
+
from typing import Literal
|
|
4
|
+
|
|
5
|
+
RoleLiteral = Literal["serializer", "deserializer", "both"]
|
|
6
|
+
|
|
7
|
+
def check_compat(
|
|
8
|
+
old_schema_json: str, new_schema_json: str, role: RoleLiteral = "both"
|
|
9
|
+
) -> bool: ...
|
|
10
|
+
def generate_value(schema_json: str, depth: int = 5) -> str: ...
|
|
11
|
+
|
|
12
|
+
__all__: list[str]
|
|
Binary file
|
jsoncompat/py.typed
ADDED
|
File without changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
jsoncompat-0.2.2.dist-info/METADATA,sha256=SfBp5NCxVjT4CKLN3m91wv3Jbzi1O2nLi4kelpSJ-do,54
|
|
2
|
+
jsoncompat-0.2.2.dist-info/WHEEL,sha256=xmiRaBht0eEJE1zYnxdX9S1O56yBhJDP3NkHBaHiWYU,92
|
|
3
|
+
jsoncompat/__init__.py,sha256=ZUOY1iQLG1MYhHB0Ar0BHk1097DhPkrkw3tO_pjKKRs,123
|
|
4
|
+
jsoncompat/__init__.pyi,sha256=AK3av1e2xVPsVW5GPZeWXRKfNvZAWXVsRD9IftPlJM4,344
|
|
5
|
+
jsoncompat/jsoncompat.cp311-win32.pyd,sha256=FVFlUH7RNwm3DLxfcv165LvGB9Qo0WNxwhCJNXsSr9U,2927616
|
|
6
|
+
jsoncompat/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
jsoncompat-0.2.2.dist-info/RECORD,,
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: jsoncompat
|
|
3
|
-
Version: 0.2.0
|
|
4
|
-
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
5
|
-
|
|
6
|
-
# jsoncompat
|
|
7
|
-
|
|
8
|
-
JSON Schema Compatibility Checker Python Bindings
|
|
9
|
-
|
|
10
|
-
Check compatibility of evolving JSON schemas and generate example values using Python.
|
|
11
|
-
|
|
12
|
-
## Installation
|
|
13
|
-
|
|
14
|
-
Install from PyPI:
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
pip install jsoncompat
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Usage
|
|
21
|
-
|
|
22
|
-
```python
|
|
23
|
-
import jsoncompat as jsc
|
|
24
|
-
|
|
25
|
-
# Define old and new schemas as JSON strings
|
|
26
|
-
old_schema = '{"type": "string"}'
|
|
27
|
-
new_schema = '{"type": "number"}'
|
|
28
|
-
|
|
29
|
-
# Check compatibility (role: "serializer", "deserializer", or "both")
|
|
30
|
-
is_compatible = jsc.check_compat(old_schema, new_schema, "both")
|
|
31
|
-
print(is_compatible)
|
|
32
|
-
|
|
33
|
-
# Generate an example value for a schema
|
|
34
|
-
example = jsc.generate_value(old_schema, depth=5)
|
|
35
|
-
print(example)
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
## API Reference
|
|
39
|
-
|
|
40
|
-
- `check_compat(old_schema_json: str, new_schema_json: str, role: str = "both") -> bool`
|
|
41
|
-
- `generate_value(schema_json: str, depth: int = 5) -> str`
|
|
42
|
-
|
|
43
|
-
## Examples
|
|
44
|
-
|
|
45
|
-
See the [basic demo](../examples/python/basic/demo.py) for a complete end-to-end script.
|
|
46
|
-
|
|
47
|
-
## License
|
|
48
|
-
|
|
49
|
-
MIT License. See [LICENSE](../LICENSE).
|
|
50
|
-
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
jsoncompat-0.2.0.dist-info/METADATA,sha256=Cf6FkkL9WawtCpzjMZwxZVN8jylx6TMUxMYscEKM9SI,1145
|
|
2
|
-
jsoncompat-0.2.0.dist-info/WHEEL,sha256=zfc_r7GoDDc6Hz8pkKR77dEQzJMJDgktYOCKUorzovQ,92
|
|
3
|
-
jsoncompat/__init__.py,sha256=ZUOY1iQLG1MYhHB0Ar0BHk1097DhPkrkw3tO_pjKKRs,123
|
|
4
|
-
jsoncompat/jsoncompat.cp311-win32.pyd,sha256=iE1lkhMxhLxNau8KIH2ugMiOA2urQTD8pWsTxOK9YLk,2918912
|
|
5
|
-
jsoncompat-0.2.0.dist-info/RECORD,,
|