xtoml
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.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| xtoml-1.0.0.tar.gz | 18.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| xtoml-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.2 kB
Release files / xtoml-1.0.0.tar.gz
| Download URL | xtoml-1.0.0.tar.gz |
|---|---|
| Size | 18.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
65472571cbff8408c2b553525bba986fe993c1e699e4354a7f3493ce57830688
|
|
BLAKE2b-256 checksum How to use checksums |
d7479bbd22df4c695ceaa29c02083ce9e08479be19f7d3e70e38432b00a3f720
|
| 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.0-py3-none-any.whl
| Download URL | xtoml-1.0.0-py3-none-any.whl |
|---|---|
| Size | 15.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
de95a8f02276f1d92605cbb36decb59f17f5804d7625b948fe115378224d6fd9
|
|
BLAKE2b-256 checksum How to use checksums |
189341dda29d27c724962b59cbd0d2b06fbe746d3e1fdac38514f8d312f6f672
|
| 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.0
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.