Comments (5)
Note that the slugified name can already be accessed as a property: row.license_s
. But that's not amenable to passing in the non-slugified name. But adding __getitem__
could be good too, if you would find that idiom useful! I don't see any issues with it, and it would allow use of versions of the name that can't be used as property names directly.
PR's welcome for this! (see below)
from notion-py.
Another note: row.get("...")
is very different from row.get_property
. The data structure for a page (in this case, a collection row) is something like:
In [22]: row.get()
Out[22]:
{'alive': True,
'created_by': 'f86b4884-75fd-41ba-9161-2fad359c775e',
'created_time': 1545009470407,
'id': 'd7f9a19a-b595-49c0-a2ae-58e7d5248a67',
'last_edited_by': 'f86b4884-75fd-41ba-9161-2fad359c775e',
'last_edited_time': 1557276849563,
'parent_id': '02a32a6b-aee3-4868-b2f9-01da7ec88686',
'parent_table': 'collection',
'properties': {'f=DE': [['QQQ']], 'title': [['My title']], 'vFY4': [['No']]},
'type': 'page',
'version': 22}
The get
method reads data from this top-level dict. So you can do row.get("version")
to get 22
. The get_property
method, on the other hand, pokes inside the properties
subkey, and provide a bunch of assistance with making it less painful (converting human-readable property names into the underlying 4-character "property ID", converting internal value data formats into Pythonic data, etc). So I think it would actually be best to avoid adding additional interfaces onto these data structures, since it might just compound the complexity.
from notion-py.
Instead, I'll go back and fix the original issue being reported here. :)
It looks as if get_all_properties
didn't do full slugification, which is the source of the inconsistency. Fixing that shortly!
from notion-py.
Fixed in #23, which will shortly be released as 0.0.21!
from notion-py.
Version 0.0.21 has now been released to PyPI! Please give it a try and see how it works for you. Thanks for reporting issues!
from notion-py.
Related Issues (20)
- HTTPERROR using children.add_new
- collection.add_row() fails on new databases HOT 2
- How to set database column calculation?
- Not documented: how to set the size of an image HOT 1
- > 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)
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.