sections¶
Flexible tree data structures for organizing lists and dicts into sections.
https://github.com/trevorpogue/sections
- class sections.MetaSection[source]¶
Parses args and kwds passed to a sections() call or
Section
instantiation and returns a Section tree structure. Parses node names/keys, separate attrs intended for current node vs child nodes, constructs current node, then recursively repeats for all child nodes.
- class sections.Section(*args: SectionKeysOrObjects, parent: Optional[SectionParent] = None, **kwds: SectionAttr)[source]¶
Objects instantiated by
Section
are nodes in a sections tree structure. Each node has useful methods and properties for organizing lists/dicts into sections and for conveniently accessing/modifying the sub-list/dicts from each section/subsection.