osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Python-Dev] Adding a toml module to the standard lib?


Hi,

I'd like to discuss the idea to add a module to parse TOML [toml-lang] 
to Python's standard library.

PEP-0518 -- Specifying Minimum Build System Requirements for Python 
Projects [pep] suggests to store build system dependencies in 
`pyproject.toml`, yet Python itself does not support this format. 
Various packaging related projects like pip and pipenv already support 
PEP-0518 and vendored one of the existing TOML libraries in order to 
read `pyproject.toml` files.

Besides that, TOML seems a better alternative to .cfg/.ini, .json -- 
both of which are already supported by Python's standard lib and 
parsing/dumping TOML properly is tricky enough to solve it properly 
[requirements].

There are a couple of TOML implementations out there [toml, pytoml, 
tomlkit] and one would have to find out which one to prefer and migrate 
into the stdlib.

If the result of this discussion is leaning towards adding TOML, I'd 
volunteer to do it. This includes: coordinating with the maintainer of 
the chosen library, writing the PEP (hopefully with some help) and 
maintain the module for at least two years.


Cheers,

Bastian


[toml-lang]: https://github.com/toml-lang/toml
[pep]: https://www.python.org/dev/peps/pep-0518
[pip]: https://github.com/pypa/pip
[pipenv]: https://github.com/pypa/pipenv
[toml]: https://github.com/uiri/toml
[pytoml]: https://github.com/avakar/pytoml
[tomlkit]: https://github.com/sdispater/tomlkit
[requirements]: https://devguide.python.org/stdlibchanges/#requirements


-- 
Dr. Bastian Venthur                                  http://venthur.de
Debian Developer                                 venthur at debian org