1

My constraints

  • A mandatory section
  • An optional section
  • A single-level section
  • Only one identical option by section
  • Text values that can look like this:
    Electric= yes6batteries
    Electric= yes4battery
    Electric= yes8solar_panel
    Electric= yes
    Thermal= no
  • Conditional options, for example:
    Electric should not exist (or should be no) if Thermal= yes but must be if Thermal= no
  • Need to get the number or the content of the error/conflict lines

I looked ConfigObj but I soon abandoned because not validated for Python3.
I started working with ConfigParser but I'm not sure to reach what I want.
So I ask you what you would do in my place or if there is a library best suited to my need.

Mauricio
  • 670
  • 1
  • 8
  • 23

1 Answers1

0

TOML isn't exactly the INI format, but it looks almost like it. There's a python library for TOML, and it works with Python 3.

Jeethu
  • 429
  • 2
  • 4