Ok thanks, nd how can i extract the title and year from this?
{‘object’: ‘page’, ‘id’: ‘19f6716c-a1e8-803d-a550-ddc28a92f3dd’, ‘created_time’: ‘2025-02-19T09:02:00.000Z’, ‘last_edited_time’: ‘2025-02-20T12:10:00.000Z’, ‘created_by’: {‘object’: ‘user’, ‘id’: ‘174d872b-594c-813d-8ee5-000239d1eda2’}, ‘last_edited_by’: {‘object’: ‘user’, ‘id’: ‘174d872b-594c-813d-8ee5-000239d1eda2’}, ‘cover’: None, ‘icon’: None, ‘parent’: {‘type’: ‘database_id’, ‘database_id’: ‘18a6716c-a1e8-80f8-925c-dbe7047b9c2c’}, ‘archived’: False, ‘in_trash’: False, ‘properties’: {‘Clear for RAG’: {‘id’: ‘%3Bhfe’, ‘type’: ‘checkbox’, ‘checkbox’: True}, ‘Site’: {‘id’: ‘AF%60S’, ‘type’: ‘select’, ‘select’: {‘id’: ‘7cf96d97-853e-492c-88b7-7bce6903443d’, ‘name’: ‘Brazil’, ‘color’: ‘green’}}, ‘URL’: {‘id’: ‘A_%3C%5E’, ‘type’: ‘url’, ‘url’: None}, ‘IONIQ_RAG_ITEMS’: {‘id’: ‘Cggt’, ‘type’: ‘relation’, ‘relation’: [{‘id’: ‘19f6716c-a1e8-801a-8535-e4f13d5a915d’}, {‘id’: ‘19f6716c-a1e8-8095-9436-cb37613c362f’}, {‘id’: ‘19f6716c-a1e8-809e-a5db-ec06d7f930bc’}], ‘has_more’: False}, ‘Priority’: {‘id’: ‘EE%7C%3F’, ‘type’: ‘select’, ‘select’: {‘id’: ‘fc6e11e5-790f-4c9b-b7e4-d4f230de91f6’, ‘name’: ‘High’, ‘color’: ‘green’}}, ‘Full_Title’: {‘id’: ‘ESj%3C’, ‘type’: ‘rich_text’, ‘rich_text’: [{‘type’: ‘text’, ‘text’: {‘content’: ‘Euterpe edulis ’, ‘link’: None}, ‘annotations’: {‘bold’: True, ‘italic’: True, ‘strikethrough’: False, ‘underline’: False, ‘code’: False, ‘color’: ‘default’}, ‘plain_text’: ‘Euterpe edulis ’, ‘href’: None}, {‘type’: ‘text’, ‘text’: {‘content’: ‘(Jucara palm)’, ‘link’: None}, ‘annotations’: {‘bold’: True, ‘italic’: False, ‘strikethrough’: False, ‘underline’: False, ‘code’: False, ‘color’: ‘default’}, ‘plain_text’: ‘(Jucara palm)’, ‘href’: None}, {‘type’: ‘text’, ‘text’: {‘content’: ’ - Biomimicry 3.8 Research’, ‘link’: None}, ‘annotations’: {‘bold’: False, ‘italic’: False, ‘strikethrough’: False, ‘underline’: False, ‘code’: False, ‘color’: ‘default’}, ‘plain_text’: ’ - Biomimicry 3.8 Research’, ‘href’: None}]}, ‘Type’: {‘id’: ‘N%5CD%3A’, ‘type’: ‘select’, ‘select’: {‘id’: ‘79bec805-4b98-425b-8a3e-b2ddb0f43af7’, ‘name’: ‘Consultant_Info’, ‘color’: ‘orange’}}, ‘Citation’: {‘id’: ‘Y%3EYT’, ‘type’: ‘rich_text’, ‘rich_text’: []}, ‘Year’: {‘id’: ‘%5B%40EA’, ‘type’: ‘rich_text’, ‘rich_text’: [{‘type’: ‘text’, ‘text’: {‘content’: ‘2025’, ‘link’: None}, ‘annotations’: {‘bold’: False, ‘italic’: False, ‘strikethrough’: False, ‘underline’: False, ‘code’: False, ‘color’: ‘default’}, ‘plain_text’: ‘2025’, ‘href’: None}]}, ‘Author’: {‘id’: ‘fxqS’, ‘type’: ‘rich_text’, ‘rich_text’: [{‘type’: ‘text’, ‘text’: {‘content’: ‘Brittany Jerlinga (Biomimicry 3.8)’, ‘link’: None}, ‘annotations’: {‘bold’: False, ‘italic’: False, ‘strikethrough’: False, ‘underline’: False, ‘code’: False, ‘color’: ‘default’}, ‘plain_text’: ‘Brittany Jerlinga (Biomimicry 3.8)’, ‘href’: None}]}, ‘ID’: {‘id’: ‘rhcL’, ‘type’: ‘unique_id’, ‘unique_id’: {‘prefix’: None, ‘number’: 38}}, ‘License Status ’: {‘id’: ‘t_W_’, ‘type’: ‘relation’, ‘relation’: [], ‘has_more’: False}, ‘License Info’: {‘id’: ‘%7DuO%5D’, ‘type’: ‘rich_text’, ‘rich_text’: [{‘type’: ‘text’, ‘text’: {‘content’: ‘Paid Consultant Research’, ‘link’: None}, ‘annotations’: {‘bold’: False, ‘italic’: False, ‘strikethrough’: False, ‘underline’: False, ‘code’: False, ‘color’: ‘default’}, ‘plain_text’: ‘Paid Consultant Research’, ‘href’: None}]}, ‘Item_Title’: {‘id’: ‘title’, ‘type’: ‘title’, ‘title’: [{‘type’: ‘text’, ‘text’: {‘content’: ‘Euterpe edulis ’, ‘link’: None}, ‘annotations’: {‘bold’: True, ‘italic’: True, ‘strikethrough’: False, ‘underline’: False, ‘code’: False, ‘color’: ‘default’}, ‘plain_text’: ‘Euterpe edulis ’, ‘href’: None}, {‘type’: ‘text’, ‘text’: {‘content’: ‘(Jucara palm)’, ‘link’: None}, ‘annotations’: {‘bold’: True, ‘italic’: False, ‘strikethrough’: False, ‘underline’: False, ‘code’: False, ‘color’: ‘default’}, ‘plain_text’: ‘(Jucara palm)’, ‘href’: None}, {‘type’: ‘text’, ‘text’: {‘content’: ’ - Biomimicry 3.8 Research’, ‘link’: None}, ‘annotations’: {‘bold’: False, ‘italic’: False, ‘strikethrough’: False, ‘underline’: False, ‘code’: False, ‘color’: ‘default’}, ‘plain_text’: ’ - Biomimicry 3.8 Research’, ‘href’: None}]}}, ‘url’: ‘https://www.notion.so/Euterpe-edulis-Jucara-palm-Biomimicry-3-8-Research-19f6716ca1e8803da550ddc28a92f3dd’, ‘public_url’: ‘https://uncharted-limbo.notion.site/Euterpe-edulis-Jucara-palm-Biomimicry-3-8-Research-19f6716ca1e8803da550ddc28a92f3dd’, ‘request_id’: ‘de5f2117-070a-497e-a7e3-0d0308b1b237’}
i am currently doing that
data = notion_get_page(page_id)
print(f”NEW ITEM ----------- {data}”)
# Extract relevant data from the response (for example, title)
page_metadata = {
“title”: data[‘properties’].get(‘Full_Title’, {}).get(‘title’, [{}])[0].get(‘text’, {}).get(‘content’,“No Title”),
“author”: data[‘properties’].get(‘Author’, {}).get(‘rich_text’, [{}])[0].get(‘text’, {}).get(‘content’,
“Unknown Author”),
“type”: data[‘properties’].get(‘Type’, {}).get(‘select’, {}).get(‘name’, “Unknown Type”),
“year”: data[‘properties’].get(‘Year’, {}).get(‘number’, “Unknown Year”),
“url”: data[‘properties’].get(‘URL’, {}).get(‘url’, “No URL”)
}
and i am getting no Title and unknown Year