jamalex / notion-py

Unofficial Python API client for Notion.so
MIT License
4.28k stars 474 forks source link

Setting the property wrap cells? #238

Open IsakRein opened 3 years ago

IsakRein commented 3 years ago

Is there any way to change this property via script?

Screenshot 2020-12-15 at 11 32 25
aviral-batra commented 3 years ago

Yes, see this issue that I answered to see why this works:

tableview = client.get_collection_view(url) # enter the actual url of the table view here

# you can use .get() to visualise the data structure of the page
print(tableview.get())

# .get() gets the local cached dictionary of the table view
# you can change values in it
tableview.get()['format']['table_wrap'] = True # set it to False to turn wrap off

# .set() sets the local dict to the notion server through an api call
tableview.set(path=[], value=tableview.get())