pyorg.parse module

(Partially) parse org files.

pyorg.parse.parse_tags(string)[source]

Parse tags from string.

Parameters:string (str) – Tags separated by colons.
Returns:List of tags.
Return type:list[str]
pyorg.parse.read_file_keywords(file)[source]

Read file-level keywords from an .org file (without using Emacs).

Limitations: only reads up to the first element in the initial section (excluding comments). If the initial section does contain such an element, any keywords directly preceding it (not separated with a blank line) will be considered affiliated keywords of that element and ignored.

Will not parse org markup in keyword values.

All keys are converted to uppercase.

Keys which appear more than once will have values in a list.

Parameters:file – String or open file object or stream in text mode.
Returns:
Return type:dict