Skip to main content

xtoml

release pypi develop master gitlab github

xtoml Logo

Quick access to values in TOML files, from the command line or from Python.

Licensed under GPL-3.0-only.

Installation

pip install xtoml

Command line

xtoml [-h] [-f FILE] [-s SEPARATOR] [-F FALLBACK] PATH

PATH is a key path into the TOML document, such as project.version. By default, it is read from pyproject.toml in the current directory.

$ xtoml project.version
1.0.0

$ xtoml -f config.toml server.port
8080

$ xtoml -s / tool/setuptools/packages/find/include
["xtoml"]

$ xtoml -F 0.0.0 tool.missing.key
0.0.0
Option Description
-f, --file TOML file to read (default: pyproject.toml)
-s, --separator Separator between keys in PATH (default: .)
-F, --fallback Value to print if PATH is not found
-V, --version Show the version and exit

Python

from xtoml import get

version = get("project.version")
port = get("server.port", file="config.toml", fallback=8080)

get() raises KeyError if the path is not found and no fallback is given, and FileNotFoundError if the file does not exist.

Metadata

Release files for xtoml 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xtoml 1.0.1
File Size Uploaded Provenance
xtoml-1.0.1.tar.gz 18.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for xtoml 1.0.1
File Interpreter ABI Platform
xtoml-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 34.3 kB

Release files / xtoml-1.0.1.tar.gz

Download URL xtoml-1.0.1.tar.gz
Size 18.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ba1cdbf69c157cc8bcf41634b7c4101cab212137004d5ca677a862c3988083ef
BLAKE2b-256 checksum
How to use checksums
7513a461c52b3a10b9da95bfa35bb506078d7449dc21a489d19f1c7443beff63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / xtoml-1.0.1-py3-none-any.whl

Download URL xtoml-1.0.1-py3-none-any.whl
Size 15.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6c79dd9ae29653b015d38dc174f1c504da96feada054bf4ce81f2a4817a49991
BLAKE2b-256 checksum
How to use checksums
7b67637033b9dd1adf1d2ffb208138662c4336d2d614a11193c6d5dbcd2d138f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Security for xtoml 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page