pytomlpp is maintained and was mentioned above, but does rely on C++17 in the underlying C++ implementation.
Note that the discussion regarding preservation of comments has come up there as well. Problem is that the underlying std::map
is not order-preserving (unlike python’s dict
), and would need some pretty fancy C++ to do that while also enabling heterogeneous lookup. It’s somewhere on a long list of things I’d like to get to at some point (independently of what the stdlib does; I don’t expect cpython to adopt something as recent as C++17 anytime soon).