TOML+ — extended configuration format (Rust-backed)
Project description
tomlplus (Python)
Python bindings for the TOML+ language core — same API as the pure-Python
tomlplus package, but the parser/validator/serialiser is the Rust core
shared with the LSP server.
Install (from source)
pip install maturin
cd crates/tomlplus-python
maturin develop --release # installs into the active env
maturin develop compiles the Rust crate and installs a wheel into the
currently-active Python environment. Use maturin build --release to
produce a redistributable .whl in target/wheels/.
Usage
Identical to the original package:
import tomlplus
doc = tomlplus.loads('''
[server]
@type: int
@min: 1
@max: 65535
port = $ENV.PORT ?? 8080
''')
doc["server"]["port"] # 8080
doc.resolve("server.port") # 8080
doc.has_annotation("server.port", "type") # True
tomlplus.validate(doc) # raises ValidationError on failure
print(tomlplus.dumps(doc)) # round-trip back to TOML+
API
loads(source) -> TOMLPlusDocumentload(path) -> TOMLPlusDocumentloads_validated(source) -> TOMLPlusDocumentload_validated(path) -> TOMLPlusDocumentdumps(doc_or_dict) -> strvalidate(doc) -> None— raises on first failurevalidate_all(doc) -> list[ValidationError]- Classes:
TOMLPlusDocument,Annotation - Exceptions:
TOMLPlusError,ParseError,ValidationError,VariableError
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tomlplus-1.0.0-cp38-abi3-win_amd64.whl.
File metadata
- Download URL: tomlplus-1.0.0-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 322.0 kB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6dbe72c735c40fb58d36be4fca746e1be58d3ad170b07aad241325cde8ee3e86
|
|
| MD5 |
23d0a09e0641622eeb9af3b20712e6fd
|
|
| BLAKE2b-256 |
305fb7cc16e497c3c6ef4e2462b57e6206311d89b0cbc9bfe43d1bf8242ab93f
|
File details
Details for the file tomlplus-1.0.0-cp38-abi3-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: tomlplus-1.0.0-cp38-abi3-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 411.4 kB
- Tags: CPython 3.8+, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ced7e3b6d962cab222af82fc375ab9dfc231af0c322a46ec0e7689e1b16712b
|
|
| MD5 |
4e25e033ddc05fbc47e63d1f99ecb91b
|
|
| BLAKE2b-256 |
7adf76d7aec80052d3460983934e49fb3ca858e8b7f09eb74cc7953fa01edd16
|
File details
Details for the file tomlplus-1.0.0-cp38-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: tomlplus-1.0.0-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 371.4 kB
- Tags: CPython 3.8+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8f1badde02b56b2a84ed656bc47a5a296db0fd238ad96c9a781c7b2f36684a2
|
|
| MD5 |
f8ed2385e2d42d14b56bda480dc37536
|
|
| BLAKE2b-256 |
f12efdf5322abcc2ecae43287885da15c6d34af52dc160e55dfcb09e20fce65c
|