top | item 37362227

Toml-bench – Which toml package to use in Python?

43 points| DishyDev | 2 years ago |github.com

12 comments

order

jasonpeacock|2 years ago

I was all ready with a rant about the premature optimization of worrying about the parsing speed of a configuration library with there's so many other important factors and the majority of use cases don't care about speed...

But this is a great post that covers the relative behaviors of the different parsing libraries and helps you evaluate the best _functional_ choice for your needs. Bravo!

mrweasel|2 years ago

The level of none compliance was actually pretty surprising to me. You're right speed is not really that important, realistically you're not going to have a large amount of TOML in any given project, nor are you going to read and write it constantly.

One issue I've run into is programs that have configuration language that looks a lot like TOML or INI format... yet it's neither. So a TOML or INI parser might be able to read and write the configuration files 90% or the time, but fail in strange ways in some edge cases.

jakubmazanec|2 years ago

[deleted]

tetha|2 years ago

That criticism feels weak to me outside of the scope of "StrictYaml vs TOML". Within that context, I might agree, having just heard of StrictYaml today. Having dealt with the full blast of complexity YAML and especially XML and XML Schema has in store... TOML is probably one of the top 2-3 config languages I'd use.

duped|2 years ago

I find the friction with deep hierarchical data to be a benefit of TOML as a configuration file. You shouldn't have deep hierarchies in your configs.

RockRobotRock|2 years ago

I don't like TOML either, but it's lame to derail a topic like this.

hprotagonist|2 years ago

that ship sailed.

toml is a prominent example of the least-worst option gaining traction. For configuration files that need to be human editable, provide comments, but are machine readable and have broad support, TOML is the choice that the plurality has settled on. In python, it’s in core tools like pip; it’s not going away because we don’t like how you nest collections awkwardly or whatever.

at least it’s Norway YAML!

polski-g|2 years ago

The fact that the article complains about the static typing in TOML makes me disregard the entire piece. That's the best part of TOML. I've encountered countless bugs in Ansible because it does know if no is "no" or false.