Complete redesign of the package API. All v1.x classes have been removed and
replaced with a single NotionClient entry point backed by purpose-built
resource sub-clients. Notion API version bumped to 2026-03-11.
The entire public API has been redesigned. v1.x code is not compatible with 2.0. Migration notes:
| v1.x | v2.0 |
|---|---|
Page(token) |
NotionClient(token).pages |
Database(token) |
NotionClient(token).databases |
Block(token) |
NotionClient(token).blocks |
Search(token) |
NotionClient(token).search |
Properties().set_title(col, text) |
{col: PropertyValue.title(text)} |
Children().set_paragraph(text) |
BlockContent.paragraph(text) |
Cover().set_cover_image(url) |
Cover.external(url) |
Icon().set_icon_emoji(emoji) |
Icon.emoji(emoji) |
const.query.Direction |
Sort.by_property(..., "ascending" | "descending") |
NotionClient– single entry point; all resources accessed viaclient.databases,client.pages,client.blocks,client.search,client.users,client.comments- 1-to-1 Notion API mapping – every method name and parameter matches the Notion REST API exactly, making the official docs directly usable
PropertyValue– static factory methods for page property values (title,rich_text,number,select,multi_select,status,date,checkbox,url,email,phone_number,people,files,relation,unique_id,verification)PropertySchema– static factory methods for database column schemas (title,rich_text,number,select,multi_select,status,date,checkbox,url,email,phone_number,people,files,relation,rollup,formula,created_time,created_by,last_edited_time,last_edited_by,unique_id,verification,button,location,last_visited_time)BlockContent– static factory methods for all supported block types (paragraph,heading_1/2/3,callout,quote,bulleted_list_item,numbered_list_item,to_do,toggle,code,image,video,file,pdf,embed,bookmark,divider,table_of_contents,breadcrumb,equation,column_list,tab,tab_group)RichText– rich-text element builder (text,mention_page,mention_database,mention_user,mention_date,equation)Filter– fluent filter builder for database queries covering all property types (text,title,number,checkbox,select,multi_select,status,date,people,files,relation,url,email,phone_number,unique_id,created_by,last_edited_by,formula,rollup,verification) plus compoundand_/or_and timestamp filters (created_time,last_edited_time)Sort– sort builder (by_property,by_timestamp,ascending,descending)Icon/Cover– icon and cover object builders- Auto-pagination helpers –
databases.query_all(),blocks.retrieve_all_children(),users.list_all(),search.search_all() - Typed exceptions –
NotionAPIErrorwith subclassesNotionValidationError,NotionUnauthorizedError,NotionForbiddenError,NotionNotFoundError,NotionConflictError,NotionRateLimitError,NotionInternalError - Users API –
users.retrieve(),users.list(),users.list_all(),users.me() - Comments API –
comments.retrieve(),comments.create() - Dropped
urllib3<2.0constraint - Minimum Python version raised to 3.10
pages.retrieve_markdown(page_id)– retrieve page content as enhanced Markdown (GET /pages/{id}/markdown)pages.update_markdown(page_id, markdown)– replace page content with Markdown (POST /pages/{id}/markdown)pages.create(timezone=...)– IANA timezone string for resolving template variables (@now,@today)blocks.append_children(position=...)– insert blocks at"start","end", or"after_block"instead of always appending to the enddatabases.query(in_trash=...)– filter trashed / non-trashed rowsdatabases.query_all(in_trash=...)– same param forwarded through the auto-pagination helperdatabases.create(initial_data_source=...)– pre-populate a new database from a data source on creationdatabases.update(is_inline=..., in_trash=..., is_locked=...)– toggle inline layout, move to trash, or lock the databasePropertySchema.button()– automation button columnPropertySchema.location()– geographic location columnPropertySchema.last_visited_time()– read-only last-visited-time columnPropertySchema.rollup(relation_property_id=..., rollup_property_id=...)– optional ID-based lookup params for stable rollup definitionsPropertySchema.verification()– wiki page verification columnPropertyValue.verification()– set verification state on wiki pagesBlockContent.tab()/tab_group()– tab layout blocksFilter.created_by()/Filter.last_edited_by()– filter by creator or last editorFilter.formula(name, value_type)– filter on formula property results ("string","number","checkbox","date")Filter.rollup(name, aggregate, value_type)– filter on rollup aggregates ("any","every","none","number")Filter.verification()– filter on wiki verification state
- Fix
Search.search_pages()pagination — whenstart_cursorwas provided, a second unconditional API call immediately overwrote the result, making pagination effectively broken - Fix
Properties.set_date()silently droppingendwhenstartis not provided — theenddate is now correctly included alongside the auto-generatedstart(current datetime)
- Add
response.raise_for_status()to all HTTP methods inRequest(call_api_post,call_api_get,call_api_patch) so HTTP 4xx/5xx errors raise an exception immediately instead of silently returning an error JSON object
- Add
Optional[str]to all parameters that acceptNoneas a default value (start_cursor,text,url) acrossBlock,Database,Page,Search,Icon, andCover - Fix PEP 8 spacing in
Database:page_size:int =100→page_size: int = 100,title:str→title: str - Add missing
: strtype annotation toPage.__init__integrations_tokenparameter
- Add relation property support — finally resolving #9, open since Nov 21, 2022, with the help of vibe coding!
- Add
Properties.set_relation()to set relation values (list of page IDs) or define relation schema for database columns
- Add
- Add
Page.retrieve_page_property()to fetch full property values via/pages/{page_id}/properties/{property_id}endpoint- Required to read relation data that Notion API truncates in query results
- Update requests library to 2.33.1
- Drop Python 3.8, 3.9 support
- Add Python 3.13, 3.14 support
- Add Feature to get Created Time and Last Edited Time of a Page
- Add Feature to get Created By and Last Edited By of a Page
- Issue #30 : Request to Add Feature to get Create Time
- #30
- Update requests library to 2.32.4
- Version 2.32.4 of the requests library includes security fixes.
- Update requests library to 2.32.3
- Update setuptools library to 74.1.2
- fix security issue
- Update requests library to 2.32.0
- #20 Bump requests from 2.31.0 to 2.32.0
- Add support for is_inline param to create_database function
- Notion API supports creating new databases as inline of parent pages.
- #19
- contribution by @cl-fl
- Add retrieve block children
we've implemented all features, change the version rule to the semantic version.
and changed the license to LGPL 3 in the hope that many people use it.
- Apply tox, pylint tool
- Add type-hint code
- Implement run_query_database function
- Add support for Python 3.11
- Bump requests from 2.28.2 to 2.31.0
- past version
from notion_database.query import Direction, Timestamp
import notion_database.color as clr- current version (>1.0.0)
from notion_database.const.query import Direction, Timestamp
import notion_database.const.color as clr- Drop support for Python 3.7
- Deprecate query_database function
- move to run_query_database function
- HOTFIX : Fix wrong path for new Cover and Icon features
- Add Cover and Icon for DB, Page
- used to create and update method
- optional parameter
- FIX : fixed set_title, set_rich_text method
- PROPERTY.set_rich_text("summary", "")
- #13
- Add cover, icon part test
- HOTFIX : fixed set_number method
- Fix set_number method
- Update requests (2.28.2)
- Update typing-extensions (4.5.0)
- Add children part test
-
Add property
- Files Property.
-
Add parameter
- colors parameters for Children
HAPPY NEW YEAR!
- Add Date property
- PROPERTY.set_date("date", "2022-12-31T01:01:01.000+0900")
- PROPERTY.set_date("date", "2022-12-31T01:01:01.000+0900", "2023-01-10T01:01:01.000+0900")
- Fix set_checkbox bug
- Fix checkbox issue
- Update notion-version 2022-06-28
- Add Search Pages with Pagination
- Add Query Databases with Pagination
- Update requests (2.28.1)
- Update typing-extensions (4.3.0)
- Drop support for Python 3.6
- Add python 3.6, 3.7 compatibility
- typing-extensions
- Update notion-version 2022-02-22
- Add search_database, search_pages functions
- Add Direction, Timestamp Enum for search
- Update requests package version (2.27.1)
- List databases
- PR : Update setup.py
- hotfix : fix ModuleNotFoundError
- Add Children Blocks
- paragraph
- heading 1, heading 2, heading 3
- callout
- quote
- bulleted, numbered list item
- to do
- toggle
- code
- embed
- external image, video, file, pdf
- bookmark
- equation
- divider, table of contents, breadcrumb
- Children.set_body
-
Update notion-version 2021-08-16
-
Get/Remove Properties and Update Database
- Finding all pages in a database
- Add Create database
- Add check_field function
- Database duplicate issue
- Add list database
- Add Retrieve database
- Add update Page object
- Add Retrieve Page object
- Fix module path
- Initial project
- Add Create Page object