Orgparse Examples
These files are adapted from the orgparse Python library test suite.
Examples
00 Simple – Hierarchical Document Structure with Tasks and Tags
Ran the real pip-installed =orgparse= package's =load= function on the test file. Heading 1's =.tags= holds TAG1 and TAG2 (own TAG2 plus inherited TAG1), Heading 9's holds TAG2, TAG3, and TAG4 -- confirms tags accumulate down the hierarchy as described.
Basic heading hierarchy across five levels with custom TODO states
(TODO1 through TODO4) and tag inheritance. Demonstrates how
orgparse traverses nested headings and collects tags at each level.
01 Attributes – Node Attributes and Date Ranges
A node carrying the full set of org scheduling metadata: SCHEDULED,
DEADLINE, CLOSED, CLOCK entries, an :Effort: property, and
inline date lists including time ranges.
02 Tree Structure – Hierarchical Structure Analysis
Ran =orgparse.load= on the real test file. =G3-H2= (level 4) resolves to =.parent.heading == "G3-H1"= (level 1), skipping levels 2-3 entirely -- confirms orgparse assigns parent/child relationships correctly across skipped levels.
Headings with intentionally irregular depth jumps (e.g., a level-4 heading immediately under a level-1 heading). Tests that orgparse correctly assigns parent/child relationships regardless of skipped levels.
03 Repeated Tasks – Task Tracking with State Changes and Deadlines
Ran =orgparse.load= on the real test file. The node's =.repeated_tasks= attribute returns exactly three =OrgDateRepeatedTask= entries (2005-09-01, 2005-08-01, 2005-07-01, each TODO->DONE), matching the three state-change log lines in the source.
A single recurring TODO with a monthly +1m deadline repeater and
three past state-change log entries. Illustrates how orgparse surfaces
state-transition history and repeating timestamps.
04 Logbook – Logbook Drawer Test
A node whose time-tracking data lives inside a :LOGBOOK: drawer
rather than inline. Verifies that orgparse reads drawer-enclosed
CLOCK entries correctly.
Source
These examples originate from the orgparse test suite at
orgparse/tests/data/. The library is available on PyPI:
pip install orgparse
Repository: github.com/karlicoss/orgparse