vtjson 2.1.6__py3-none-any.whl → 2.1.7__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.
vtjson/vtjson.py CHANGED
@@ -121,7 +121,7 @@ class SchemaError(Exception):
121
121
  pass
122
122
 
123
123
 
124
- __version__ = "2.1.6"
124
+ __version__ = "2.1.7"
125
125
 
126
126
 
127
127
  @dataclass
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vtjson
3
- Version: 2.1.6
3
+ Version: 2.1.7
4
4
  Summary: A lightweight package for validating JSON like Python objects
5
5
  Author-email: Michel Van den Bergh <michel.vandenbergh@uhasselt.be>
6
6
  Project-URL: Homepage, https://github.com/vdbergh/vtjson
@@ -189,11 +189,12 @@ A consequence of this algorithm is that non-const keys are automatically optiona
189
189
  `vtjson` recognizes the following type hints as schemas.
190
190
 
191
191
  ```python
192
- Annotated, dict[...], Dict[...], list[...], List[...], tuple[...], Tuple[...],
193
- Protocol, NamedTuple, Literal, NewType, TypedDict, Union (or the equivalent operator |).
192
+ Annotated, Mapping[...,...] and subtypes, Container[...] and subtypes,
193
+ tuple[...], Tuple[...], Protocol, NamedTuple, Literal, NewType, TypedDict,
194
+ Union (or the equivalent operator |), Any.
194
195
  ```
195
196
 
196
- For example `dict[str, str]` is translated internally into the schema `{str: str}`. See below for more information.
197
+ For example `Mapping[str, str]` is translated internally into the schema `{str: str}`. See below for more information.
197
198
 
198
199
  ### Annotated
199
200
 
@@ -270,16 +271,18 @@ Note that Python imposes strong restrictions on what constitutes a valid type hi
270
271
 
271
272
  - `NewType` is translated into a `set_name` schema. E.g. `NewType('Movie', str)` becomes `set_name(str, 'Movie')`
272
273
 
273
- - `dict[...]` and `Dict[...]` are translated into the equivalent `dict` schemas. E.g. `dict[str, str]` becomes `{str: str}`.
274
-
275
274
  - `tuple[...]` and `Tuple[...]` are translated into the equivalent `tuple` schemas.
276
275
 
277
- - `list[...]` and `List[...]` are translated into the equivalent `list` schemas.
276
+ - `Mapping[..., ...]` and subtypes are translated into the equivalent `dict` schemas combined with a membership check of the origin type. E.g. `dict[str, str]` becomes `{str: str}`.
277
+
278
+ - `Container[str]` and subtypes are translated into the equivalent `list` schema combined with a membership check of the origin type.
278
279
 
279
280
  - `Union` and the `|` operator are translated into `union`.
280
281
 
281
282
  - `Literal` is also translated into `union`.
282
283
 
284
+ - `Any` is translated into `anything`.
285
+
283
286
  ### Apply objects
284
287
 
285
288
  - If the list of arguments of an Annotated schema includes Apply objects then those modify the treatement of the arguments that come before them. We already encountered `skip_first` which is a built-in alias for `Apply(skip_first=True)`. The full signature of `Apply` is
@@ -0,0 +1,9 @@
1
+ vtjson/__init__.py,sha256=oLX4JH6_R7dYtTiGfBG3pQGR21IArspifdmZilbuGOw,68
2
+ vtjson/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ vtjson/vtjson.py,sha256=zkHwqJ7s1Dxe3YGapzNMgoh1BmyTedBdScqqMVIJckw,69567
4
+ vtjson-2.1.7.dist-info/AUTHORS,sha256=qmxaXxaIO-YPNHJAZ0dcCrnPCs1x9ocbtMksiy4i80M,21
5
+ vtjson-2.1.7.dist-info/LICENSE,sha256=n7xW-zX8xBLHzCdqWIMRuMzBD_ACLcNCwio0LEkKt1o,1077
6
+ vtjson-2.1.7.dist-info/METADATA,sha256=BPrO0yLcfip5BUfH3aL5E5hbIwkkpk7Tlz-L4zNZ-cA,24228
7
+ vtjson-2.1.7.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
8
+ vtjson-2.1.7.dist-info/top_level.txt,sha256=9DlSF3l63igcvnYPcj117F2hzOW4Nx0N-JBoW3jjBZM,7
9
+ vtjson-2.1.7.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- vtjson/__init__.py,sha256=oLX4JH6_R7dYtTiGfBG3pQGR21IArspifdmZilbuGOw,68
2
- vtjson/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- vtjson/vtjson.py,sha256=UO58eUc0yShJ9Nm8zvhc3egHUzfLcLXdlj2TpKxtmYE,69567
4
- vtjson-2.1.6.dist-info/AUTHORS,sha256=qmxaXxaIO-YPNHJAZ0dcCrnPCs1x9ocbtMksiy4i80M,21
5
- vtjson-2.1.6.dist-info/LICENSE,sha256=n7xW-zX8xBLHzCdqWIMRuMzBD_ACLcNCwio0LEkKt1o,1077
6
- vtjson-2.1.6.dist-info/METADATA,sha256=-PFoASAchEaDMOxJfx8icFTmVMxbfLFEkK9btIfWn28,24054
7
- vtjson-2.1.6.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
8
- vtjson-2.1.6.dist-info/top_level.txt,sha256=9DlSF3l63igcvnYPcj117F2hzOW4Nx0N-JBoW3jjBZM,7
9
- vtjson-2.1.6.dist-info/RECORD,,
File without changes