Skip to main content

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) -> TOMLPlusDocument
  • load(path) -> TOMLPlusDocument
  • loads_validated(source) -> TOMLPlusDocument
  • load_validated(path) -> TOMLPlusDocument
  • dumps(doc_or_dict) -> str
  • validate(doc) -> None — raises on first failure
  • validate_all(doc) -> list[ValidationError]
  • Classes: TOMLPlusDocument, Annotation
  • Exceptions: TOMLPlusError, ParseError, ValidationError, VariableError

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tomlplus-2.0.0rc2-cp38-abi3-win_amd64.whl (322.1 kB view details)

Uploaded CPython 3.8+Windows x86-64

tomlplus-2.0.0rc2-cp38-abi3-manylinux_2_34_x86_64.whl (411.4 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.34+ x86-64

tomlplus-2.0.0rc2-cp38-abi3-macosx_11_0_arm64.whl (371.5 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

File details

Details for the file tomlplus-2.0.0rc2-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: tomlplus-2.0.0rc2-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 322.1 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

Hashes for tomlplus-2.0.0rc2-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 d35f7229ccac15ec074e5afff97e0eb195865fb8bacc9e4551eb4dd268f80e15
MD5 a74bf05a353939653174b41f508a7d0b
BLAKE2b-256 12d105077c5f6cc001bbbfc8bcbf110eedf31f2250e0a3156626ee5225b1452a

See more details on using hashes here.

File details

Details for the file tomlplus-2.0.0rc2-cp38-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for tomlplus-2.0.0rc2-cp38-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 26971993719d8cd651be798c3a2d2db472b65aa2bde4be067faff4e1c494fe41
MD5 8c6c4009ffe2ebffbd08387a9e3678dd
BLAKE2b-256 0c56d4c552cf495b99ceb947d2aa95062ce0dabe6181672f48be07af5ea98007

See more details on using hashes here.

File details

Details for the file tomlplus-2.0.0rc2-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tomlplus-2.0.0rc2-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 270d1688ef4897fd11fb0d9d12394be53af4c0110e27749e91ce830c8aea5473
MD5 cf9cac4757baca455feaa261bcf9960f
BLAKE2b-256 092334a6dca13ee4fe142bfb715e9da6bb0278b89c38f8469a2f25bcfb76d7e8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page