psi_toml
A very lite implementation of a toml parser, reader, and writer
It is not a 1.0.0-compliant TOML library, nor is it intended to be.
It can parse basic toml files to a dict, and write a dict to a toml file using the load and dump methods.
Usage
from psi_toml import toml as toml
result = toml.load(f_toml)
toml.dump(data, f_toml)
toml.parse(strings)
where f_toml is the handle to the toml file, data is a python dict and strings is a list of strings representing key value pairs. E.g.
nl = '\n'
strings = [
'a = 1',
'b = -1',
'c = .5',
'd = abc',
'e = 3.14',
'f = "1.414"',
'g = true',
'h = "false"',
(f'i = [{nl}'
f'"a",{nl}'
f'"b",{nl}'
f'"c",{nl}'
f'"d",{nl}'
f']'),
(f'j = {{{nl}'
f'"a": 1,{nl}'
f'"b": 2,{nl}'
f'"c": 3,{nl}'
f'"d": 4,{nl}'
f'}}')
result = toml.parse(strings)
Installation
If you are using Poetry,
add psi_toml to your pyproject.toml file by using:
poetry add psi_toml
If not, you can use pip:
pip install psi_toml
Metadata
Release files for psi-toml 0.0.21
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 | Actions |
|---|---|---|---|---|
| psi_toml-0.0.21.tar.gz | 3.9 kB | Without provenance | Details for psi_toml-0.0.21.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| psi_toml-0.0.21-py3-none-any.whl | Python 3 | none | any | Details for psi_toml-0.0.21-py3-none-any.whl |
Total release size: 8.9 kB
Release files / psi_toml-0.0.21.tar.gz
| Download URL | psi_toml-0.0.21.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
496252d01f25ab1a482f13169c6f225e7c543d28dfb45a58cbef6c92b7baac17
|
|
BLAKE2b-256 checksum How to use checksums |
a80e99d4d8d63438e2fc7d680950d45f7f9ed42d3bc98f89f9601186e0971ae5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.6
|
Release files / psi_toml-0.0.21-py3-none-any.whl
| Download URL | psi_toml-0.0.21-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2e487526000f975eadf2190286e8d71fea7921c13a50c7617d0df3f1cd38319e
|
|
BLAKE2b-256 checksum How to use checksums |
7f0d9c05bafb98deec74aeb6e6ef07793373d4c53396b13cbab8592f4e53752f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.6
|
Security for psi-toml 0.0.21
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.