-
-
Notifications
You must be signed in to change notification settings - Fork 164
Open
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Description
Hey thanks for the amazing library!
I'm using notion sdk to create and modify pages and I find hard to write properties in the right format as explained in Notion API docs https://developers.notion.com/reference/page-property-values this is my snippet of code:
await notion.pages.create(
parent={
"type": "database_id",
"database_id": "my_id",
},
properties={
"Name": {
"id": "title",
"title": [{"type": "text", "text": {"content": data.name}}],
},
"Email": {"email": data.email or None},
"Phone": {"phone_number": data.phone or None},
"Years of Experience": {
"number": data.years_of_experience,
},
"City": {
"rich_text": [{"type": "text", "text": {"content": data.city or None}}],
},
"Notes": {
"rich_text": [
{"type": "text", "text": {"content": data.notes or None}}
],
},
},
)It would be nice to have some helpers like EmailValue("luca@example.com") that creates the right dict for you {"email": "luca@example.com"} and eventually when reading a page it would include also "type": "email"
What do you think? Happy to come up with a PR
Luca
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed