Closed theotheo closed 3 years ago
thanks you! implemented it now! find_all_page()
Install notion-database==20210513.7, and check the changed code in README.
example :
import os
import pprint
from notion_database.database import Database
NOTION_KEY = os.getenv('NOTION_KEY')
# List Database
D = Database(integrations_token=NOTION_KEY)
D.list_databases(page_size=100)
for i in D.result["results"]:
database_id = i["id"]
# Finding all pages in a database
D.find_all_page(database_id=database_id)
pprint.pprint(D.result)
Excellent! Thank you!
There's a limit for 100 pages though, afterwards you need pagination. Is this supported?
There's a limit for 100 pages though, afterwards you need pagination. Is this supported?
If support as Notion official API, pagination feature will be added soon.
It is supported by the official API 👍️
@BigBerny
20220628.1 version has been released! implemented pagination feature. (and more...) https://github.com/minwook-shin/notion-database/blob/main/CHANGELOG.md#2022-06-281-2022-08-01
pip install notion-database==20220628.1
# Finding all pages in a database
D.find_all_page(database_id=database_id, page_size=100)
if D.result["has_more"]:
D.find_all_page(database_id=database_id, start_cursor=D.result["next_cursor"])
Awesome, thanks!
Hi, there!
I see how I can fetch single page, but I don't figure out how to get all pages from database. Is there a method for this?