dictify 5.0.0__tar.gz → 5.0.2__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 (26) hide show
  1. {dictify-5.0.0 → dictify-5.0.2}/PKG-INFO +4 -3
  2. {dictify-5.0.0 → dictify-5.0.2}/README.md +1 -1
  3. {dictify-5.0.0 → dictify-5.0.2}/pyproject.toml +4 -3
  4. {dictify-5.0.0 → dictify-5.0.2}/src/dictify/_field.py +2 -2
  5. {dictify-5.0.0 → dictify-5.0.2}/src/dictify/_model.py +0 -8
  6. {dictify-5.0.0 → dictify-5.0.2}/src/dictify/_types.py +2 -2
  7. {dictify-5.0.0 → dictify-5.0.2}/src/dictify/ai_skills/dictify-usage/references/usage/cli-inputs.md +2 -2
  8. {dictify-5.0.0 → dictify-5.0.2}/src/dictify/ai_skills/dictify-usage/references/usage/model.md +3 -1
  9. {dictify-5.0.0 → dictify-5.0.2}/LICENSE +0 -0
  10. {dictify-5.0.0 → dictify-5.0.2}/src/dictify/__init__.py +0 -0
  11. {dictify-5.0.0 → dictify-5.0.2}/src/dictify/_sentinel.py +0 -0
  12. {dictify-5.0.0 → dictify-5.0.2}/src/dictify/_utils.py +0 -0
  13. {dictify-5.0.0 → dictify-5.0.2}/src/dictify/ai_skills/dictify-usage/SKILL.md +0 -0
  14. {dictify-5.0.0 → dictify-5.0.2}/src/dictify/ai_skills/dictify-usage/agents/openai.yaml +0 -0
  15. {dictify-5.0.0 → dictify-5.0.2}/src/dictify/ai_skills/dictify-usage/references/field-api/index.md +0 -0
  16. {dictify-5.0.0 → dictify-5.0.2}/src/dictify/ai_skills/dictify-usage/references/field-api/listof.md +0 -0
  17. {dictify-5.0.0 → dictify-5.0.2}/src/dictify/ai_skills/dictify-usage/references/field-api/options.md +0 -0
  18. {dictify-5.0.0 → dictify-5.0.2}/src/dictify/ai_skills/dictify-usage/references/field-api/state.md +0 -0
  19. {dictify-5.0.0 → dictify-5.0.2}/src/dictify/ai_skills/dictify-usage/references/field-api/validators.md +0 -0
  20. {dictify-5.0.0 → dictify-5.0.2}/src/dictify/ai_skills/dictify-usage/references/index.md +0 -0
  21. {dictify-5.0.0 → dictify-5.0.2}/src/dictify/ai_skills/dictify-usage/references/usage/declaration-styles.md +0 -0
  22. {dictify-5.0.0 → dictify-5.0.2}/src/dictify/ai_skills/dictify-usage/references/usage/index.md +0 -0
  23. {dictify-5.0.0 → dictify-5.0.2}/src/dictify/ai_skills/dictify-usage/references/usage/partial-validation.md +0 -0
  24. {dictify-5.0.0 → dictify-5.0.2}/src/dictify/ai_skills/dictify-usage/references/validation-recipes/index.md +0 -0
  25. {dictify-5.0.0 → dictify-5.0.2}/src/dictify/cli/__init__.py +0 -0
  26. {dictify-5.0.0 → dictify-5.0.2}/src/dictify/cli/dictify.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dictify
3
- Version: 5.0.0
3
+ Version: 5.0.2
4
4
  Summary: Documents schema and data validation
5
5
  Author: Nitipit Nontasuwan
6
6
  Author-email: Nitipit Nontasuwan <nitipit@gmail.com>
@@ -8,11 +8,12 @@ License-Expression: MIT
8
8
  License-File: LICENSE
9
9
  Classifier: Programming Language :: Python :: 3
10
10
  Classifier: Programming Language :: Python :: 3 :: Only
11
+ Classifier: Programming Language :: Python :: 3.11
11
12
  Classifier: Programming Language :: Python :: 3.12
12
13
  Classifier: License :: OSI Approved :: MIT License
13
14
  Classifier: Operating System :: OS Independent
14
15
  Requires-Dist: cyclopts>=4.0.0,<5.0.0
15
- Requires-Python: >=3.12
16
+ Requires-Python: >=3.11
16
17
  Project-URL: Homepage, https://keenlycode.github.io/dictify/
17
18
  Project-URL: Documentation, https://keenlycode.github.io/dictify/
18
19
  Project-URL: Source, https://github.com/keenlycode/dictify
@@ -26,7 +27,7 @@ Lightweight validation for Python mappings and JSON-like documents.
26
27
 
27
28
  Dictify provides standalone field validation and annotation-first `Model` classes for dict-shaped data. It keeps mapping access and attribute access together, validates assignments, supports strict or permissive unknown-key handling, and converts models back to plain Python data.
28
29
 
29
- - Python `3.12+`
30
+ - Python `3.11+`
30
31
  - `Field(...)` for defaults, required fields, and validators
31
32
  - `Model` for mapping-shaped schemas
32
33
  - `dict(model)` for shallow conversion, `model.dict()` for recursive conversion
@@ -4,7 +4,7 @@ Lightweight validation for Python mappings and JSON-like documents.
4
4
 
5
5
  Dictify provides standalone field validation and annotation-first `Model` classes for dict-shaped data. It keeps mapping access and attribute access together, validates assignments, supports strict or permissive unknown-key handling, and converts models back to plain Python data.
6
6
 
7
- - Python `3.12+`
7
+ - Python `3.11+`
8
8
  - `Field(...)` for defaults, required fields, and validators
9
9
  - `Model` for mapping-shaped schemas
10
10
  - `dict(model)` for shallow conversion, `model.dict()` for recursive conversion
@@ -4,10 +4,10 @@ build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "dictify"
7
- version = "5.0.0"
7
+ version = "5.0.2"
8
8
  description = "Documents schema and data validation"
9
9
  readme = "README.md"
10
- requires-python = ">=3.12"
10
+ requires-python = ">=3.11"
11
11
  dependencies = ["cyclopts>=4.0.0,<5.0.0"]
12
12
  license = "MIT"
13
13
  license-files = ["LICENSE"]
@@ -17,6 +17,7 @@ authors = [
17
17
  classifiers = [
18
18
  "Programming Language :: Python :: 3",
19
19
  "Programming Language :: Python :: 3 :: Only",
20
+ "Programming Language :: Python :: 3.11",
20
21
  "Programming Language :: Python :: 3.12",
21
22
  "License :: OSI Approved :: MIT License",
22
23
  "Operating System :: OS Independent",
@@ -51,7 +52,7 @@ docs = [
51
52
  testpaths = ["tests"]
52
53
 
53
54
  [tool.ruff]
54
- target-version = "py312"
55
+ target-version = "py311"
55
56
  src = ["src", "tests"]
56
57
 
57
58
  [tool.ruff.lint]
@@ -4,7 +4,7 @@ from __future__ import annotations
4
4
 
5
5
  import re
6
6
  from functools import wraps
7
- from typing import TYPE_CHECKING, Any, Self, cast, overload
7
+ from typing import TYPE_CHECKING, Any, Generic, Self, cast, overload
8
8
 
9
9
  from ._sentinel import UNDEF
10
10
  from ._types import DefaultFactory, T, Validator
@@ -144,7 +144,7 @@ class ListOf(list):
144
144
  return data
145
145
 
146
146
 
147
- class Field[T]:
147
+ class Field(Generic[T]):
148
148
  """Create ``Field()`` object which can validate it's value.
149
149
  Can be defined in class ``Model``.
150
150
 
@@ -95,14 +95,6 @@ class Model(MutableMapping[str, Any]):
95
95
  default=cls._signature_default(field),
96
96
  )
97
97
  )
98
- parameters.append(
99
- Parameter(
100
- "_strict",
101
- Parameter.KEYWORD_ONLY,
102
- annotation=bool,
103
- default=True,
104
- )
105
- )
106
98
  return Signature(parameters)
107
99
 
108
100
  @classmethod
@@ -19,9 +19,9 @@ DataDict = dict[str, Any]
19
19
 
20
20
  #: Mapping of field names to declared ``Field`` definitions.
21
21
  if TYPE_CHECKING:
22
- type FieldMap = dict[str, Field[Any]]
22
+ FieldMap = dict[str, Field[Any]]
23
23
  else:
24
- type FieldMap = dict[str, Any]
24
+ FieldMap = dict[str, Any]
25
25
 
26
26
  #: Mapping of field names to resolved runtime type annotations.
27
27
  FieldTypeMap = dict[str, Any]
@@ -40,10 +40,10 @@ Tools can inspect a model class and discover its fields.
40
40
  ```python
41
41
  import inspect
42
42
 
43
- assert str(inspect.signature(CreateUser)) == "(*, name: str, email: str, _strict: bool = True)"
43
+ assert str(inspect.signature(CreateUser)) == "(*, name: str, email: str)"
44
44
  ```
45
45
 
46
- Required fields appear without defaults. Fields with `Field(default=...)` expose that default in the signature. `_strict` remains the Dictify constructor option for controlling unknown keys and attributes.
46
+ Required fields appear without defaults. Fields with `Field(default=...)` expose that default in the signature. `_strict` remains the Dictify constructor option for controlling unknown keys and attributes, but it is hidden from generated public signatures so signature-driven tools expose declared model fields only.
47
47
 
48
48
  ## Cyclopts example
49
49
 
@@ -72,9 +72,11 @@ User(username="user", email="user@example.com")
72
72
  ```python
73
73
  import inspect
74
74
 
75
- assert str(inspect.signature(User)) == "(*, username: str, email: str, _strict: bool = True)"
75
+ assert str(inspect.signature(User)) == "(*, username: str, email: str)"
76
76
  ```
77
77
 
78
+ The advanced `_strict` constructor keyword remains accepted at runtime, but it is intentionally hidden from generated public signatures so signature-driven tools expose declared model fields only.
79
+
78
80
  ## Post Validation
79
81
 
80
82
  Override `post_validate()` when validation depends on multiple fields.
File without changes
File without changes
File without changes