notion_utils¶
Some utility functions for working with Notion properties etc.
collapse_rich_text_property(property)
¶
Collapse a Notion Rich Text property into a single string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
property |
list[dict[str, Any]]
|
An array of rich text objects (as returned by a rich text property) |
required |
Returns:
Type | Description |
---|---|
str
|
The plain_text of the rich text objects concatenated. |
Source code in ncal/notion_utils.py
7 8 9 10 11 12 13 14 15 |
|
get_property_text(notion, notion_page, property_name, property_type)
¶
Get the text contained within several different types of property.
Note: Currently only relation and select are implemented.
Source code in ncal/notion_utils.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
|
get_relation_title(notion, notion_page, relation_name)
¶
Get the title of the first page in a relation property.
Source code in ncal/notion_utils.py
18 19 20 21 22 23 24 25 26 27 28 29 30 |
|