A python wrapper for toml++
Project description
pytomlpp
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
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.3.3-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb80ded3a55ee677b72a22c9614f1cb7f582c2001e32b02df863476a3709440d |
|
MD5 | 7d49bb90600fcba93a9625b8c9f34615 |
|
BLAKE2b-256 | 539de945b61bbfdf73882d376ddd538d92f4899548659d303cb57accd3aa84b5 |
Hashes for pytomlpp-0.3.3-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29842ca3f5c2dfa6da1170f948af621f8cc9337b2b37a068f05c3c610fdd9dcf |
|
MD5 | ad56652ee2b97a343f5a572b2f6f3377 |
|
BLAKE2b-256 | ae1e445df2f7aea85b26f6a8e7fa91c8bb553a8dd75c3bb2dcfacb324859ae81 |
Hashes for pytomlpp-0.3.3-cp39-cp39-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f182d33af34c8fc658d86f3b20cd9adc4aaccfe05fe1367df88592b7787fd20 |
|
MD5 | d59a9a9bd49f72f25479ab57c74f5d35 |
|
BLAKE2b-256 | 45d803b8f38d1b1712dcabdbda92d1178471740f94144904d302a35569b77602 |
Hashes for pytomlpp-0.3.3-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07302a65c89f75c7a077e50ccd4b60ec4fdf08976190e17fab036ac7bc86128d |
|
MD5 | 4f5d38b5bb12997a017b5c1b828967ff |
|
BLAKE2b-256 | 457b06a6be130747f748a4b261fa20aa1b0199b8db3cd6b0fb6dd8d0cb53cad2 |
Hashes for pytomlpp-0.3.3-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c02efb32c91fd5dd8f00abe89b17112c659f43fb6923ebac3272884488172f57 |
|
MD5 | 3ee85e9046313bc15d2b05e910b0d822 |
|
BLAKE2b-256 | ca72e63e2655d62bafabe696eb80f7a9e06e55d1c3726d6dbd5aa2e02023b848 |
Hashes for pytomlpp-0.3.3-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ce9588e077ea8d2a7cc4796c45ed0edc9a5033ea4d5c3c55ba989d683e91915 |
|
MD5 | 3d6fa3495c847d3cb8b6d514c60c0cd8 |
|
BLAKE2b-256 | 66f83201261ed8b63bb718de38987f301c810b36e7853254edcbc5524230f34f |
Hashes for pytomlpp-0.3.3-cp38-cp38-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d363f95e376dc521ea55972fe33b844791f7db33be3c59b6ec2019ebdf32fa46 |
|
MD5 | f9ffd1c754ee7f0453584911353af676 |
|
BLAKE2b-256 | e9596fe5d2ae1a5c9ccc504ec2db357e17426b5320f10c9b556dead66e1bdea8 |
Hashes for pytomlpp-0.3.3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc58d4213720d18af0a8feb223e4cb4716edf15bd6942665696cfe1af6cbad2e |
|
MD5 | 76cd9127c7b3c62a8b7c84fb3a48990d |
|
BLAKE2b-256 | 4c180c1739e0878d20fc0ed09de8d2595c25c33c042c9abe5621f3ba14941e8d |
Hashes for pytomlpp-0.3.3-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 475c8d453e317ff6ae629f4bf8d2d437ad21950464fcf9972b19906f7825a624 |
|
MD5 | 31fc7b45cc29a3663143050a4c2ff5be |
|
BLAKE2b-256 | 615d2c9f12b81b1c70aa193e81137e070ee9a9e60f47152b74ecf8c970f96977 |
Hashes for pytomlpp-0.3.3-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ae077d09edd7b11e9ef6b196bf33d42a428273dd879c1dd592d686eb56c21ff |
|
MD5 | 6865197e61b4c0ddbdd3514d683634a4 |
|
BLAKE2b-256 | b553cfe84cdc344be8fb9d11181a5a4d96d2322e878ad158113de8d5cd68808f |
Hashes for pytomlpp-0.3.3-cp37-cp37m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9994b544eb971eba736de6d7cb0a6309cf9251c22c116cead9c5c1ede37c7329 |
|
MD5 | 3f24b22b2579ad550905c51269e52b01 |
|
BLAKE2b-256 | 3f2afcb381ab701730e518e2d5908537f193f4353b651f740715dff10f5d5519 |
Hashes for pytomlpp-0.3.3-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29c62ee7af513ed3464883ceb1cef7c00b549b21d2d5953779ad8777b15a1095 |
|
MD5 | 80e3a415e760c886a6a62dabe43b8c01 |
|
BLAKE2b-256 | 65ecc059f058c5f0b9134174cf511991f950fd87326f2721949101ef3e72dbbf |
Hashes for pytomlpp-0.3.3-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70262c3a99380f047c78986abd94128e034dead95651139f7a5a47804fcbf2ca |
|
MD5 | 45dcbd4416d013dce7024fb4fd70873b |
|
BLAKE2b-256 | c471da24070093cbc7b9beeac9d6fe0cab12871c3cd3c47e2958f65b56efeb2e |
Hashes for pytomlpp-0.3.3-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca4696b56f1e437f7052b99908bcc0b22eba51ea9d184a76c5bb5748a294ba6b |
|
MD5 | 53331150ce45ec02e6a4c05b02c2c140 |
|
BLAKE2b-256 | 6990d98fc02fc643c95f0e92bd7632d044c56370aaeff9df5ff97526d6f17a6e |
Hashes for pytomlpp-0.3.3-cp36-cp36m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3746611ba793e591807e8c79788377870420dd52e633f2711ccae43ebb1203a |
|
MD5 | f78bc797b7796ea42587cf19cfe3de0f |
|
BLAKE2b-256 | 284c25c71a52c6a261d0de4f54f33bbe487491efaa9a80f5750adb890b1fead7 |
Hashes for pytomlpp-0.3.3-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48ecd09a566ce9cad920c236da9ffab8e783188882ccb45da082fd939cdb40dd |
|
MD5 | 9db251198b283483f6f0814660b87c64 |
|
BLAKE2b-256 | 3a38d2c94ae87c1cefe83ef4a2947b94ee275f9f3d63da35c195e9012f658776 |
Hashes for pytomlpp-0.3.3-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24eb512f4316b3f4b78fba39ce49442aa3577aac6425ff9c88e878f2e501fd4e |
|
MD5 | 41080a2e5327492e4c0588c1e1c7eb94 |
|
BLAKE2b-256 | 1c09e35a23eb6261e04b2bfb9f80610504b1f32d639f5ae11d9323bc5e22459b |
Hashes for pytomlpp-0.3.3-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00e62c9a4686d7875a4509bea21d0a75bf71a7d46aa06898f9a39fc9966a7b8d |
|
MD5 | 62bb72fe6226285754539696ad61d60f |
|
BLAKE2b-256 | 6c3f08fd31b73d552ee1d174a6ce93dd206145ed07213109c43bb675eb871684 |
Hashes for pytomlpp-0.3.3-cp35-cp35m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e539553595da073a25730a3f932a49816e585082fd3b689496aa628e0c196aaf |
|
MD5 | d2198194d4f0395591216647f4a911a7 |
|
BLAKE2b-256 | 12aadd3b5454f2c5e5dfcbd003743b6aa52b73d59f0f1c611e6a180cfed57a94 |
Hashes for pytomlpp-0.3.3-cp35-cp35m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0d3586d635aa7347633f45c74a75dc674e1cafa77cdf187dbc1911ac20b35e9 |
|
MD5 | 78c61b5417e3553b8af21c4923c0b17b |
|
BLAKE2b-256 | 3c75017783155d35ee3b0e338f626f8fd43679ca7d571db344233df593467edb |