Title: Python standard library TOML module
Hello everyone,
ITT I propose the idea of a TOML module in the standard library for general
TOML operations.
The main motivator of this is the growing adoption of PEP 517. Recently I've
been following its developments and I've noticed some situations that could
make things a bit harder at the moment of working with build systems based on
it. Namely I saw that dependency problems like cycles or complicated dependency
graphs.
For instance, we have a build system module that depends on a TOML module and
the latter depends on the former or on another build system, leading to square
one. Chicken and egg scenarios could also be conceived as a consequence of not
having an included TOML module for operations with the pyproject.toml file.
The inclusion of a TOML module in the standard library can solve this kind of
scenarios by providing an API for TOML deserialization and serialization.
I also propose that the module API can modeled around the existing json module
from the stdlib just to make design and usage easier.
Some snippets the module in action:
```python
>>> import toml
>>> # deserialization
>>> toml.dumps({'bar': [{'foo': 'salute'}]})
'[[bar]]\nfoo = "salute"\n'
>>> # serialization
>>> toml.loads('foo = ""\nbar = ["bar", "", "1.0", "2"]')
{'foo': '', 'bar': ['bar', '', '1.0', '2']}
```
Pleased to listen your opinions on this
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/IWJ3I32A4TY6CIVQ6ONPEBPWP4TOV2V7/
Code of Conduct: http://python.org/psf/codeofconduct/