A python wrapper for toml++
Project description
pytomlpp
This is an 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. - 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 existing python TOML parsers on the market but from my experience they are implemented purely in python which is a bit slow.
Parsing data.toml 5000 times:
pytomlpp: 0.846 s
tomli: 3.317 s (3.9x slower)
toml: 5.697 s (6.7x slower)
qtoml: 8.473 s (10.0x slower)
tomlkit: 43.250 s (51.0x slower)
Test it for yourself using the benchmark script.
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
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 Distribution
Built Distributions
Hashes for pytomlpp-1.0.3-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c76361cc578d36dd8d17a2f4523833de19788b7a4da26a9687005feb9ba98c58 |
|
MD5 | c2fd584d84e3f821927ea2a51d7fe708 |
|
BLAKE2b-256 | 8447de71607d08ead66860a8357c998dd5d19e0ef68b9bf140be6af7d89164f3 |
Hashes for pytomlpp-1.0.3-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e9daa0a0d7c4ab6fa2a15afe7c957a8ec1bdc2292bff2f6be56a7e5c80dc394 |
|
MD5 | 08a097b373d1936d78b17f5a82349ad6 |
|
BLAKE2b-256 | 0eecd829e9a423dcb6374531688f18570028928871dd3c5e2e8c67b0145f3f2d |
Hashes for pytomlpp-1.0.3-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbd1e22564e61cef92b1c34b43ed7fed899224d43bd4d15ece56af59e668d6c9 |
|
MD5 | 8be99893702c93a8ea9ca19f78c59d1d |
|
BLAKE2b-256 | 0db765ad25c0c0f0f80cc481b46b967dfc7118fe9882da02bae133dec032f676 |
Hashes for pytomlpp-1.0.3-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87ccc3c108f20c8d1c3abb8655bab106ee6ed890f944a745a24663a9f6b1966f |
|
MD5 | c6d3aebc1abe8a82a53b5f519572e072 |
|
BLAKE2b-256 | 04e321fc7d8511b31167c324c217c85bda54599018c40cf05106cd21affbe43e |
Hashes for pytomlpp-1.0.3-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd45bd78e6b8faa01c9c1558a30d74ce9c8223875bdb107f69e6d8eabc23ffd2 |
|
MD5 | 2495cb1cd0b6c7996147b5be5e7d16b5 |
|
BLAKE2b-256 | 0ffd1f37f6f2deeb68441a7f56f006097e241b57726a41be5aaf42940b922f46 |
Hashes for pytomlpp-1.0.3-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c3b45458f4251594bd3017eac7e16897b7a27cde3b71d71dbe3ea74343f4461 |
|
MD5 | 3a7370f2bd6c2cbe70a260339e5d9c75 |
|
BLAKE2b-256 | 0ba858c2729d911ddcf95590065b80178093de60bd388010df4233311b0a5183 |
Hashes for pytomlpp-1.0.3-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c17aa8c3ebffc6727f7454f2f72531d92250e71f7eb607d0c8027d12ce883948 |
|
MD5 | 15f25fa0ff47430e26576defa2007610 |
|
BLAKE2b-256 | a9b8e08ba9c9c9622355a9cbedcb315832d240f54c51a0e9ee07f9ac7cc30b52 |
Hashes for pytomlpp-1.0.3-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f320bf0b851eb0e19cbe640e7cd12297f82b5384ad459e311cf8342a57b48313 |
|
MD5 | 329ece52e8a7800f65a65ab13264b71a |
|
BLAKE2b-256 | bc38fbe7b34300cfef1ec716d07d916e0fb376df7c6f73aa7fb7a67f73b268de |
Hashes for pytomlpp-1.0.3-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 365f17ca4e53526cdb3c1d2ce2715208e20d8d37f4f25ac8c0e1ec701f159bf0 |
|
MD5 | 17a4f909dd0231fd3aa14bd92fcffa7d |
|
BLAKE2b-256 | 9ec53cc8b0415084d560a4710a1a5b480d173524f063ab2cebb7828a65d15f4d |
Hashes for pytomlpp-1.0.3-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1590e6d7f0766a6779d4d74f49c2d6e261b7c6e175544b5fecb711ea95c021a |
|
MD5 | 442619e834dfa485c1417f925efa80ce |
|
BLAKE2b-256 | 05921804a871e717819630f831663b63c4f99922c55c8a57331da55c828c203e |
Hashes for pytomlpp-1.0.3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 406a565e8675fd538e6e24972a61929a26abdb602c9d7512b72340a21d0f2ea5 |
|
MD5 | 5ac62e5813d46dbd92cf6f2f832f6334 |
|
BLAKE2b-256 | 56b01e97020f0dd8114f129cb184f583cd6ce6acd80d292bd10f7f2bd7fdb541 |
Hashes for pytomlpp-1.0.3-cp38-cp38-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ffcf8feb4aa7a18d4e18e0c9118b8704f7cc924631e91efd335b6dc62048f62 |
|
MD5 | cfb1e3c4e0af17f7c63ad190defa1ee6 |
|
BLAKE2b-256 | 36a02250d782ae243395ab2c8b4c37cad52ff3b049ae794e83bba7be447c6f70 |
Hashes for pytomlpp-1.0.3-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cab86169a5bf1a04847745d00e5be7994b2f426cc95d18a21a742110f0ad6bd4 |
|
MD5 | b6d65ba3d33d3ab6a52887433c250452 |
|
BLAKE2b-256 | 883513e58e192683ea4f55119931d27b8da022b8e7645310553e7ac73a1b66eb |
Hashes for pytomlpp-1.0.3-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89c48f277c76a5f3471460adbe9d10c5d1a3ce59827b34162332daaf277ba073 |
|
MD5 | f2ebd0fd91781d99532196a816d2107e |
|
BLAKE2b-256 | 8331b5653dd16e18db86dea24f49a2b686082758d37f970197496ba8acc84d99 |
Hashes for pytomlpp-1.0.3-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee7302668ff970ca970105c4cf52613d0c99022ea5d585603c40b587686e7b39 |
|
MD5 | f99f1273e5dfa8dc5b7b39ba7e60a3c1 |
|
BLAKE2b-256 | 83221355444de1594a6f6d37a4e23ab21a6ca71019deaba39efc719297790ff9 |
Hashes for pytomlpp-1.0.3-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 251fa912efd3d83e1372ec8f157bcacfa496862fdf249d1678fb1c60c1831c45 |
|
MD5 | 1cda85d038466246eca0bae333cfa679 |
|
BLAKE2b-256 | a7a279dfbbcfcff3d7781f8424b40cb8da8331034fe384b7757b6e1b4ca80ff8 |
Hashes for pytomlpp-1.0.3-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b65d7b81c41eacf621d89bf808abdf0e7d26b6d4c0c8b050a956f63dd1d49975 |
|
MD5 | be80cd1f37cfde17ee6a47fa4fc1a03b |
|
BLAKE2b-256 | 51903471efbf0b04a4a9fed10d586e5ac809e81cd3e34d218bde65e7d0773083 |
Hashes for pytomlpp-1.0.3-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ee25c95ba2e76a8d94a166738129f518369890abe22ed9ad26295e7ac8ceef0 |
|
MD5 | bee92a97bf8f53256a83e0cd75aef1fc |
|
BLAKE2b-256 | 763ca1e4ec9b4d6b828f6ff70b635c5811667f2f25f6cb864bc3ee7506bb1217 |
Hashes for pytomlpp-1.0.3-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88817f3c84e2e556712c3c0f41b30c39fbcb28b4f7718fa31f4f955fd47d2bc1 |
|
MD5 | a906ce3e510d9dcaa4cd62be8f704744 |
|
BLAKE2b-256 | 5e4d70725af15d46362ad8a43b7e08999db30b3a1c8babc153cbd53d6b068e4e |
Hashes for pytomlpp-1.0.3-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3caf8fbc5d7ec11f3ff1933713255e745d330c621d53194ebd55faa457504052 |
|
MD5 | e5839bd95b21e073d9d1edcb32780090 |
|
BLAKE2b-256 | 46c62a00ffe406f2c62c2a29da4ed625a1f697aef603bc001257a5864c08efd0 |