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 pip
to install this package:
pip install pytomlpp
You can also 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 .
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
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distributions
Close
Hashes for pytomlpp-0.2.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69697877bbb33fd98aefae02d155d0b6ec5aeaf64b2fbfe3e2bb153e7fe46c0a |
|
MD5 | d6d6463503ab3a7e16cdf3a564aac712 |
|
BLAKE2b-256 | eb8f8a151f692e44871da93c80583c24a67c2d7997d941745b82ce642a7420ce |
Close
Hashes for pytomlpp-0.2.1-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c0e06f0ca8a1d0eb84990221d81d7646fdbf56671467df0b1966f0846dd36d4 |
|
MD5 | 69f92532a66822e9c12e3aa7862eeccc |
|
BLAKE2b-256 | 9db60b7000c40d4d7cf07c6d6adc55c73b708e95802bd32e6514d7d0b9421780 |
Close
Hashes for pytomlpp-0.2.1-cp38-cp38-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2f89e316a0893e888e2d5a8a0a6e30f848eaea915bb9510a93bf04d1152641f |
|
MD5 | 654e3434695f701d79ea10c66c4d98d0 |
|
BLAKE2b-256 | 963e0d1c5ce7bee1d609b8ca373eec84ea0f514c4a6353102a1e1883e5d02755 |
Close
Hashes for pytomlpp-0.2.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5131e7690382f1f93a5e6bc3bc7cc76d59414a3ccb9538b71bf8d973d255087 |
|
MD5 | 65ff34974a2a9bb7ca6019006a189e5d |
|
BLAKE2b-256 | 4e1b31ac5b9dd6b1a502b1abeed7d5712b152d65bf2ffed5f6cfe0bef8d86b4f |
Close
Hashes for pytomlpp-0.2.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39551234c78604d8ffc7e9c350a75cc7c5858769371279e04f0d8fea6651afad |
|
MD5 | a00803a148fdf56bf085d91d8736eabc |
|
BLAKE2b-256 | 8cd26c5dec094d5b73ff5548060cbbb90ab8a3a0177643d9858e6325261d570d |
Close
Hashes for pytomlpp-0.2.1-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d66314a11c1756cd8023451231c5c4c73775bc5aeb39ba5b9e6c6755a7bd544 |
|
MD5 | 40e289813527ebad91379cc8d125bccb |
|
BLAKE2b-256 | 6c49ed5585532db74e76900df993d1101779f774fd30b9965642f17ab94f639c |
Close
Hashes for pytomlpp-0.2.1-cp37-cp37m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13b3bdb92985940e81973092fdd88dfee6a26255fde183dde9e0728de0248a31 |
|
MD5 | 46609a3932e7f416338532a6025eba87 |
|
BLAKE2b-256 | 0e00f8a0cf82739590ee746767d812b1b43e7655fd068cc6aa6e1be68dbdb992 |
Close
Hashes for pytomlpp-0.2.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c429d9707ad1799953eb58cc4b58108b7b3cd1bfa718f295f778ccd58b11b11b |
|
MD5 | 2f3dd608276174bd783cff5fd1cc4e02 |
|
BLAKE2b-256 | 9a0a3194e6e75c86d4543b89870bcf4f9341f48307c3f2e46fb19d29d568726d |
Close
Hashes for pytomlpp-0.2.1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c60901f7124162179cbf5cc6b7a01ba2d84609f62228eed83008c537688ebcd |
|
MD5 | edfb1cbb28260b4a3250fa8b0eb61920 |
|
BLAKE2b-256 | ad4fe0397defcc1e8121f75154d3edd2006ea850d72ecd1cb8bf8745a498d520 |
Close
Hashes for pytomlpp-0.2.1-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4be18f2de8933519d9e76af5bec8d9bf4c08e9e4ee234b4a7446d2c5149d402 |
|
MD5 | 6265dce591d9b22a709cbd6181c309f4 |
|
BLAKE2b-256 | a14fca902918b1cfcd5b98cfea1f905b0ffa3afc46209c4d2df65e68b017a75a |
Close
Hashes for pytomlpp-0.2.1-cp36-cp36m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20a012d39e22be1cb1f5ab325ea493f139c7a029ae49f1e5bda5ea0a0c0d0953 |
|
MD5 | 353e0ddc4ecf53d3c826894461d5a526 |
|
BLAKE2b-256 | 13f392294cf6d4986c47e7b8e835828a4fc360f6307bd5baebb2ce65452a4252 |
Close
Hashes for pytomlpp-0.2.1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5c672c43ff4b26a745ed3cc23428a0919be2f73d2c16030443d0af7c98f5f63 |
|
MD5 | d14f494d7f192dfddd3ae02d8538ee87 |
|
BLAKE2b-256 | 7b5adba4e88ede224ff56c88087153401c05b21fbce5e7ac528f617ceeda9dc4 |
Close
Hashes for pytomlpp-0.2.1-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a990d89e580858985aa160b63679c5ba183564a07d42dd4969ea008c6f97a86 |
|
MD5 | 9a1f5db826c11a995ed01e590c31442f |
|
BLAKE2b-256 | 9b5ce44cd6f8c5e06f27a16d1f8faace529daf49b0cc61eee196048b7fff1f4e |
Close
Hashes for pytomlpp-0.2.1-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cd353f95d88691d7c58cb459ea78bfef49e86c657a512bda8bc285028510dd1 |
|
MD5 | 35e04b3760b582a82f017bdd1ea787c8 |
|
BLAKE2b-256 | b3f14afb23cd46e7763f27c0f498667d64ea6d7f6abf783a7daab4ac53e55b48 |
Close
Hashes for pytomlpp-0.2.1-cp35-cp35m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db6933215cb6df426f5cc5b9952e2038d718e59fcac4ebc5bd6e5b5c844f3cb7 |
|
MD5 | e154943ec465d05dea4081f79e3ca343 |
|
BLAKE2b-256 | a8130b1a97832c19c625652baa82fe85d656431d4bc0e014d0a5b4dd7158c5a7 |
Close
Hashes for pytomlpp-0.2.1-cp35-cp35m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 638ee86be10fd2efe1c006e1db5050ab22b422c93e4017199e33aa502b4cf356 |
|
MD5 | 176dcbd7294bbcd6b63b1300d4f44beb |
|
BLAKE2b-256 | 8834addcaf22c4bd0ed6d1cceaaab43fc43e76ad82a3d9718ea4f38cf9a8b3c8 |