filter
notion.filter
Filter
Filter class for handling Notion Filter object. Please see https://developers.notion.com/reference/post-database-query-filter for detail.
You can now query to notion DB with filtering as following:
import SaigeToolkit.SaigeToolkit.notion as notion
filter_1 = notion.property.Select.get_filter("select_col", "equals", "sel1")
filter_2 = notion.property.Number.get_filter("number_col", "does_not_equal", 10)
filter_3 = notion.property.Checkbox.get_filter("checkbox_col", "does_not_equal", True)
filter_4 = notion.filter.Filter.compound("and", [filter_1, filter_2, filter_3])
_, _, results = notion.database.query_database(
db_id,
RESEARCH_API_PATH,
request_body=filter_4.to_dict()
)
See notion.so/8cd58f07a254405ebb1bc327d690c8aa for more examples.