Skip to main content

A python wrapper for toml++

Project description

pytomlpp

Build Status Conda Status PyPI version TOML

You can try this parser online here.

This is an unofficial python wrapper for toml++ (https://marzer.github.io/tomlplusplus/).

Some points you may want to know before use:

  • Using toml++ means that this module is fully compatible with TOML v1.0.0-rc.3.
  • We convert toml structure to native python data structures (dict/list etc.) when parsing, this is more inline with what json module does.
  • The binding is using pybind11.
  • The project is tested using toml-test and pytest.

Example

In [1]: import pytomlpp                                                                                                                                                                                                                                                                            

In [2]: toml_string = 'hello = "世界"'                                                                                                                                                                                                                                                             

In [3]: pytomlpp.loads(toml_string)                                                                                                                                                                                                                                                                
Out[3]: {'hello': '世界'}

In [4]: type(_)                                                                                                                                                                                                                                                                                    
Out[4]: dict

In [6]: pytomlpp.dumps({"你好": "world"})                                                                                                                 
Out[6]: '"你好" = "world"'

Why bother?

There are some exisitng python TOML parser on the market but from my experience they are all purely implemented in python which is a bit slow.

In [1]: import pytomlpp                                                                                                                                                                                                                                                                                                  

In [2]: import toml                                                                                                                                                                                                                                                                                                      

In [3]: def run_parser(parser_func, toml_string): 
   ...:     for i in range(1000): 
   ...:         parser_func(toml_string) 
   ...:                                                                                                                                                                                                                                                                                                                  

In [4]: %timeit run_parser(pytomlpp.loads, toml_string)                                                                                                                                                                                                                                                                                
310 ms ± 56.7 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)

In [5]: %timeit run_parser(toml.loads, toml_string)                                                                                                                                                                                                                                                                                    
3.5 s ± 162 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)

In [6]: pytomlpp.lib_version                                                                                                                              
Out[6]: '1.3.2'

Installing

We recommand you to use pip to install this package:

pip install pytomlpp

You can also use conda to install this package, Note we only support linux 64 python 3.8 for now, I would love to provide this package on more python versions and platforms via conda but I have not found a way yet to automate this in the CI, if you know how to do this please contribute!

conda install -c dorafmon pytomlpp

You can also install from source:

git clone git@github.com:bobfang1992/pytomlpp.git --recurse-submodules=third_party/tomlplusplus --shallow-submodules
cd pytomlpp
pip install .

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pytomlpp-0.3.2-cp38-cp38-win_amd64.whl (166.1 kB view details)

Uploaded CPython 3.8 Windows x86-64

pytomlpp-0.3.2-cp38-cp38-manylinux2010_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

pytomlpp-0.3.2-cp38-cp38-manylinux2010_i686.whl (2.4 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ i686

pytomlpp-0.3.2-cp38-cp38-macosx_10_9_x86_64.whl (174.5 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

pytomlpp-0.3.2-cp37-cp37m-win_amd64.whl (167.6 kB view details)

Uploaded CPython 3.7m Windows x86-64

pytomlpp-0.3.2-cp37-cp37m-manylinux2010_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

pytomlpp-0.3.2-cp37-cp37m-manylinux2010_i686.whl (2.5 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.12+ i686

pytomlpp-0.3.2-cp37-cp37m-macosx_10_9_x86_64.whl (173.7 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

pytomlpp-0.3.2-cp36-cp36m-win_amd64.whl (167.5 kB view details)

Uploaded CPython 3.6m Windows x86-64

pytomlpp-0.3.2-cp36-cp36m-manylinux2010_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

pytomlpp-0.3.2-cp36-cp36m-manylinux2010_i686.whl (2.5 MB view details)

Uploaded CPython 3.6m manylinux: glibc 2.12+ i686

pytomlpp-0.3.2-cp36-cp36m-macosx_10_9_x86_64.whl (173.6 kB view details)

Uploaded CPython 3.6m macOS 10.9+ x86-64

pytomlpp-0.3.2-cp35-cp35m-win_amd64.whl (167.5 kB view details)

Uploaded CPython 3.5m Windows x86-64

pytomlpp-0.3.2-cp35-cp35m-manylinux2010_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.5m manylinux: glibc 2.12+ x86-64

pytomlpp-0.3.2-cp35-cp35m-manylinux2010_i686.whl (2.5 MB view details)

Uploaded CPython 3.5m manylinux: glibc 2.12+ i686

pytomlpp-0.3.2-cp35-cp35m-macosx_10_9_x86_64.whl (173.6 kB view details)

Uploaded CPython 3.5m macOS 10.9+ x86-64

File details

Details for the file pytomlpp-0.3.2-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: pytomlpp-0.3.2-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 166.1 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.7

File hashes

Hashes for pytomlpp-0.3.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 9c91e47519085099a3b492bf9b421300ca4e35bd295b7179807dda09eeeeada8
MD5 7a9e36343b415ae0ef2ce59a2487acdb
BLAKE2b-256 dbc396a7336d06c7c73e7d4c0c4efdcbac0022a3a9169452f626512676e4e355

See more details on using hashes here.

File details

Details for the file pytomlpp-0.3.2-cp38-cp38-manylinux2010_x86_64.whl.

File metadata

  • Download URL: pytomlpp-0.3.2-cp38-cp38-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.7

File hashes

Hashes for pytomlpp-0.3.2-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 aecb769b2acdc94a4c16011292f517a45e9a14f8f63f48bc897b59f8b95086bf
MD5 ad89d3227e36088bc3704e5e6d2329eb
BLAKE2b-256 c906402ec2d526a740d90a7c7728bde82b0676cba7ba942632231a9708ee1397

See more details on using hashes here.

File details

Details for the file pytomlpp-0.3.2-cp38-cp38-manylinux2010_i686.whl.

File metadata

  • Download URL: pytomlpp-0.3.2-cp38-cp38-manylinux2010_i686.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.8, manylinux: glibc 2.12+ i686
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.7

File hashes

Hashes for pytomlpp-0.3.2-cp38-cp38-manylinux2010_i686.whl
Algorithm Hash digest
SHA256 01d42299d9280eab6d10f32c969a9e458563872e19366b252bd3fd99ee44019f
MD5 3676be627529e34a9115d85cca0c42a7
BLAKE2b-256 61302150e59c58eddee3272dd4a5b6e607ded09a61a631baf2a6b78e35d9d0d4

See more details on using hashes here.

File details

Details for the file pytomlpp-0.3.2-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: pytomlpp-0.3.2-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 174.5 kB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.7

File hashes

Hashes for pytomlpp-0.3.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a5d3597d99e896056e5e9748d96119f730cd4541ea92257bd9e0aaceedf0a4a2
MD5 a4df756c344dac2f24cca7bd66024407
BLAKE2b-256 ddff5c3185db68e992acf2aaa61139f1b3d406fedefd4c9d5aac4a0a751c346a

See more details on using hashes here.

File details

Details for the file pytomlpp-0.3.2-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: pytomlpp-0.3.2-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 167.6 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.7

File hashes

Hashes for pytomlpp-0.3.2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 8287f7c25840d675ac150e0b6734f0ff0da6cef945a9a9a5c82e8bae1afad023
MD5 4fb8312acd241e561eee4e7416e444c5
BLAKE2b-256 dee524f425d286f8867d6d341aeb4464fff56628a931a4e70e01d61e429212e8

See more details on using hashes here.

File details

Details for the file pytomlpp-0.3.2-cp37-cp37m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: pytomlpp-0.3.2-cp37-cp37m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.7

File hashes

Hashes for pytomlpp-0.3.2-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 a23f90e42b1f7bd5fd091776f34bddcbfbed53dd9db2c16f12e168b26e321fe4
MD5 fa29126f1f51e5fc2257d36056fc3018
BLAKE2b-256 1588620b5437a5410b83265072121186cff4a35559a256a6a383182f86302866

See more details on using hashes here.

File details

Details for the file pytomlpp-0.3.2-cp37-cp37m-manylinux2010_i686.whl.

File metadata

  • Download URL: pytomlpp-0.3.2-cp37-cp37m-manylinux2010_i686.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: CPython 3.7m, manylinux: glibc 2.12+ i686
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.7

File hashes

Hashes for pytomlpp-0.3.2-cp37-cp37m-manylinux2010_i686.whl
Algorithm Hash digest
SHA256 a72562e0a44ad91773978dd06aed094544eb8b4e538a1de5438bd531d680f3af
MD5 232e150b223c6b505e82325da2a1d48c
BLAKE2b-256 549bcfd557b089a5a0a1b515ce5f416232e822570ae2097f738d6ac644d533c6

See more details on using hashes here.

File details

Details for the file pytomlpp-0.3.2-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: pytomlpp-0.3.2-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 173.7 kB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.7

File hashes

Hashes for pytomlpp-0.3.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 971812bef4f922637f6042b78e1930b63b5deda29bae42e9c8d832746d4beef0
MD5 f88d399f9a7bed60a81dbd4a65349c7f
BLAKE2b-256 87fe69dec6e922b509ef96e13b8d192b9a5aae6b024782cec4343bc7f83a8fec

See more details on using hashes here.

File details

Details for the file pytomlpp-0.3.2-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: pytomlpp-0.3.2-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 167.5 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.7

File hashes

Hashes for pytomlpp-0.3.2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 8ef0ab76187755ec30f2a6199299a45a55127c1c103b8d4c9317f4972bd639d8
MD5 9fbfc7d35df6220c53bc69ce7f77c0d4
BLAKE2b-256 eb5103855c82ce9de9291eb76b91bf3276ec609fd6dbdbad61dbff619f96f2ed

See more details on using hashes here.

File details

Details for the file pytomlpp-0.3.2-cp36-cp36m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: pytomlpp-0.3.2-cp36-cp36m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.7

File hashes

Hashes for pytomlpp-0.3.2-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 f9cbfce73b403be328fb0f39a6772cb3eed5b588dadc15196c8725a373fde8b4
MD5 264e3d1acf0fd74dd3e7effed4088e58
BLAKE2b-256 80f349870fc0b3df021913c7d48664519041a637c680714435af1007a1607f0d

See more details on using hashes here.

File details

Details for the file pytomlpp-0.3.2-cp36-cp36m-manylinux2010_i686.whl.

File metadata

  • Download URL: pytomlpp-0.3.2-cp36-cp36m-manylinux2010_i686.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: CPython 3.6m, manylinux: glibc 2.12+ i686
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.7

File hashes

Hashes for pytomlpp-0.3.2-cp36-cp36m-manylinux2010_i686.whl
Algorithm Hash digest
SHA256 b60e070a604f0073f621c532efe5e568b58cf5580f676eee8ad5162e203c974a
MD5 f104580e02b5c7be3f6c68ebba68f6ae
BLAKE2b-256 28a16a5d1b02c27d4c2dfd8bdaed6555059201de81872d44b9819e0047eb6527

See more details on using hashes here.

File details

Details for the file pytomlpp-0.3.2-cp36-cp36m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: pytomlpp-0.3.2-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 173.6 kB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.7

File hashes

Hashes for pytomlpp-0.3.2-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 0c3a8f99ea31a2c2db7a006bb16538b97433a498d5d481132e87194f3bcb8f93
MD5 4d7dfd6f7493413452cd46691e6b46b5
BLAKE2b-256 21788708fb4e119fddf74b08d57f04f11c7b5c1790708de34c4d8f345bfd8891

See more details on using hashes here.

File details

Details for the file pytomlpp-0.3.2-cp35-cp35m-win_amd64.whl.

File metadata

  • Download URL: pytomlpp-0.3.2-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 167.5 kB
  • Tags: CPython 3.5m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.7

File hashes

Hashes for pytomlpp-0.3.2-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 297d13f29f83edbbb70f8ef78acff804479c5bd41a36d1999f7ad6d3d40f4564
MD5 b2ff254f605505b2159124f545d0063a
BLAKE2b-256 f4549d2b1a220d77f0601e5fff1a6f5c6ed53ed689586cadb359293fb5afb03b

See more details on using hashes here.

File details

Details for the file pytomlpp-0.3.2-cp35-cp35m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: pytomlpp-0.3.2-cp35-cp35m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: CPython 3.5m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.7

File hashes

Hashes for pytomlpp-0.3.2-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 97dfcb36fdd90de5f19f877b811813072019866138bf6b5adc85a4d403e52f07
MD5 abdf129f114846deea69325ba892a1ea
BLAKE2b-256 51e5e977787b306896c30e0db604316a70349235b9a754ebb3e7b587906544b0

See more details on using hashes here.

File details

Details for the file pytomlpp-0.3.2-cp35-cp35m-manylinux2010_i686.whl.

File metadata

  • Download URL: pytomlpp-0.3.2-cp35-cp35m-manylinux2010_i686.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: CPython 3.5m, manylinux: glibc 2.12+ i686
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.7

File hashes

Hashes for pytomlpp-0.3.2-cp35-cp35m-manylinux2010_i686.whl
Algorithm Hash digest
SHA256 1bde4d124cf1c0412606497948d9709e80c6ecd8855d501ed5332b4743fe18c6
MD5 eacb2e73f5188f9094241f9ec1ed8672
BLAKE2b-256 6d1055a0dfddd9b945579794b0d5c9c5043bdf799265c42082db5a799ad99b6c

See more details on using hashes here.

File details

Details for the file pytomlpp-0.3.2-cp35-cp35m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: pytomlpp-0.3.2-cp35-cp35m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 173.6 kB
  • Tags: CPython 3.5m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.7

File hashes

Hashes for pytomlpp-0.3.2-cp35-cp35m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 627ac84c8399a1f7e003b288ccfab09ca923ebfb809f7482664b5331b43126f5
MD5 4d3aeab0271fd7517a432510cb822988
BLAKE2b-256 0384232b77c751f307720b02992523caaa2ff2329c8ccd86f3c89823a3987dee

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