A python wrapper for toml++
Project description
pytomlpp
This is an unofficial python wrapper for tomlplusplus (https://marzer.github.io/tomlplusplus/).
Some points you may want to know before use:
- Using
tomlplusplus
means that this module is fully compatible with TOML v1.0.0. - 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
cd pytomlpp
pip install .
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 Distributions
Built Distributions
Hashes for pytomlpp-0.2.3-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 745f42c60be19c1c214b93703e358d673e0ca99f747696af82d5423b20abd6cb |
|
MD5 | b775ed4bcc345114eb9760a38908c846 |
|
BLAKE2b-256 | 7bbe07ff1bf483924bcd5dac152c6cbde8b2772c39fe40968686a7f02775f6aa |
Hashes for pytomlpp-0.2.3-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 559a7ffa915e2082445177e813e05e8620ee25d10aabb677580da7d36ace94a5 |
|
MD5 | eb8e3fbe00f0259f7e0b4ebf1c7b46e7 |
|
BLAKE2b-256 | 58993bc0b18d342000a16bf33fff738481ce526a2db6e50fcf875230f515343a |
Hashes for pytomlpp-0.2.3-cp38-cp38-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e4fe981c35c923592ebeea2f4ba83523a44a861f52ca4245af497eee8f6d3bf |
|
MD5 | 1418161bea092962fdfe867ebd4e2abc |
|
BLAKE2b-256 | dc77e77e629d492ec3990d77bea341ff3da7c690937566d5f4ce64007e70645c |
Hashes for pytomlpp-0.2.3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d6bf9896c2f4c91bae91c8ce1352177066def44dad10af61f287aa518b0d911 |
|
MD5 | d5b6e23fe8aaf10bb2eff803281db8df |
|
BLAKE2b-256 | 70d68548a43fc9c2ce74643d9432064b5508313897533c8a9411517c88ebd232 |
Hashes for pytomlpp-0.2.3-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e08f896db86eba063625bbdce73096aa93477b13fc4d772b21c7424f4eefe44 |
|
MD5 | 9c4562f068f32d54c9a5c2381f2a9105 |
|
BLAKE2b-256 | e1258d2d89ae2eb6fe76ee34189bd6eaa10bfc8a69d24fb43c1615f58df48dbb |
Hashes for pytomlpp-0.2.3-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2c0c483b998d8c0fadd100d239955624f74bd8a0b009868ea9f274798f28e49 |
|
MD5 | fd05ba115f825b3bb0246cdc4aa8a594 |
|
BLAKE2b-256 | cace95ddf307031f063767ac3ecb7d04d22f4409ee2613a3b1bacfe5f34d978e |
Hashes for pytomlpp-0.2.3-cp37-cp37m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9635396f4853a1c26bccc1b08aa78071fe7af4f04564eed19770bd6e3736604b |
|
MD5 | afe6f0e6c25f870d636a233b5e2333a7 |
|
BLAKE2b-256 | 714f8abc0e138659b1b74ee242fd514b8e728870a9afb23a3bb385701f4cf3ed |
Hashes for pytomlpp-0.2.3-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cf4d45e8deaa7674044df47e78b377370ef9dca2b75117275d1b5237891437e |
|
MD5 | cc7de9bf5b3422bc0407bcdadf378011 |
|
BLAKE2b-256 | d9b9bdc9b6af4468f058fac29e59df7465acce7545cfdb98232dd0bf268022f8 |
Hashes for pytomlpp-0.2.3-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4378ced8f5f0fe5d846be03dcbc7de753b943f8c4cc509845e9b009b7d38d371 |
|
MD5 | 933edc00206f26ea6fd6f1d724b44386 |
|
BLAKE2b-256 | c68c94e8ddc646b61a2e61d83960170de539f6c4c5094a903513ad6d35428080 |
Hashes for pytomlpp-0.2.3-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16f4cf91b66e18d5a1292499f99e77e3a5a4f998b30aa129d271a6badf763991 |
|
MD5 | 86c99b3c4e7e7bd3105c801e5b8353f5 |
|
BLAKE2b-256 | c85f6f9cbfcddeee09f134af9e820524c398ea7dc5afa0b9b16ce8c8e18bd2c6 |
Hashes for pytomlpp-0.2.3-cp36-cp36m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0afb74449c4b4bc71b5820dc9234270ace722a2ead9eb4cf4ad80d7d2c23920b |
|
MD5 | f84656cb7d6361dcaca1689f31f09f10 |
|
BLAKE2b-256 | 2e3bf41b4f158928f29672814a4005f1636bc0368c28e0f78b54045c52509342 |
Hashes for pytomlpp-0.2.3-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94f84a3829e96749aa8ee1c0ade4a212eb5411f43d6da65b485ad0f17de4b538 |
|
MD5 | 3bd7c37f7447046bc113aff79c7c49dc |
|
BLAKE2b-256 | 34cd302d2e1b58f73be440286145d813378a063543216125d631b31959890065 |
Hashes for pytomlpp-0.2.3-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e45f5a0aaf83f2c49f7c5772b358be23e32b1ba8b282c8fc3562968148e1d3bb |
|
MD5 | 230142c7c812d08977292a63be941b96 |
|
BLAKE2b-256 | 51578dfcb182c622951c1fb9265fa4a200aa25c4c57593f99722fd2a20a7a7bd |
Hashes for pytomlpp-0.2.3-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d804bf7ff730cd379a0b5bc8b7499152f6f6aa5716b3ba22f3a66c4a093387a4 |
|
MD5 | 9d2d12f9a5cd0af7bfe014a8b28e9730 |
|
BLAKE2b-256 | fc3d4be7bf565f23d4b7ed8faedf643be989e8009d2f233a877e554d19f54537 |
Hashes for pytomlpp-0.2.3-cp35-cp35m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 229955148d95f72e0165c94e331059a35abad26af514466f9ec0acbbf0b9899e |
|
MD5 | a2ff0659f5d83865e1d7e18bdb99ded1 |
|
BLAKE2b-256 | 9b5b7b379450afc816c1b63eb312ac1a3464436dec769f689402bf939976080e |
Hashes for pytomlpp-0.2.3-cp35-cp35m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9fe6a048ca5da3596fa201fe3b767c856cb2a4015a191dd7e14ec280eefefe9a |
|
MD5 | 2671b84ad7f73c2e7f2f5229903540f9 |
|
BLAKE2b-256 | 0a55005b6aae3d7532cdedeae10837613b070333ca923e9ae5e41e14614dc434 |