Python Forum

Full Version: the data format i am designing with indentation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i am designing a data format intended to be a simple format for humans to enter genealogical data as files that be easily read, especially when not too large. each line will represent a person with various singular information about that person such as name, date/place of birth/death. more information, especially multiple information, such as spouses will be on an indented line that follows. further indentation would supplement this in context. the context for a marriage would be their children. but souses and children can later have unindented lines providing more info about them. a lot of info follows keyword like "m" (married), "b" (born), "s" (son), "d" (daughter or death in context of what follows, name or date).

the idea is that this data format uses indentation to create a grouping context much like a function's code follows a "def" until unindented. so i might end up needing to do some indentation processing and tracking.
Is this not something you could use YAML for?
I would use YAML for this. It is very readable, based upon indentation and there are many benefits in using an already existing and mature format. One of them is that you can convert it readily to other formats such as json.
i personally found YAML hard to read
That's surprising. In what way? In any case, I wouldn't underestimate the work involved in writing your own serialisation format and then maintaining it. Perfect is the enemy of good, and all that.
i just tend to not grok what's going on in YAML files. maybe better explanations would help. but i'm really not interested in YAML, anymore. i'm just going to have keywords and data words express a natural text meaning with the indentation to organize it.
I guess nothing will stop you if you're determined to write your own format.
i am interested in discussing available tools for processing and handling indentations. one of the reasons i don't like to give out a lot of other information is because that make it hard to keep the discussion on topic. the intended topic of my initial question was indentation. i should have been more specific. if discussing indentation is not interesting to you, then maybe you can find interest in another thread.