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.2.0.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

qtoml-0.2.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qtoml-0.2.0.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.3.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.7.1

File hashes

Hashes for qtoml-0.2.0.tar.gz
Algorithm Hash digest
SHA256 92b418805c07332c5d79f07f29a63e3775a34822a223828a2c596830c58268ad
MD5 fa8f64c7c263f67769d6ed345af0597d
BLAKE2b-256 aa8e46ff2b7e602bbb5b35b79b289061e3f4ac62f3f043ba068bac7ac3cf93f8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qtoml-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.3.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.7.1

File hashes

Hashes for qtoml-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9071d3b7fda83117f7a79ada99786c6f75b0df22a5a5c4df0a61fd70c1e55117
MD5 eb26f2f708fca281bb2840c3697cde88
BLAKE2b-256 fc3ce805a576381abd190c9b16b829c1a14e03d438f851cab61f9b197527a487

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