shcl 1.0.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.
- shcl-1.0.0/PKG-INFO +79 -0
- shcl-1.0.0/README.md +55 -0
- shcl-1.0.0/pyproject.toml +45 -0
- shcl-1.0.0/setup.cfg +4 -0
- shcl-1.0.0/shcl.egg-info/PKG-INFO +79 -0
- shcl-1.0.0/shcl.egg-info/SOURCES.txt +7 -0
- shcl-1.0.0/shcl.egg-info/dependency_links.txt +1 -0
- shcl-1.0.0/shcl.egg-info/top_level.txt +1 -0
- shcl-1.0.0/shcl.py +2963 -0
shcl-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: shcl
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: SHCL - Simple Hierarchical Config Language. Parser, accessor, writer, and formatter.
|
|
5
|
+
Author: Jim Collier
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/jim-collier/shcl
|
|
8
|
+
Project-URL: Source, https://github.com/jim-collier/shcl
|
|
9
|
+
Project-URL: Issues, https://github.com/jim-collier/shcl/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/jim-collier/shcl/blob/main/changelog.md
|
|
11
|
+
Keywords: config,configuration,parser,shcl
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Classifier: Topic :: Text Processing :: General
|
|
22
|
+
Requires-Python: >=3.9
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
# shcl
|
|
26
|
+
|
|
27
|
+
**S**imple **H**ierarchical **C**onfig **L**anguage. Forgiving to write, predictable to read.
|
|
28
|
+
|
|
29
|
+
Values are stored as plain text and coerced only when *your* code asks for a type, so a config file can never silently decide that `NO` means `false`. A bad line is skipped or repaired with a diagnostic instead of taking down the whole file.
|
|
30
|
+
|
|
31
|
+
Pure standard library, no dependencies, one module. Held byte-for-byte against the Rust reference by a shared conformance corpus.
|
|
32
|
+
|
|
33
|
+
## Install
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
pip install shcl
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Use
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
from shcl import Document, Status
|
|
43
|
+
|
|
44
|
+
with open("server.shcl", encoding="utf-8") as f:
|
|
45
|
+
doc = Document.parse(f.read())
|
|
46
|
+
|
|
47
|
+
# One call, a typed value, a visible fallback at the call site.
|
|
48
|
+
limit = doc.get_int("site[example.com].max-upload-mb", default=10)
|
|
49
|
+
|
|
50
|
+
# Or ask why a read failed: Good, Empty, NotFound, BadType, Multiple.
|
|
51
|
+
r = doc.read_int("site[example.com].max-upload-mb")
|
|
52
|
+
if r.status is not Status.Good:
|
|
53
|
+
print(r.status, r.raw)
|
|
54
|
+
|
|
55
|
+
# Wildcards read across instances, with a status per slot.
|
|
56
|
+
roots = doc.read_string_array("site[*].root")
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
`Document.parse` never raises. When you want a hard error instead, use `Document.parse_with(text, Strictness.Strict)`, which raises `LoadError`. A `get_*` call with no `default=` raises `StatusError` rather than inventing a value.
|
|
60
|
+
|
|
61
|
+
Also here: `merge` for layered config (defaults, site, user), `validate` against a schema that is itself a SHCL file, a full writer, and a canonical formatter that preserves comments.
|
|
62
|
+
|
|
63
|
+
Python 3.9 or newer.
|
|
64
|
+
|
|
65
|
+
## Compatibility
|
|
66
|
+
|
|
67
|
+
Bindings are versioned in lockstep, so `1.x` is the same behavior in every language. `shcl~=1.0` picks up minor and patch releases on its own and never crosses a major version.
|
|
68
|
+
|
|
69
|
+
## The CLI
|
|
70
|
+
|
|
71
|
+
This package is the library only. The `shcl` command ships as a prebuilt binary and as `.deb`/`.rpm`/Windows packages - see <https://github.com/jim-collier/shcl>.
|
|
72
|
+
|
|
73
|
+
## Docs
|
|
74
|
+
|
|
75
|
+
Language spec, formal grammar, and the other bindings: <https://github.com/jim-collier/shcl>
|
|
76
|
+
|
|
77
|
+
## License
|
|
78
|
+
|
|
79
|
+
MIT. SHCL™ is a trademark of Jim Collier - see the [trademark policy](https://github.com/jim-collier/shcl/blob/main/trademark.md).
|
shcl-1.0.0/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# shcl
|
|
2
|
+
|
|
3
|
+
**S**imple **H**ierarchical **C**onfig **L**anguage. Forgiving to write, predictable to read.
|
|
4
|
+
|
|
5
|
+
Values are stored as plain text and coerced only when *your* code asks for a type, so a config file can never silently decide that `NO` means `false`. A bad line is skipped or repaired with a diagnostic instead of taking down the whole file.
|
|
6
|
+
|
|
7
|
+
Pure standard library, no dependencies, one module. Held byte-for-byte against the Rust reference by a shared conformance corpus.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
pip install shcl
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Use
|
|
16
|
+
|
|
17
|
+
```python
|
|
18
|
+
from shcl import Document, Status
|
|
19
|
+
|
|
20
|
+
with open("server.shcl", encoding="utf-8") as f:
|
|
21
|
+
doc = Document.parse(f.read())
|
|
22
|
+
|
|
23
|
+
# One call, a typed value, a visible fallback at the call site.
|
|
24
|
+
limit = doc.get_int("site[example.com].max-upload-mb", default=10)
|
|
25
|
+
|
|
26
|
+
# Or ask why a read failed: Good, Empty, NotFound, BadType, Multiple.
|
|
27
|
+
r = doc.read_int("site[example.com].max-upload-mb")
|
|
28
|
+
if r.status is not Status.Good:
|
|
29
|
+
print(r.status, r.raw)
|
|
30
|
+
|
|
31
|
+
# Wildcards read across instances, with a status per slot.
|
|
32
|
+
roots = doc.read_string_array("site[*].root")
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
`Document.parse` never raises. When you want a hard error instead, use `Document.parse_with(text, Strictness.Strict)`, which raises `LoadError`. A `get_*` call with no `default=` raises `StatusError` rather than inventing a value.
|
|
36
|
+
|
|
37
|
+
Also here: `merge` for layered config (defaults, site, user), `validate` against a schema that is itself a SHCL file, a full writer, and a canonical formatter that preserves comments.
|
|
38
|
+
|
|
39
|
+
Python 3.9 or newer.
|
|
40
|
+
|
|
41
|
+
## Compatibility
|
|
42
|
+
|
|
43
|
+
Bindings are versioned in lockstep, so `1.x` is the same behavior in every language. `shcl~=1.0` picks up minor and patch releases on its own and never crosses a major version.
|
|
44
|
+
|
|
45
|
+
## The CLI
|
|
46
|
+
|
|
47
|
+
This package is the library only. The `shcl` command ships as a prebuilt binary and as `.deb`/`.rpm`/Windows packages - see <https://github.com/jim-collier/shcl>.
|
|
48
|
+
|
|
49
|
+
## Docs
|
|
50
|
+
|
|
51
|
+
Language spec, formal grammar, and the other bindings: <https://github.com/jim-collier/shcl>
|
|
52
|
+
|
|
53
|
+
## License
|
|
54
|
+
|
|
55
|
+
MIT. SHCL™ is a trademark of Jim Collier - see the [trademark policy](https://github.com/jim-collier/shcl/blob/main/trademark.md).
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
## Packaging metadata for the PyPI distribution. The library is one stdlib-only
|
|
2
|
+
## module, so there is no package tree to discover - py-modules names it outright,
|
|
3
|
+
## which also stops setuptools auto-discovering cmd/ and tests/ as packages.
|
|
4
|
+
##
|
|
5
|
+
## Only the library ships here. The CLI is distributed as a prebuilt binary and
|
|
6
|
+
## in the .deb/.rpm/NSIS packages, so there is no console_scripts entry point and
|
|
7
|
+
## cmd/ stays out of the wheel.
|
|
8
|
+
##
|
|
9
|
+
## NOTE: this version is a fifth site to bump at a release cut, alongside the four
|
|
10
|
+
## CLI ones. Cargo.toml stays canonical.
|
|
11
|
+
|
|
12
|
+
[build-system]
|
|
13
|
+
requires = ["setuptools>=77"]
|
|
14
|
+
build-backend = "setuptools.build_meta"
|
|
15
|
+
|
|
16
|
+
[project]
|
|
17
|
+
name = "shcl"
|
|
18
|
+
version = "1.0.0"
|
|
19
|
+
description = "SHCL - Simple Hierarchical Config Language. Parser, accessor, writer, and formatter."
|
|
20
|
+
readme = "README.md"
|
|
21
|
+
requires-python = ">=3.9"
|
|
22
|
+
license = "MIT"
|
|
23
|
+
authors = [{ name = "Jim Collier" }]
|
|
24
|
+
keywords = ["config", "configuration", "parser", "shcl"]
|
|
25
|
+
classifiers = [
|
|
26
|
+
"Development Status :: 5 - Production/Stable",
|
|
27
|
+
"Intended Audience :: Developers",
|
|
28
|
+
"Programming Language :: Python :: 3",
|
|
29
|
+
"Programming Language :: Python :: 3.9",
|
|
30
|
+
"Programming Language :: Python :: 3.10",
|
|
31
|
+
"Programming Language :: Python :: 3.11",
|
|
32
|
+
"Programming Language :: Python :: 3.12",
|
|
33
|
+
"Programming Language :: Python :: 3.13",
|
|
34
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
35
|
+
"Topic :: Text Processing :: General",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
[project.urls]
|
|
39
|
+
Homepage = "https://github.com/jim-collier/shcl"
|
|
40
|
+
Source = "https://github.com/jim-collier/shcl"
|
|
41
|
+
Issues = "https://github.com/jim-collier/shcl/issues"
|
|
42
|
+
Changelog = "https://github.com/jim-collier/shcl/blob/main/changelog.md"
|
|
43
|
+
|
|
44
|
+
[tool.setuptools]
|
|
45
|
+
py-modules = ["shcl"]
|
shcl-1.0.0/setup.cfg
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: shcl
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: SHCL - Simple Hierarchical Config Language. Parser, accessor, writer, and formatter.
|
|
5
|
+
Author: Jim Collier
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/jim-collier/shcl
|
|
8
|
+
Project-URL: Source, https://github.com/jim-collier/shcl
|
|
9
|
+
Project-URL: Issues, https://github.com/jim-collier/shcl/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/jim-collier/shcl/blob/main/changelog.md
|
|
11
|
+
Keywords: config,configuration,parser,shcl
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Classifier: Topic :: Text Processing :: General
|
|
22
|
+
Requires-Python: >=3.9
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
# shcl
|
|
26
|
+
|
|
27
|
+
**S**imple **H**ierarchical **C**onfig **L**anguage. Forgiving to write, predictable to read.
|
|
28
|
+
|
|
29
|
+
Values are stored as plain text and coerced only when *your* code asks for a type, so a config file can never silently decide that `NO` means `false`. A bad line is skipped or repaired with a diagnostic instead of taking down the whole file.
|
|
30
|
+
|
|
31
|
+
Pure standard library, no dependencies, one module. Held byte-for-byte against the Rust reference by a shared conformance corpus.
|
|
32
|
+
|
|
33
|
+
## Install
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
pip install shcl
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Use
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
from shcl import Document, Status
|
|
43
|
+
|
|
44
|
+
with open("server.shcl", encoding="utf-8") as f:
|
|
45
|
+
doc = Document.parse(f.read())
|
|
46
|
+
|
|
47
|
+
# One call, a typed value, a visible fallback at the call site.
|
|
48
|
+
limit = doc.get_int("site[example.com].max-upload-mb", default=10)
|
|
49
|
+
|
|
50
|
+
# Or ask why a read failed: Good, Empty, NotFound, BadType, Multiple.
|
|
51
|
+
r = doc.read_int("site[example.com].max-upload-mb")
|
|
52
|
+
if r.status is not Status.Good:
|
|
53
|
+
print(r.status, r.raw)
|
|
54
|
+
|
|
55
|
+
# Wildcards read across instances, with a status per slot.
|
|
56
|
+
roots = doc.read_string_array("site[*].root")
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
`Document.parse` never raises. When you want a hard error instead, use `Document.parse_with(text, Strictness.Strict)`, which raises `LoadError`. A `get_*` call with no `default=` raises `StatusError` rather than inventing a value.
|
|
60
|
+
|
|
61
|
+
Also here: `merge` for layered config (defaults, site, user), `validate` against a schema that is itself a SHCL file, a full writer, and a canonical formatter that preserves comments.
|
|
62
|
+
|
|
63
|
+
Python 3.9 or newer.
|
|
64
|
+
|
|
65
|
+
## Compatibility
|
|
66
|
+
|
|
67
|
+
Bindings are versioned in lockstep, so `1.x` is the same behavior in every language. `shcl~=1.0` picks up minor and patch releases on its own and never crosses a major version.
|
|
68
|
+
|
|
69
|
+
## The CLI
|
|
70
|
+
|
|
71
|
+
This package is the library only. The `shcl` command ships as a prebuilt binary and as `.deb`/`.rpm`/Windows packages - see <https://github.com/jim-collier/shcl>.
|
|
72
|
+
|
|
73
|
+
## Docs
|
|
74
|
+
|
|
75
|
+
Language spec, formal grammar, and the other bindings: <https://github.com/jim-collier/shcl>
|
|
76
|
+
|
|
77
|
+
## License
|
|
78
|
+
|
|
79
|
+
MIT. SHCL™ is a trademark of Jim Collier - see the [trademark policy](https://github.com/jim-collier/shcl/blob/main/trademark.md).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
shcl
|