Skip to main content

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


Download files

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

Source Distribution

qtoml-0.1.1.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

qtoml-0.1.1-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file qtoml-0.1.1.tar.gz.

File metadata

  • Download URL: qtoml-0.1.1.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for qtoml-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7e40e18a4e4200cb05db5360ac17c699aba0a460fad76e6f52ba33188953207b
MD5 b615cf6f57926ed28ac22755ec78c02e
BLAKE2b-256 16bb1703d709bb9be0a97199285f0b5edf79c8acff26a4869bfecb6ba64e50a7

See more details on using hashes here.

File details

Details for the file qtoml-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for qtoml-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1e5870afe742e33acf95608f2d1e2523b94bae7beb080c8a6e7dbac6e2daa6b1
MD5 309d74bd5e35e82da8cd748c8506b54f
BLAKE2b-256 d1a060c576e2c4ee641288472f4f3384d177b1923ec12947cc0df1b3d3b84cff

See more details on using hashes here.

Supported by

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