Comments (1)
I found a way. I'm not Python dev.
First you need to get the block properties. Don't get it with block.title
method but which returns String but use block.get().get('properties').get('title')
which returns structure.
Than you are able to get Users based on mentions:
for part in block.get().get('properties').get('title'):
if len(part) > 1:
if part[0] == '‣':
if part[1][0][0] == 'u': # user mention
user_id = part[1][0][1]
todoAction = todoAction + ' **@' + client.get_user(user_id).full_name + '**'
todoActionList.append(' @' + client.get_user(user_id).full_name)
or you can get dates
if part[1][0][0] == 'd': # date
dateRecord = part[1][0][1]
date = datetime.date.fromisoformat(dateRecord.get('start_date'))
dateFormatted = date.strftime('*%d. %m. %Y*')
from notion-py.
Related Issues (20)
- > this is a pretty paralyzing issue. does anyone know how long it will take for it to get merged in? HOT 1
- Uploading image doesn't work HOT 2
- Need to cut a new release
- Notion crashes when setting CollectionView filter with no id HOT 2
- Is this module still work now? I got an error, outdated? HOT 1
- Failed To Run "setup.py" Due To Encoding Error
- requests.exceptions.HTTPError: Invalid input from client.get_block HOT 8
- Unsaved transactions: SpaceShardRecordPointer have no space id HOT 1
- raise InvalidNotionIdentifier(input_value)
- Help!!! requests.exceptions.HTTPError: Invalid input. HOT 4
- TypeError: Retry.__init__() got an unexpected keyword argument 'method_whitelist' HOT 3
- Client POST generates a HTTPError HOT 1
- (question) is there `get_all_comments`? HOT 1
- notion_client.errors.RequestTimeoutError: Request to Notion API has timed out
- HTTPError (400) when trying to load a database despite trying proposed solutions HOT 3
- Search (and find best matching page titles)
- Incompatible requests version with streamlit requirement HOT 1
- search_blocks not working?
- Error when creating NotionClient
- Error importing client
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from notion-py.