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.5.0.

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

Uploaded Source

Built Distribution

qtoml-0.2.4-py3-none-any.whl (32.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qtoml-0.2.4.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.10 CPython/3.7.2 Linux/4.20.0-arch1-1-ARCH

File hashes

Hashes for qtoml-0.2.4.tar.gz
Algorithm Hash digest
SHA256 7e6cfad65dff2e88fcf7dddd033683862e514ab58b4a95e73d1390231b54a2af
MD5 54b0553ea3e9a1bf60cc94542a478899
BLAKE2b-256 9c6e27b372038bc187f37a50898b273d0499f00c264095290f87611127ec1e9f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qtoml-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 32.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.10 CPython/3.7.2 Linux/4.20.0-arch1-1-ARCH

File hashes

Hashes for qtoml-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 15330e3aab8dbb2ce9e2783c204d0c502e3638d05529ac278f77f3bc3f1c309a
MD5 9784bce62f56933daf960ade93818bcb
BLAKE2b-256 a03b6c6b1b654285e07c013007f08b1dd65364d4dc7e89e45f43f0a549e22f35

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