All Projects → bobfang1992 → pytomlpp

bobfang1992 / pytomlpp

Licence: MIT license
A python wrapper for tomlplusplus

Programming Languages

C++
36643 projects - #6 most used programming language
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to pytomlpp

qtoml
Another Python TOML encoder/decoder
Stars: ✭ 26 (-53.57%)
Mutual labels:  toml-parser, toml
Tomlet
Zero-Dependency, model-based TOML De/Serializer for .NET
Stars: ✭ 56 (+0%)
Mutual labels:  toml-parser, toml
tomlcpp
No fanfare TOML C++ Library
Stars: ✭ 21 (-62.5%)
Mutual labels:  toml-parser, toml
toml-f
TOML parser implementation for data serialization and deserialization in Fortran
Stars: ✭ 69 (+23.21%)
Mutual labels:  toml-parser, toml
pp-toml
Paul's Parser for Tom's Own Minimal Language
Stars: ✭ 17 (-69.64%)
Mutual labels:  toml-parser, toml
rcpptoml
Rcpp Bindings to C++ parser for TOML files
Stars: ✭ 26 (-53.57%)
Mutual labels:  toml-parser, toml
tomli
A lil' TOML parser
Stars: ✭ 313 (+458.93%)
Mutual labels:  toml-parser, toml
tomland
🏝 Bidirectional TOML serialization
Stars: ✭ 103 (+83.93%)
Mutual labels:  toml-parser, toml
cdk pywrapper
A Python wrapper for the Chemistry Development Kit (CDK)
Stars: ✭ 25 (-55.36%)
Mutual labels:  python-wrapper
cfg-rs
A Configuration Library for Rust Applications
Stars: ✭ 18 (-67.86%)
Mutual labels:  toml
wolfssl-py
Python wrapper for wolfSSL embedded SSL/TLS library.
Stars: ✭ 30 (-46.43%)
Mutual labels:  python-wrapper
htoml
TOML file format parser in Haskell
Stars: ✭ 39 (-30.36%)
Mutual labels:  toml
audible-cli
A command line interface for audible package. With the cli you can download your Audible books, cover, chapter files.
Stars: ✭ 142 (+153.57%)
Mutual labels:  toml
parse it
A python library for parsing multiple types of config files, envvars & command line arguments that takes the headache out of setting app configurations.
Stars: ✭ 86 (+53.57%)
Mutual labels:  toml
tomlify-j0.4
An Object->TOML encoder/converter for TOML v0.4.0 (not v0.4.x)
Stars: ✭ 16 (-71.43%)
Mutual labels:  toml
front-matter
The most featured front matter (yaml, json, neon, toml) parser and dumper for PHP.
Stars: ✭ 23 (-58.93%)
Mutual labels:  toml
syntaxnet wrapper
A Python Wrapper for Google SyntaxNet
Stars: ✭ 34 (-39.29%)
Mutual labels:  python-wrapper
cmkr
Modern build system based on CMake and TOML.
Stars: ✭ 211 (+276.79%)
Mutual labels:  toml
chess.com
Python wrapper for Chess.com Published-Data API
Stars: ✭ 34 (-39.29%)
Mutual labels:  python-wrapper
tomlj
A Java parser for Tom's Obvious, Minimal Language (TOML).
Stars: ✭ 72 (+28.57%)
Mutual labels:  toml

pytomlpp

Build Status Conda Status PyPI version

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.
  • We support all major platforms (Linux, Mac OSX and Windows), for both CPython and Pypy and all recent Python versions. You just need to pip install and we have a pre-compiled binaries ready. No need to play with clang, cmake or any C++ toolchains.

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 1000 times:
  pytomlpp:   0.914 s
     rtoml:   1.148 s ( 1.25x)
     tomli:   4.850 s ( 5.30x)
     qtoml:  11.882 s (12.99x)
   tomlkit:  72.140 s (78.89x)
      toml: Parsing failed. Likely not TOML 1.0.0-compliant.

Test it for yourself using the benchmark script.

Installing

We recommend you to use pip to install this package:

pip install pytomlpp

You can also use conda to install this package, on all common platforms & python versions. If you have an issue with a package from conda-forge, you can raise an issue on the feedstock

conda install -c conda-forge pytomlpp

You can also install from source:

git clone [email protected]:bobfang1992/pytomlpp.git --recurse-submodules=third_party/tomlplusplus --shallow-submodules
cd pytomlpp
pip install .

Alt

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].