confkit 2.1.0__tar.gz → 2.2.0__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 (111) hide show
  1. confkit-2.2.0/.github/workflows/bump-version-by-labels.yml +34 -0
  2. confkit-2.2.0/.github/workflows/docs.yml +30 -0
  3. {confkit-2.1.0 → confkit-2.2.0}/.github/workflows/test.yml +16 -0
  4. {confkit-2.1.0 → confkit-2.2.0}/.pre-commit-config.yaml +5 -5
  5. confkit-2.2.0/LICENSE +16 -0
  6. {confkit-2.1.0 → confkit-2.2.0}/PKG-INFO +12 -10
  7. {confkit-2.1.0 → confkit-2.2.0}/README.md +6 -6
  8. {confkit-2.1.0 → confkit-2.2.0}/docs/examples/custom_data_type.md +2 -2
  9. {confkit-2.1.0 → confkit-2.2.0}/docs/examples/data_types.md +2 -2
  10. {confkit-2.1.0 → confkit-2.2.0}/docs/examples/decorators.md +2 -2
  11. confkit-2.2.0/docs/examples/delegate.md +67 -0
  12. {confkit-2.1.0 → confkit-2.2.0}/docs/examples/enums.md +1 -1
  13. {confkit-2.1.0 → confkit-2.2.0}/docs/examples/index.md +2 -1
  14. {confkit-2.1.0 → confkit-2.2.0}/docs/examples/list_types.md +1 -1
  15. {confkit-2.1.0 → confkit-2.2.0}/docs/examples/optional_values.md +1 -1
  16. {confkit-2.1.0 → confkit-2.2.0}/docs/index.md +5 -5
  17. confkit-2.2.0/docs/markdown.md +111 -0
  18. {confkit-2.1.0 → confkit-2.2.0}/docs/reference/config.md +13 -13
  19. confkit-2.2.0/docs/reference/data_types.md +77 -0
  20. {confkit-2.1.0 → confkit-2.2.0}/docs/reference/exceptions.md +2 -2
  21. {confkit-2.1.0 → confkit-2.2.0}/docs/usage.md +7 -7
  22. {confkit-2.1.0 → confkit-2.2.0}/examples/custom_data_type.py +4 -4
  23. confkit-2.2.0/examples/delegate.py +32 -0
  24. {confkit-2.1.0 → confkit-2.2.0}/examples/nested_config.py +2 -2
  25. {confkit-2.1.0 → confkit-2.2.0}/mkdocs.yml +1 -0
  26. {confkit-2.1.0 → confkit-2.2.0}/pyproject.toml +20 -15
  27. {confkit-2.1.0 → confkit-2.2.0}/src/confkit/config.py +36 -36
  28. {confkit-2.1.0 → confkit-2.2.0}/src/confkit/data_types.py +15 -7
  29. confkit-2.2.0/src/confkit/ext/delegate.py +143 -0
  30. {confkit-2.1.0 → confkit-2.2.0}/tests/test_data_types.py +2 -0
  31. confkit-2.2.0/tests/test_delegate.py +168 -0
  32. {confkit-2.1.0 → confkit-2.2.0}/uv.lock +58 -14
  33. confkit-2.2.0/zensical.toml +57 -0
  34. confkit-2.1.0/.github/workflows/bump-version-by-labels.yml +0 -74
  35. confkit-2.1.0/.github/workflows/docs.yml +0 -88
  36. confkit-2.1.0/docs/reference/data_types.md +0 -77
  37. {confkit-2.1.0 → confkit-2.2.0}/.bumpversion.toml +0 -0
  38. {confkit-2.1.0 → confkit-2.2.0}/.github/FUNDING.yml +0 -0
  39. {confkit-2.1.0 → confkit-2.2.0}/.github/copilot-instructions.md +0 -0
  40. {confkit-2.1.0 → confkit-2.2.0}/.github/dependabot.yml +0 -0
  41. {confkit-2.1.0 → confkit-2.2.0}/.github/workflows/coverage.yml +0 -0
  42. {confkit-2.1.0 → confkit-2.2.0}/.github/workflows/gitleaks.yml +0 -0
  43. {confkit-2.1.0 → confkit-2.2.0}/.github/workflows/lint-public.yml +0 -0
  44. {confkit-2.1.0 → confkit-2.2.0}/.github/workflows/lint.yml +0 -0
  45. {confkit-2.1.0 → confkit-2.2.0}/.github/workflows/pypi.yml +0 -0
  46. {confkit-2.1.0 → confkit-2.2.0}/.github/workflows/release.yml +0 -0
  47. {confkit-2.1.0 → confkit-2.2.0}/.gitignore +0 -0
  48. {confkit-2.1.0 → confkit-2.2.0}/.python-version +0 -0
  49. {confkit-2.1.0 → confkit-2.2.0}/.vscode/settings.json +0 -0
  50. {confkit-2.1.0 → confkit-2.2.0}/docs/examples/argparse.md +0 -0
  51. {confkit-2.1.0 → confkit-2.2.0}/docs/examples/basic.md +0 -0
  52. {confkit-2.1.0 → confkit-2.2.0}/docs/reference/notes_two_instances.md +0 -0
  53. {confkit-2.1.0 → confkit-2.2.0}/examples/api.ini +0 -0
  54. {confkit-2.1.0 → confkit-2.2.0}/examples/argparse_example.py +0 -0
  55. {confkit-2.1.0 → confkit-2.2.0}/examples/args.ini +0 -0
  56. {confkit-2.1.0 → confkit-2.2.0}/examples/basic.py +0 -0
  57. {confkit-2.1.0 → confkit-2.2.0}/examples/config.ini +0 -0
  58. {confkit-2.1.0 → confkit-2.2.0}/examples/data_types.py +0 -0
  59. {confkit-2.1.0 → confkit-2.2.0}/examples/database.ini +0 -0
  60. {confkit-2.1.0 → confkit-2.2.0}/examples/decorators.py +0 -0
  61. {confkit-2.1.0 → confkit-2.2.0}/examples/enums.py +0 -0
  62. {confkit-2.1.0 → confkit-2.2.0}/examples/example.json +0 -0
  63. {confkit-2.1.0 → confkit-2.2.0}/examples/example.toml +0 -0
  64. {confkit-2.1.0 → confkit-2.2.0}/examples/example.yaml +0 -0
  65. {confkit-2.1.0 → confkit-2.2.0}/examples/file_change_event.py +0 -0
  66. {confkit-2.1.0 → confkit-2.2.0}/examples/list_types.py +0 -0
  67. {confkit-2.1.0 → confkit-2.2.0}/examples/multiple_configs.py +0 -0
  68. {confkit-2.1.0 → confkit-2.2.0}/examples/nested_example.ini +0 -0
  69. {confkit-2.1.0 → confkit-2.2.0}/examples/nested_example.json +0 -0
  70. {confkit-2.1.0 → confkit-2.2.0}/examples/nested_example.toml +0 -0
  71. {confkit-2.1.0 → confkit-2.2.0}/examples/nested_example.yaml +0 -0
  72. {confkit-2.1.0 → confkit-2.2.0}/examples/optional_values.py +0 -0
  73. {confkit-2.1.0 → confkit-2.2.0}/examples/other_file_types.py +0 -0
  74. {confkit-2.1.0 → confkit-2.2.0}/examples/pydantic_example.py +0 -0
  75. {confkit-2.1.0 → confkit-2.2.0}/examples/references.py +0 -0
  76. {confkit-2.1.0 → confkit-2.2.0}/examples/url_example.py +0 -0
  77. {confkit-2.1.0 → confkit-2.2.0}/ruff.toml +0 -0
  78. {confkit-2.1.0 → confkit-2.2.0}/src/confkit/__init__.py +0 -0
  79. {confkit-2.1.0 → confkit-2.2.0}/src/confkit/exceptions.py +0 -0
  80. {confkit-2.1.0 → confkit-2.2.0}/src/confkit/ext/__init__.py +0 -0
  81. {confkit-2.1.0 → confkit-2.2.0}/src/confkit/ext/parsers.py +0 -0
  82. {confkit-2.1.0 → confkit-2.2.0}/src/confkit/ext/pydantic.py +0 -0
  83. {confkit-2.1.0 → confkit-2.2.0}/src/confkit/ext/reference.py +7 -7
  84. {confkit-2.1.0 → confkit-2.2.0}/src/confkit/parsers.py +0 -0
  85. {confkit-2.1.0 → confkit-2.2.0}/src/confkit/py.typed +0 -0
  86. {confkit-2.1.0 → confkit-2.2.0}/src/confkit/sentinels.py +0 -0
  87. {confkit-2.1.0 → confkit-2.2.0}/src/confkit/watcher.py +0 -0
  88. {confkit-2.1.0 → confkit-2.2.0}/tests/__init__.py +0 -0
  89. {confkit-2.1.0 → confkit-2.2.0}/tests/conftest.py +0 -0
  90. {confkit-2.1.0 → confkit-2.2.0}/tests/test_config.py +0 -0
  91. {confkit-2.1.0 → confkit-2.2.0}/tests/test_config_classvars.py +0 -0
  92. {confkit-2.1.0 → confkit-2.2.0}/tests/test_config_decorators.py +0 -0
  93. {confkit-2.1.0 → confkit-2.2.0}/tests/test_config_detect_parser.py +0 -0
  94. {confkit-2.1.0 → confkit-2.2.0}/tests/test_enum_allowed_values.py +0 -0
  95. {confkit-2.1.0 → confkit-2.2.0}/tests/test_enum_auto_conversion.py +0 -0
  96. {confkit-2.1.0 → confkit-2.2.0}/tests/test_env_parser.py +0 -0
  97. {confkit-2.1.0 → confkit-2.2.0}/tests/test_examples_run.py +0 -0
  98. {confkit-2.1.0 → confkit-2.2.0}/tests/test_list_type.py +0 -0
  99. {confkit-2.1.0 → confkit-2.2.0}/tests/test_metaclass.py +0 -0
  100. {confkit-2.1.0 → confkit-2.2.0}/tests/test_msgspec.py +0 -0
  101. {confkit-2.1.0 → confkit-2.2.0}/tests/test_msgspecparser_branches.py +0 -0
  102. {confkit-2.1.0 → confkit-2.2.0}/tests/test_msgspecparser_no_msgspec.py +0 -0
  103. {confkit-2.1.0 → confkit-2.2.0}/tests/test_msgspecparser_read.py +0 -0
  104. {confkit-2.1.0 → confkit-2.2.0}/tests/test_msgspecparser_sections.py +0 -0
  105. {confkit-2.1.0 → confkit-2.2.0}/tests/test_multiple_configurations.py +0 -0
  106. {confkit-2.1.0 → confkit-2.2.0}/tests/test_nested_config.py +0 -0
  107. {confkit-2.1.0 → confkit-2.2.0}/tests/test_on_file_change.py +0 -0
  108. {confkit-2.1.0 → confkit-2.2.0}/tests/test_pydantic_models.py +0 -0
  109. {confkit-2.1.0 → confkit-2.2.0}/tests/test_sentinel.py +0 -0
  110. {confkit-2.1.0 → confkit-2.2.0}/tests/test_two_instances.py +0 -0
  111. {confkit-2.1.0 → confkit-2.2.0}/tests/test_unreachable_paths.py +0 -0
@@ -0,0 +1,34 @@
1
+ name: Bump Version By Labels
2
+
3
+ on:
4
+ pull_request:
5
+ types: [closed]
6
+ branches:
7
+ - main
8
+ - master
9
+
10
+ jobs:
11
+ bump-version:
12
+ if: github.event.pull_request.merged == true && github.actor != 'github-actions[bot]'
13
+ runs-on: ubuntu-latest
14
+ permissions:
15
+ contents: write
16
+ pull-requests: write
17
+
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ with:
21
+ fetch-depth: 0
22
+
23
+ - name: Install uv
24
+ uses: astral-sh/setup-uv@v4
25
+ with:
26
+ version: "latest"
27
+
28
+ - name: Bump by labels
29
+ uses: HEROgold/bump-by-label@v4.0.0
30
+ with:
31
+ github_token: ${{ secrets.GITHUB_TOKEN }}
32
+ command: "uv version --bump"
33
+ validate: "uv version"
34
+ base_branch: ${{ github.event.pull_request.base.ref }}
@@ -0,0 +1,30 @@
1
+ name: Documentation
2
+ on:
3
+ push:
4
+ branches:
5
+ - master
6
+ - main
7
+ permissions:
8
+ contents: read
9
+ pages: write
10
+ id-token: write
11
+ jobs:
12
+ deploy:
13
+ environment:
14
+ name: github-pages
15
+ url: ${{ steps.deployment.outputs.page_url }}
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v7
19
+ - uses: astral-sh/setup-uv@v7
20
+ with:
21
+ enable-cache: true
22
+ - uses: actions/configure-pages@v6
23
+ - run: uv sync --group docs
24
+ - run: uv run pdoc confkit -o docs/api
25
+ - run: uv run zensical build --clean
26
+ - uses: actions/upload-pages-artifact@v5
27
+ with:
28
+ path: site
29
+ - uses: actions/deploy-pages@v5
30
+ id: deployment
@@ -49,3 +49,19 @@ jobs:
49
49
  if: steps.cache-pytest.outputs.cache-hit != 'true'
50
50
  # Avoid executing examples in CI; they could run untrusted code from PRs
51
51
  run: uv run pytest . --ignore=tests/test_examples_run.py
52
+
53
+ # The test job runs with dev dependencies installed, which can hide a
54
+ # runtime import that isn't declared. Import the built wheel on its own.
55
+ clean-install:
56
+ runs-on: ubuntu-latest
57
+ steps:
58
+ - uses: actions/checkout@v4
59
+
60
+ - name: Install uv
61
+ uses: astral-sh/setup-uv@v7
62
+
63
+ - name: Build the wheel
64
+ run: uv build --wheel -o dist
65
+
66
+ - name: Import it with only its declared dependencies
67
+ run: uv run --isolated --no-project --with dist/*.whl python -c "import confkit"
@@ -6,7 +6,7 @@ default_install_hook_types:
6
6
 
7
7
  repos:
8
8
  - repo: https://github.com/astral-sh/uv-pre-commit
9
- rev: 0.9.26
9
+ rev: 0.13.5
10
10
  hooks:
11
11
  - id: uv-lock
12
12
  stages:
@@ -51,19 +51,19 @@ repos:
51
51
 
52
52
  # Security scanning
53
53
  - repo: https://github.com/gitleaks/gitleaks
54
- rev: v8.24.2
54
+ rev: v8.30.0
55
55
  hooks:
56
56
  - id: gitleaks
57
57
 
58
58
  # Validate packaging metadata early
59
59
  - repo: https://github.com/abravalheri/validate-pyproject
60
- rev: v0.24.1
60
+ rev: v0.27
61
61
  hooks:
62
62
  - id: validate-pyproject
63
63
  stages: [pre-push, pre-commit]
64
64
 
65
65
  - repo: https://github.com/astral-sh/ruff-pre-commit
66
- rev: v0.14.14
66
+ rev: v0.17.2
67
67
  hooks:
68
68
  - id: ruff
69
69
  name: ruff lint
@@ -97,7 +97,7 @@ repos:
97
97
 
98
98
  # Spell checking (global)
99
99
  - repo: https://github.com/shellcheck-py/shellcheck-py
100
- rev: v0.11.0.1
100
+ rev: v0.11.0.1-1
101
101
  hooks:
102
102
  - id: shellcheck
103
103
  stages: [pre-push, pre-commit]
confkit-2.2.0/LICENSE ADDED
@@ -0,0 +1,16 @@
1
+ License
2
+
3
+ Copyright (c) 2026-Present HEROgold
4
+
5
+ NON-COMMERCIAL USE PERMISSION:
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to use, copy, modify, merge, and publish the Software for non-commercial purposes only, subject to the following conditions:
7
+
8
+ 1. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9
+ 2. The Software may not be sublicensed, resold, or used to generate commercial revenue under this non-commercial permission.
10
+
11
+ COMMERCIAL USE REQUIREMENT:
12
+ Any use of the Software (in whole or in part) for commercial purposes, including but not limited to use within a company, corporate environment, commercial group, or by a commercial individual, is strictly prohibited without obtaining explicit written permission.
13
+
14
+ Upon obtaining explicit written permission, the licensee (which may be an individual, a specified group, or an entire legal entity/company, depending on the terms of the purchased license) is granted the right to include, modify, and make use of the Software (in whole or in part) within their commercial operations according to the tier purchased.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,15 +1,17 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: confkit
3
- Version: 2.1.0
3
+ Version: 2.2.0
4
4
  Summary: Lightweight and Easy to use configuration manager for Python projects
5
5
  Author: HEROgold
6
+ License-File: LICENSE
6
7
  Requires-Python: >=3.11
8
+ Requires-Dist: typing-extensions>=4.16.0
7
9
  Provides-Extra: msgspec
8
- Requires-Dist: msgspec>=0.20.0; extra == 'msgspec'
10
+ Requires-Dist: msgspec>=0.22.0; extra == 'msgspec'
9
11
  Requires-Dist: pyyaml>=6.0.3; extra == 'msgspec'
10
12
  Requires-Dist: tomli-w>=1.2.0; extra == 'msgspec'
11
13
  Provides-Extra: pydantic
12
- Requires-Dist: pydantic>=2.12.5; extra == 'pydantic'
14
+ Requires-Dist: pydantic>=2.14.2; extra == 'pydantic'
13
15
  Description-Content-Type: text/markdown
14
16
 
15
17
  # confkit
@@ -34,12 +36,12 @@ This ensures that confkit remains compatible with current Python versions while
34
36
  ## What is it?
35
37
 
36
38
  confkit is a Python library that provides type-safe configuration management with automatic type conversion and validation.
37
- It uses descriptors to define configuration values as class attributes that automatically read from and write to INI files.
39
+ It uses descriptors to define configuration values as class attributes that automatically read from and write to configuration files.
38
40
 
39
41
  ## What does it do?
40
42
 
41
43
  - Type-safe configuration with automatic type conversion
42
- - Automatic INI file management
44
+ - Automatic configuration file management
43
45
  - Default value handling with file persistence
44
46
  - Optional value support
45
47
  - Enum support (Enum, StrEnum, IntEnum, IntFlag)
@@ -92,11 +94,11 @@ uv sync --group docs
92
94
  # Generate API documentation with pdoc
93
95
  uv run pdoc confkit -o docs/api
94
96
 
95
- # Build documentation site with mkdocs
96
- uv run mkdocs build -d site
97
+ # Build documentation site with zensical
98
+ uv run zensical build --clean
97
99
 
98
100
  # Or serve locally for live preview (with auto-reload)
99
- uv run mkdocs serve
101
+ uv run zensical serve
100
102
  ```
101
103
 
102
104
  Documentation is automatically built and deployed to GitHub Pages when changes are pushed to the `master` branch.
@@ -105,5 +107,5 @@ Documentation is automatically built and deployed to GitHub Pages when changes a
105
107
 
106
108
  1. Update relevant `.md` files in `docs/` directory (examples, reference, etc.)
107
109
  2. Run `uv run pdoc confkit -o docs/api` to regenerate API documentation
108
- 3. Preview changes with `uv run mkdocs serve` and verify at `http://127.0.0.1:8000`
110
+ 3. Preview changes with `uv run zensical serve` and verify at `http://127.0.0.1:8000`
109
111
  4. Commit both code and documentation changes together
@@ -20,12 +20,12 @@ This ensures that confkit remains compatible with current Python versions while
20
20
  ## What is it?
21
21
 
22
22
  confkit is a Python library that provides type-safe configuration management with automatic type conversion and validation.
23
- It uses descriptors to define configuration values as class attributes that automatically read from and write to INI files.
23
+ It uses descriptors to define configuration values as class attributes that automatically read from and write to configuration files.
24
24
 
25
25
  ## What does it do?
26
26
 
27
27
  - Type-safe configuration with automatic type conversion
28
- - Automatic INI file management
28
+ - Automatic configuration file management
29
29
  - Default value handling with file persistence
30
30
  - Optional value support
31
31
  - Enum support (Enum, StrEnum, IntEnum, IntFlag)
@@ -78,11 +78,11 @@ uv sync --group docs
78
78
  # Generate API documentation with pdoc
79
79
  uv run pdoc confkit -o docs/api
80
80
 
81
- # Build documentation site with mkdocs
82
- uv run mkdocs build -d site
81
+ # Build documentation site with zensical
82
+ uv run zensical build --clean
83
83
 
84
84
  # Or serve locally for live preview (with auto-reload)
85
- uv run mkdocs serve
85
+ uv run zensical serve
86
86
  ```
87
87
 
88
88
  Documentation is automatically built and deployed to GitHub Pages when changes are pushed to the `master` branch.
@@ -91,5 +91,5 @@ Documentation is automatically built and deployed to GitHub Pages when changes a
91
91
 
92
92
  1. Update relevant `.md` files in `docs/` directory (examples, reference, etc.)
93
93
  2. Run `uv run pdoc confkit -o docs/api` to regenerate API documentation
94
- 3. Preview changes with `uv run mkdocs serve` and verify at `http://127.0.0.1:8000`
94
+ 3. Preview changes with `uv run zensical serve` and verify at `http://127.0.0.1:8000`
95
95
  4. Commit both code and documentation changes together
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- Shows how to create and use a custom [`BaseDataType`](pdoc:confkit.BaseDataType) implementation.
5
+ Shows how to create and use a custom [BaseDataType](/confkit/api/confkit.html#BaseDataType) implementation.
6
6
 
7
7
  - Normalize and persist a value in a consistent representation
8
8
  - Demonstrate the required `convert` method
@@ -20,7 +20,7 @@ Config.set_file(Path("config.ini"))
20
20
 
21
21
  class UpperString(BaseDataType[str]):
22
22
  """String that is always stored / returned in UPPER CASE."""
23
- def convert(self, value: str) -> str: # raw INI -> normalized
23
+ def convert(self, value: str) -> str: # raw configuration -> normalized
24
24
  return str(value).upper()
25
25
 
26
26
  def __str__(self, value: str): # normalized -> persisted string
@@ -5,9 +5,9 @@
5
5
  Showcases the breadth of built-in and helper data types:
6
6
 
7
7
  - Explicit vs implicit (auto-detected) types
8
- - Numeric formatting ([Hex](pdoc:confkit.Hex), [Octal](pdoc:confkit.Octal), [Binary](pdoc:confkit.Binary))
8
+ - Numeric formatting ([Hex](/confkit/api/confkit.html#Hex), [Octal](/confkit/api/confkit.html#Octal), [Binary](/confkit/api/confkit.html#Binary))
9
9
  - Custom base integers (encoded as `<base>c<value>` in the file)
10
- - Bytes → integer conversion via [`Binary`](pdoc:confkit.Binary)
10
+ - Bytes → integer conversion via [Binary](/confkit/api/confkit.html#Binary)
11
11
 
12
12
  ## Running
13
13
 
@@ -4,8 +4,8 @@
4
4
 
5
5
  Shows how to inject configuration values into functions using decorators:
6
6
 
7
- - [`@Config.with_setting(descriptor)`](pdoc:confkit.Config.with_setting) — injects kwarg named after descriptor
8
- - [`@Config.with_kwarg(section, option, kwarg_name, default)`](pdoc:confkit.Config.with_kwarg) — inject by strings + custom kwarg name
7
+ - [@Config.with_setting(descriptor)](/confkit/api/confkit.html#Config.with_setting) — injects kwarg named after descriptor
8
+ - [@Config.with_kwarg(section, option, kwarg_name, default)](/confkit/api/confkit.html#Config.with_kwarg) — inject by strings + custom kwarg name
9
9
 
10
10
  ## Running
11
11
 
@@ -0,0 +1,67 @@
1
+ # Delegate Example ([`delegate.py`](https://github.com/HEROgold/confkit/blob/master/examples/delegate.py))
2
+
3
+ ## Purpose
4
+
5
+ Shows how one setting can read and write a setting in another config file, so that file holds the only copy of the value.
6
+
7
+ ## Key Concepts
8
+
9
+ - `Delegate(Settings.dashboard_url)` passes reads and writes through to `Settings.dashboard_url`
10
+ - The delegate stores nothing, so its own file gets no key for it
11
+ - Type checkers see the delegate with the target's type
12
+
13
+ ## Running
14
+
15
+ ```bash
16
+ uv run python examples/delegate.py
17
+ ```
18
+
19
+ ## Code
20
+
21
+ The bot and the dashboard both read `app.ini`. Only the dashboard reads `dashboard.ini`. The dashboard's public address lives in `app.ini`, and `dashboard.ini` refers to it:
22
+
23
+ ```python
24
+ from pathlib import Path
25
+ from typing import TypeVar
26
+
27
+ from confkit.config import Config
28
+ from confkit.ext.delegate import Delegate
29
+
30
+ T = TypeVar("T")
31
+ class AppConfig(Config[T]): ...
32
+ class DashboardConfig(Config[T]): ...
33
+
34
+ AppConfig.set_file(Path("app.ini"))
35
+ DashboardConfig.set_file(Path("dashboard.ini"))
36
+
37
+ class Settings:
38
+ dashboard_url = AppConfig("http://localhost:8001")
39
+
40
+ class DashboardSettings:
41
+ session_key = DashboardConfig("change-me")
42
+ public_url = Delegate(Settings.dashboard_url)
43
+ ```
44
+
45
+ ## Generated Files
46
+
47
+ `app.ini` holds the value:
48
+
49
+ ```ini
50
+ [Settings]
51
+ dashboard_url = http://localhost:8001
52
+ ```
53
+
54
+ `dashboard.ini` has no `public_url` key:
55
+
56
+ ```ini
57
+ [DashboardSettings]
58
+ session_key = change-me
59
+ ```
60
+
61
+ ## Notes
62
+
63
+ - Reading `DashboardSettings.public_url` reads the `dashboard_url` key in `app.ini`.
64
+ - `DashboardSettings().public_url = "https://dashboard.example.com"` writes the `dashboard_url` key in `app.ini`.
65
+ - A delegate can point at another delegate. Both read and write the same key.
66
+ - Pass a plain attribute read of a `Config` setting, like `Settings.dashboard_url` or `module.Settings.dashboard_url`. A literal or a computed value such as `Settings.dashboard_url + "/callback"` raises `TypeError`.
67
+ - `Delegate` finds the target by reading the caller's bytecode, so it runs on CPython only.
@@ -4,7 +4,7 @@
4
4
 
5
5
  Demonstrates enum support:
6
6
 
7
- - [`StrEnum`](pdoc:confkit.StrEnum), [`IntEnum`](pdoc:confkit.IntEnum), [`IntFlag`](pdoc:confkit.IntFlag), usage via dedicated data types
7
+ - [StrEnum](/confkit/api/confkit.html#StrEnum), [IntEnum](/confkit/api/confkit.html#IntEnum), [IntFlag](/confkit/api/confkit.html#IntFlag), usage via dedicated data types
8
8
  - Optional enum values
9
9
  - Bitwise flag composition (`Permission`)
10
10
  - **Self-documenting config files** with inline comments showing all allowed enum values
@@ -16,7 +16,7 @@ All examples assume you are in the project root and have dependencies installed
16
16
  uv run python examples/basic.py
17
17
  ```
18
18
 
19
- > If you are editing examples and want immediate persistence, remember that [`Config.write_on_edit`](pdoc:confkit.Config.write_on_edit) defaults to `True` unless explicitly disabled.
19
+ > If you are editing examples and want immediate persistence, remember that [Config.write_on_edit](/confkit/api/confkit.html#Config.write_on_edit) defaults to `True` unless explicitly disabled.
20
20
 
21
21
  ## Example Categories
22
22
 
@@ -29,5 +29,6 @@ uv run python examples/basic.py
29
29
  | Enums | [Enums](enums.md) | StrEnum, IntEnum, IntFlag, optional enum values |
30
30
  | Decorators | [Decorators](decorators.md) | Injecting config into functions |
31
31
  | argparse Integration | [Argparse](argparse.md) | CLI defaults + config separation |
32
+ | Delegates | [Delegate](delegate.md) | Reading and writing a setting in another file |
32
33
 
33
34
  Select an example in the navigation to dive in.
@@ -30,7 +30,7 @@ empty_list =
30
30
 
31
31
  ## Notes
32
32
 
33
- - See [`List.separator`](pdoc:confkit.List.separator) and [`List.escape_char`](pdoc:confkit.List.escape_char) for their default values (explicitly set in the example for clarity).
33
+ - See [List.separator](/confkit/api/confkit.html#List.separator) and [List.escape_char](/confkit/api/confkit.html#List.escape_char) for their default values (explicitly set in the example for clarity).
34
34
  - Items containing the separator are escaped when written, then unescaped on read.
35
35
  - An explicit empty list with a declared data type stays as a blank line after the equals sign.
36
36
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  Demonstrates nullable / optional configuration patterns:
6
6
 
7
- - `optional=True` shorthand vs [`Optional(...)`](pdoc:confkit.Optional) wrapper
7
+ - `optional=True` shorthand vs [Optional(...)](/confkit/api/confkit.html#Optional) wrapper
8
8
  - Optional enums, strings, integers
9
9
  - Empty string vs None semantics
10
10
  - Cascading defaults & fallback logic
@@ -10,7 +10,7 @@ This landing page orients you quickly:
10
10
  | Create a custom data type | Usage Guide: [Adding a New Data Type](usage.md#adding-a-new-data-type) |
11
11
  | See all data type converters | [Reference: Data Types](reference/data_types.md) |
12
12
  | Decorator utilities | [Usage: Decorators Overview](usage.md#decorators-overview) |
13
- | API by symbol | [Generated API (pdoc)](pdoc:confkit) |
13
+ | API by symbol | [Generated API (pdoc)](/confkit/api/confkit.html) |
14
14
  | Contribute / issues | GitHub Repo: [HEROgold/confkit](https://github.com/HEROgold/confkit) |
15
15
 
16
16
  ---
@@ -49,7 +49,7 @@ uv run pytest -q
49
49
  uv run ruff check .
50
50
  uv sync --group docs
51
51
  uv run pdoc confkit -o docs/api
52
- uv run mkdocs build -d site
52
+ uv run zensical build --clean
53
53
  ```
54
54
 
55
55
  Before opening a PR, ensure:
@@ -82,13 +82,13 @@ Two complementary views:
82
82
 
83
83
  ### Full symbol index (pdoc)
84
84
 
85
- [confkit API](pdoc:confkit)
85
+ [confkit API](/confkit/api/confkit.html)
86
86
 
87
87
  Use `(pdoc:qual.name)` style links inside docs for deep, stable symbol links
88
88
 
89
89
  ```md
90
- The [MyClass](pdoc:mypackage.MyClass) class is awesome.
91
- The [do_something](pdoc:mypackage.MyClass.do_something) method is awesome.
90
+ The [MyClass](/confkit/api/confkit.html#mypackage.MyClass) class is awesome.
91
+ The [do_something](/confkit/api/confkit.html#mypackage.MyClass.do_something) method is awesome.
92
92
  The [](mypackage.MyClass) class is awesome.
93
93
  ```
94
94
 
@@ -0,0 +1,111 @@
1
+ ---
2
+ icon: simple/markdown
3
+ ---
4
+
5
+ # Markdown in 5min
6
+
7
+ ## Headers
8
+
9
+ ```
10
+ # H1 Header
11
+ ## H2 Header
12
+ ### H3 Header
13
+ #### H4 Header
14
+ ##### H5 Header
15
+ ###### H6 Header
16
+ ```
17
+
18
+ ## Text formatting
19
+
20
+ ```
21
+ **bold text**
22
+ *italic text*
23
+ ***bold and italic***
24
+ ~~strikethrough~~
25
+ `inline code`
26
+ ```
27
+
28
+ ## Links and images
29
+
30
+ ```
31
+ [Link text](https://example.com)
32
+ [Link with title](https://example.com "Hover title")
33
+ ![Alt text](image.jpg)
34
+ ![Image with title](image.jpg "Image title")
35
+ ```
36
+
37
+ ## Lists
38
+
39
+ ```
40
+ Unordered:
41
+
42
+ - Item 1
43
+ - Item 2
44
+ - Nested item
45
+
46
+ Ordered:
47
+
48
+ 1. First item
49
+ 2. Second item
50
+ 3. Third item
51
+ ```
52
+
53
+ ## Blockquotes
54
+
55
+ ```
56
+ > This is a blockquote
57
+ > Multiple lines
58
+ >> Nested quote
59
+ ```
60
+
61
+ ## Code blocks
62
+
63
+ ````
64
+ ```javascript
65
+ function hello() {
66
+ console.log("Hello, world!");
67
+ }
68
+ ```
69
+ ````
70
+
71
+ ## Tables
72
+
73
+ ```
74
+ | Header 1 | Header 2 | Header 3 |
75
+ |----------|----------|----------|
76
+ | Row 1 | Data | Data |
77
+ | Row 2 | Data | Data |
78
+ ```
79
+
80
+ ## Horizontal rule
81
+
82
+ ```
83
+ ---
84
+ or
85
+ ***
86
+ or
87
+ ___
88
+ ```
89
+
90
+ ## Task lists
91
+
92
+ ```
93
+ - [x] Completed task
94
+ - [ ] Incomplete task
95
+ - [ ] Another task
96
+ ```
97
+
98
+ ## Escaping characters
99
+
100
+ ```
101
+ Use backslash to escape: \* \_ \# \`
102
+ ```
103
+
104
+ ## Line breaks
105
+
106
+ ```
107
+ End a line with two spaces
108
+ to create a line break.
109
+
110
+ Or use a blank line for a new paragraph.
111
+ ```
@@ -8,31 +8,31 @@ This section provides curated guidance around the core `Config` descriptor and i
8
8
 
9
9
  ## Core Class
10
10
 
11
- - [`Config`](pdoc:confkit.Config) – Descriptor managing reading/writing typed values.
11
+ - [Config](/confkit/api/confkit.html#Config) – Descriptor managing reading/writing typed values.
12
12
 
13
13
  ## Lifecycle / Initialization Helpers
14
14
 
15
- - [`Config.set_parser`](pdoc:confkit.Config.set_parser)
16
- - [`Config.set_file`](pdoc:confkit.Config.set_file)
17
- - [`Config.write`](pdoc:confkit.Config.write)
15
+ - [Config.set_parser](/confkit/api/confkit.html#Config.set_parser)
16
+ - [Config.set_file](/confkit/api/confkit.html#Config.set_file)
17
+ - [Config.write](/confkit/api/confkit.html#Config.write)
18
18
 
19
19
  ## Runtime Flags
20
20
 
21
- - [`Config.validate_types`](pdoc:confkit.Config.validate_types)
22
- - [`Config.write_on_edit`](pdoc:confkit.Config.write_on_edit)
21
+ - [Config.validate_types](/confkit/api/confkit.html#Config.validate_types)
22
+ - [Config.write_on_edit](/confkit/api/confkit.html#Config.write_on_edit)
23
23
 
24
24
  ## Decorators
25
25
 
26
- - [`Config.set`](pdoc:confkit.Config.set) – Always set a value before calling a function.
27
- - [`Config.default`](pdoc:confkit.Config.default) – Set only when unset.
28
- - [`Config.with_setting`](pdoc:confkit.Config.with_setting) – Inject an existing descriptor value as a kwarg.
29
- - [`Config.with_kwarg`](pdoc:confkit.Config.with_kwarg) – (Named `with_kwarg` in code; often described as `with_kwarg`) inject by section/setting with optional rename & default.
26
+ - [Config.set](/confkit/api/confkit.html#Config.set) – Always set a value before calling a function.
27
+ - [Config.default](/confkit/api/confkit.html#Config.default) – Set only when unset.
28
+ - [Config.with_setting](/confkit/api/confkit.html#Config.with_setting) – Inject an existing descriptor value as a kwarg.
29
+ - [Config.with_kwarg](/confkit/api/confkit.html#Config.with_kwarg) – (Named `with_kwarg` in code; often described as `with_kwarg`) inject by section/setting with optional rename & default.
30
30
 
31
31
  ## Internal Validation (Selected)
32
32
 
33
- - [`Config.validate_file`](pdoc:confkit.Config.validate_file)
34
- - [`Config.validate_parser`](pdoc:confkit.Config.validate_parser)
35
- - [`Config.validate_strict_type`](pdoc:confkit.Config.validate_strict_type)
33
+ - [Config.validate_file](/confkit/api/confkit.html#Config.validate_file)
34
+ - [Config.validate_parser](/confkit/api/confkit.html#Config.validate_parser)
35
+ - [Config.validate_strict_type](/confkit/api/confkit.html#Config.validate_strict_type)
36
36
 
37
37
  > Tip: Use the decorators for imperative flows and prefer descriptor attributes for normal configuration access.
38
38
  >
@@ -0,0 +1,77 @@
1
+ ---
2
+ title: Data Types
3
+ ---
4
+
5
+ # Data Types
6
+
7
+ confkit uses a family of small converter classes to provide type safety and round‑trip serialization.
8
+
9
+ ## Base Type
10
+
11
+ - [BaseDataType](/confkit/api/confkit.html#BaseDataType)
12
+ - [BaseDataType.convert](/confkit/api/confkit.html#BaseDataType.convert)
13
+ - [BaseDataType.validate](/confkit/api/confkit.html#BaseDataType.validate)
14
+ - [BaseDataType.cast](/confkit/api/confkit.html#BaseDataType.cast)
15
+ - [BaseDataType.cast_optional](/confkit/api/confkit.html#BaseDataType.cast_optional)
16
+
17
+ ## Primitive Converters
18
+
19
+ - [String](/confkit/api/confkit.html#String)
20
+ - [Integer](/confkit/api/confkit.html#Integer)
21
+ - [Float](/confkit/api/confkit.html#Float)
22
+ - [Boolean](/confkit/api/confkit.html#Boolean)
23
+ - [NoneType](/confkit/api/confkit.html#NoneType)
24
+
25
+ ## Enum Converters
26
+
27
+ - [Enum](/confkit/api/confkit.html#Enum)
28
+ - [StrEnum](/confkit/api/confkit.html#StrEnum)
29
+ - [IntEnum](/confkit/api/confkit.html#IntEnum)
30
+ - [IntFlag](/confkit/api/confkit.html#IntFlag)
31
+
32
+ All enum types automatically display allowed values as inline comments in the config file, making them self-documenting for end-users. For example:
33
+
34
+ ```ini
35
+ log_level = info # allowed: debug, info, warning, error
36
+ ```
37
+
38
+ The format varies by enum type:
39
+ - **StrEnum**: Shows member values (e.g., `debug, info, warning, error`)
40
+ - **IntEnum/IntFlag**: Shows member names with integer values (e.g., `LOW(0), MEDIUM(5), HIGH(10)`)
41
+ - **Enum**: Shows member names (e.g., `DEBUG, INFO, WARNING, ERROR`)
42
+
43
+ Comments are automatically stripped when reading values, ensuring they don't interfere with parsing.
44
+
45
+ ## Number Representation Helpers
46
+
47
+ - [Hex](/confkit/api/confkit.html#Hex)
48
+ - [Octal](/confkit/api/confkit.html#Octal)
49
+ - [Binary](/confkit/api/confkit.html#Binary)
50
+
51
+ ## Optional & Composite
52
+
53
+ - [Optional](/confkit/api/confkit.html#Optional)
54
+ - [List](/confkit/api/confkit.html#List)
55
+
56
+ > Design note: `Optional` wraps another `BaseDataType` and returns `None` when a null sentinel is parsed.
57
+
58
+ ## Collections
59
+
60
+ - [Tuple](/confkit/api/confkit.html#Tuple)
61
+ - [Set](/confkit/api/confkit.html#Set)
62
+ - [Dict](/confkit/api/confkit.html#Dict)
63
+
64
+ `Tuple`, `Set`, and `Dict` mirror their built‑in counterparts. Allowing for collections to be stored in configuration files.
65
+
66
+ ## Date & Time
67
+
68
+ - [DateTime](/confkit/api/confkit.html#DateTime)
69
+ - [Date](/confkit/api/confkit.html#Date)
70
+ - [Time](/confkit/api/confkit.html#Time)
71
+ - [TimeDelta](/confkit/api/confkit.html#TimeDelta)
72
+
73
+ `DateTime`, `Date`, `Time` and `TimeDelta` mirror their built-in counterparts. Allowing to store date information in configuration files.
74
+
75
+ ## Custom Type Example
76
+
77
+ - [BaseDataType](/confkit/api/confkit.html#BaseDataType)