Giter Club home page Giter Club logo

Comments (3)

ArtemErmulin avatar ArtemErmulin commented on August 18, 2024

Yeah, I have the same.

from notion-py.

arturtamborski avatar arturtamborski commented on August 18, 2024

Looks like a change in notion.so API, will see into it

from notion-py.

arturtamborski avatar arturtamborski commented on August 18, 2024

yup, they added new key __json__ to recordMap (huge dict with state of basically everything). What's funny is that this key is empty, so I don't know why they did it. Anyway, it's simple enough to fix, will send patch shortly.

In the meantime you can fix by hand it like so:

diff --git a/notion/store.py b/notion/store.py
index 08aa37d..1de6a1a 100644
--- a/notion/store.py
+++ b/notion/store.py
@@ -294,6 +294,8 @@ class RecordStore:
 
     def store_record_map(self, data: dict) -> dict:
         data = data["recordMap"]
+        data.pop('__json__')
+
         for table, records in data.items():
             for record_id, record in records.items():
                 self._update_record(

Details of API change:
(note to self: I should probably track this way more closely)

Before:

(Pdb) data['recordMap'].keys()
dict_keys(['notion_user', 'user_root', 'user_settings', 'space_view', 'space', 'block', 'collection'])

After:

(Pdb) data['recordMap'].keys()
dict_keys(['notion_user', 'user_root', 'user_settings', 'space_view', 'space', 'block', 'collection', '__json__'])

from notion-py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.