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):
...: for i in range(1000):
...: parser_func('Cargo.toml')
...:
In [4]: %timeit run_parser(pytomlpp.load)
310 ms ± 56.7 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
In [5]: %timeit run_parser(toml.load)
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 conda
to install this package:
conda install -c dorafmon pytomlpp
If you are not using conda
then please install from source:
git clone git@github.com:bobfang1992/pytomlpp.git
cd pytomlpp
pip install .
Why not pypi?
Pypi has some rules on how to distribute pre-compiled binary for different platforms. I do not have enough experties in this area. I would love to see contribution to make this package avaliable on pypi.
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
File details
Details for the file pytomlpp-0.2.0-cp38-cp38-manylinux2010_x86_64.whl
.
File metadata
- Download URL: pytomlpp-0.2.0-cp38-cp38-manylinux2010_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ec109e1c33a6f4b66ee2b340474728ab866dff9988e816301f00c242cebf86b |
|
MD5 | 8849ae9a6b1c5213aec945083cf30cb1 |
|
BLAKE2b-256 | 78ed738acd9e687b31b8627f2abe4bebd5e5a80dc73b6137f49b0b0b7e798ecf |
File details
Details for the file pytomlpp-0.2.0-cp38-cp38-manylinux2010_i686.whl
.
File metadata
- Download URL: pytomlpp-0.2.0-cp38-cp38-manylinux2010_i686.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.8, manylinux: glibc 2.12+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b2d23865b7f341ff09773b347bbb5010ac14ed7782fcb354bb4964237387a97 |
|
MD5 | 3bb05628d5e69996e89650579dbe7dbc |
|
BLAKE2b-256 | a44020964f638f1181b6df2eaab90a56228f22798e9167cd764d3ceccc4d362b |
File details
Details for the file pytomlpp-0.2.0-cp38-cp38-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pytomlpp-0.2.0-cp38-cp38-macosx_10_9_x86_64.whl
- Upload date:
- Size: 126.3 kB
- Tags: CPython 3.8, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75b7f574983dcacbd063870132668368fb1479b156b7a580f003b74f636ac47b |
|
MD5 | 3fce944fce5218b602ef2d95ab0a2fad |
|
BLAKE2b-256 | 0fdd0dbe91c6b47fe27796d3d4e3509076764f349244e7e15ffc43b150315a1c |
File details
Details for the file pytomlpp-0.2.0-cp37-cp37m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: pytomlpp-0.2.0-cp37-cp37m-manylinux2010_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb201db9b8b8f769f30fd612de3e428ee90d79a8bd7edb37061fc68256574e72 |
|
MD5 | 1196fffcf93180a86c5091409d03cce0 |
|
BLAKE2b-256 | 3867cf73d0e540cdc5a45e6096cdd66b51017348c8996a96cd6439e5f1b2f84c |
File details
Details for the file pytomlpp-0.2.0-cp37-cp37m-manylinux2010_i686.whl
.
File metadata
- Download URL: pytomlpp-0.2.0-cp37-cp37m-manylinux2010_i686.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.7m, manylinux: glibc 2.12+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3671d610e34c8bf1d3c4e812b2e5da3815f8370bfd4b2af3f57df0f2b6b3965 |
|
MD5 | e09a081360c908eab91ebc4c20809007 |
|
BLAKE2b-256 | 5d7ee27d8d398728e158a2c5f13597a44a35de206be0adb9f5e1a4b071731f87 |
File details
Details for the file pytomlpp-0.2.0-cp37-cp37m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pytomlpp-0.2.0-cp37-cp37m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 124.9 kB
- Tags: CPython 3.7m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c412de00967fd2c3c1da9da67f54ab3d3e65fc9b2f805d777d36a5ff46d6fbc |
|
MD5 | 93aa23ab7aba68e9432a928ff45db2fa |
|
BLAKE2b-256 | d006754907691da7d84d052c40e5aafb296560be24f7ad8d59bbe0b057612e60 |
File details
Details for the file pytomlpp-0.2.0-cp36-cp36m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: pytomlpp-0.2.0-cp36-cp36m-manylinux2010_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59ec3fac298cf3315e7386289f52739f2521612196c6109f317eaf600fac83bc |
|
MD5 | e428f115ce35186104e614aa69f6b793 |
|
BLAKE2b-256 | 052c83b5d6fdea900c28992b3579939995e0ba319606891a88a6c45fc590545b |
File details
Details for the file pytomlpp-0.2.0-cp36-cp36m-manylinux2010_i686.whl
.
File metadata
- Download URL: pytomlpp-0.2.0-cp36-cp36m-manylinux2010_i686.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.6m, manylinux: glibc 2.12+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61daaa464dc088371884c2a6bb6a4edf64dde8ad2e9e184e8ba8981fbbf6dcd9 |
|
MD5 | 408b043970ed66ac5d364af35d6449d5 |
|
BLAKE2b-256 | 4d58ed6b566d0f9f5ef713be5822f83395fc58b5de47b8dbccdf94d8faad7fed |
File details
Details for the file pytomlpp-0.2.0-cp36-cp36m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pytomlpp-0.2.0-cp36-cp36m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 124.9 kB
- Tags: CPython 3.6m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | db0dbbba3cbe44f75ef290bc46fe1e355f98c8766bbae877d7dc70702aa7d439 |
|
MD5 | 5b59ce1705f9299cca7ae64f78fb21e6 |
|
BLAKE2b-256 | 4c7e891884ac1ac6c6c7da8a120bc4f65bda7efee1a14ae75c8b66f15140cd35 |
File details
Details for the file pytomlpp-0.2.0-cp35-cp35m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: pytomlpp-0.2.0-cp35-cp35m-manylinux2010_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.5m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08f2f767ebaca09690b0251e57eab1e6b66cd1b249c79de978e9eda71d7d8cb6 |
|
MD5 | 497fd7e40e9404ec4dc583f874025d67 |
|
BLAKE2b-256 | 44b45330c9664894d02ad43d6fb2c2b58f2cd14944193df02b6b8d7c0f249e48 |
File details
Details for the file pytomlpp-0.2.0-cp35-cp35m-manylinux2010_i686.whl
.
File metadata
- Download URL: pytomlpp-0.2.0-cp35-cp35m-manylinux2010_i686.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.5m, manylinux: glibc 2.12+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3203d0949a5e0b1f9880402f5a658a3586d7d819c0f916caa7a628f7266f40e |
|
MD5 | c9f02535577308d6a200a00b209de818 |
|
BLAKE2b-256 | 7f78f6eaba3fff46669c01b1c09500a88a1d9a873be1fd6bd3945352e960336f |
File details
Details for the file pytomlpp-0.2.0-cp35-cp35m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pytomlpp-0.2.0-cp35-cp35m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 124.8 kB
- Tags: CPython 3.5m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc6cd7817d93c659b96f59aa715d53b86f1848fa4fd1ef2c5c09804470190993 |
|
MD5 | 1be6596f5f9623e4a337290a346ee1b7 |
|
BLAKE2b-256 | 6d8689b4ffbb86fc6928390803a8545307c4f1443f5b0ce249b09abad4f15ed3 |