Notion-api

Latest version: v0.7.4

Safety actively analyzes 682457 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 3

0.7.4

* Update readme examples. | Remove license from pyproject dynamic.

* Fix RichTextBlock set_text method, remove new `request_id` key returned by Notion. | Fix typo causing page title error.

* propertyitem bug fixes. | Change propertyitem return values to return None. | Update propertyitem repr to return json value.

* Add property_id param to Page.retrieve_property_item(). | Optimize retrieving page property items. | Update repr's

* Update notion.Block classmethods to accept strings, and use empty string defaults.

0.7.0

Breaking Changes:
**Replaced query methods for `notion.Database`.**
- The old `query()` method was renamed to `_query()`, and the `query_all()` method introduced in [v0.6.0](https://github.com/ayvi-0001/notion-api/releases/tag/v0.6.0) was renamed to `query()`.
- The old `query_pages()` method was renamed to `_query_pages()`, and the `query_all_pages()` method introduced in [v0.6.0](https://github.com/ayvi-0001/notion-api/releases/tag/v0.6.0) was renamed to `query_pages()`.

**Replaced retrieve comment method for `notion.Workspace`**
- The old `retrieve_comments()` method was renamed to `_retrieve_comments()`, and the `retrieve_all_comments()` method introduced in [v0.6.0](https://github.com/ayvi-0001/notion-api/releases/tag/v0.6.0) was renamed to `retrieve_comments()`.

---

Changes:
- Added additional error handling when a response doesn't return a valid json.
There has been an issue with the Notion API for several months where it returns an html response for a Gateway time-out error.
This wasn't handled in the http requests and all it did was return a `JSONDecodeError`. Now it will show what the error actually was.
- Added the `title_column` param for `notion.Database.create`. This is the same as the `name_column` param, which will remain until it's removed in a future update. The default value was also changed from "Name" to "title".
- Added a default empty string for the `page_title` param in `notion.Page.create`.
- Updated `retrieve_user` method for `notion.Workspace` to return a dictionary instead of `UserObject`.
- Removed the optional dependency `orjson`.
- Removed cached_properties.
- Added option/file objects to the `properties` module that were missing.
- Added the `name` param to the `ExternalFile` object. This was missing and need when using `notion.Page.set_files()`.

0.6.0

Changes/Additions:
- New methods; `query_all()` & `query_all_pages()` for notion.Database. These handle pagination and will replace the previous versions in a later update. Previous methods are pending deprecation.
- New methods; `retrieve_all_comments()` for notion.Workspace. This handles pagination and will replace the previous version in a later update. Previous method is pending deprecation.
- New `after` parameter for appending block endpoints. These are present in all notion.Block class methods.
- 2 new error codes: `gateway_timeout` and `invalid_grant`.
- New `public_url` property added to Page/Database.

Fixes
- error in retrieving a date_formula property item.
- error in Sort filter.

0.5.0

Changes:
- Removed class `notion.BlockFactory`. Block creation methods moved to `notion.Block` classmethods.
- Updated name for creating synced blocks: new_synced_block -> original_synced_block | reference_synced_block -> duplicate_synced_block
- Add block extension module with classes: `CodeBlock`, `RichTextBlock`, `TableBlock`, `EquationBlock`, `ToDoBlock`
- Revised module exports from `notion` and `notion.properties`.
- Remove `filter_property_values` from Database `query_pages()`.

Additions:
- Add remaining block types (Table, TableRows, Video, Image).
- Add examples for block extensions.

Fixes:
- Update `strike` param in `Annotations` to `strikethrough`.
- Remove `Equation` param for rich_text sequences.

0.5.0alpha

**Full Changelog**: https://github.com/ayvi-0001/notion-api/compare/v0.4.1-alpha...v0.5.0-alpha

0.4.0

Additions:
Add setters to `Database` for database description, inline status.
Add setters to `Database` and `Page` for cover/icon.
Add `query_pages` method to Database. Same parameters as `query` method, but retrieves page ids in results and returns a list of Page objects.
Add __getattr__ to page to search from property items
Add propertyitems module with helper functions to retrieve values from property items

Changes:
Client checks for environment variable `TZ` for timezone info.
Remove log messages.
`delete_self` property in `Block` does not return the deleted block anymore, returns none.

Fixes:
Remove redundant errors. Switch incorrect notion errors for Type/Value errors.
Remove 2nd cached property in `Page`.
Clarify docstrings in database and page methods.

Page 1 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.