New TOML encoder/decoder
Project description
qtoml is another Python TOML encoder/decoder. I wrote it because I found uiri/toml too unstable, and PyTOML too slow.
For information concerning the TOML language, see toml-lang/toml.
qtoml currently supports TOML v0.4.0. Features above that are not supported.
Usage
qtoml supports the standard load/loads/dump/dumps API common to most similar modules. Usage:
>>> import qtoml
>>> toml_string = """
... test_value = 7
... """
>>> qtoml.loads(toml_string)
{'test_value': 7}
>>> print(qtoml.dumps({'a': 4, 'b': 5.0}))
a = 4
b = 5.0
>>> infile = open('filename.toml', 'r')
>>> parsed_structure = qtoml.load(infile)
>>> outfile = open('new_filename.toml', 'w')
>>> qtoml.dump(parsed_structure, outfile)
Testing
qtoml is tested against the alethiophile/toml-test test suite, forked from uiri’s fork of the original by BurntSushi. To run the tests, check out the code including submodules, install pytest, and run pytest under the tests subdirectory.
License
This project is available under the terms of the MIT license.
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 Distribution
Built Distribution
File details
Details for the file qtoml-0.1.0.tar.gz
.
File metadata
- Download URL: qtoml-0.1.0.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e497a19720ed548524dbcb3754648cd99002dda4084efb710ef2687559a1dab1 |
|
MD5 | e6125f8b4dfe86805d2a779432e6df3d |
|
BLAKE2b-256 | 2b55d8966d1d68edf0d9fd3b381d499321f037554ddfa7ce8e9dd6dd1dd8321f |
File details
Details for the file qtoml-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: qtoml-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d0f008c91f1e18e82ab19653b012b8b3afa894e2a9aca46f395aea7a6d2eea4 |
|
MD5 | 17b5e1a1d431618806cafc69536ef57b |
|
BLAKE2b-256 | ea3e4a207a1518b1087515276ed469b81521f81d36e3a77543cd227f95af1328 |