Closed 668168 closed 1 year ago
hello, @668168 thank you for using package. cover and icon are not yet supported. but develop has started and will be added in next version. (with previous issue bug fix)
@668168 Added a new feature for this issue.
# prepare object
cover = Cover()
cover.set_cover_image("https://github.githubassets.com/images/modules/logos_page/Octocat.png")
icon = Icon()
icon.set_icon_emoji("📚")
# use this (cover=cover, icon=icon)
D.create_database(page_id=page_id, title="TEST TITLE", properties=PROPERTY, cover=cover, icon=icon)
D.update_database(database_id=database_id, title="DB", add_properties=PROPERTY, cover=cover, icon=icon)
P.create_page(database_id=database_id, properties=PROPERTY, children=children, cover=cover, icon=icon)
P.update_page(page_id=page_id, properties=PROPERTY, cover=cover, icon=icon)
Wonderful 👍 👍 👍! the SET method works well, and there is 2 questions : First, Is there any GET mothod as get-properities? cover
Second, How can i choose the system emojis ?
@668168
D.retrieve_database(database_id, get_properties=True)
D.properties_list
Thank you, minwook,
For Question 1, Do you means neither the cover nor the icon can be extracted, and only the properties can be extracted?
For Question 2, Could you demonstrate how to insert an emoji specified in Unicode? The method shown below does not work. 😭
# Update Page
logger.debug("Update Page")
icon = Icon()
# icon.set_icon_image("😀")
P.update_page(page_id=page_id, properties=PROPERTY, cover=cover, icon=icon)
@668168 cover and icon has just been added and not support extraction yet. use in self.result (dict type)
and... Question 2 This works.
logger.debug("Update Page")
icon = Icon()
icon.set_icon_emoji("😀")
P.update_page(page_id=page_id, properties=PROPERTY, icon=icon)
If don't use cover, remove parameter as well.
@minwook-shin , Yes, It works!
ref: https://developers.notion.com/changelog/page-icons-cover-images-new-block-types-and-improved-page-file-properties https://developers.notion.com/reference/post-page