Comments (2)
In BlockParser class,
def parse_self(self) -> None:
if self.obj.get('object', None) and self.obj['object'] == 'page':
obj = notion.pages.retrieve(self.id)
PageParser(obj)
if self.obj.get('object', None) and self.obj['object'] == 'database':
obj = notion.databases.retrieve(self.id)
DatabaseParser(obj)
if self.obj.get('object', None) and self.obj['object'] == 'block':
if self.obj['type'] == 'child_page':
obj = notion.pages.retrieve(self.id)
ChildPageParser(obj)
if self.obj['type'] == 'child_database':
obj = notion.databases.retrieve(self.id)
ChildDatabaseParser(obj)
if self.obj['type'] in ['paragraph', 'bulleted_list_item', 'numbered_list_item', 'to_do', 'toggle', 'callout', 'quote']:
CommonTextParser(self.obj, self.parent_id)
if self.obj['type'] == 'link_to_page':
# Todo(steve): API return unsupport type
pass
if self.obj['type'] == 'table':
TableParser(self.obj, self.parent_id)
if self.obj['type'] == 'table_row':
pass
The piece of code would check what type of the current block, but Notion's API now is not easy to check "backlinks", therefore if you want to detect cycle, you have to detect "backlinks" at first. (you can refer to this project's code notion-backlinks-creator )
I will refine this code repo to make it easy to read afterwards, so I'm very happy to see you like it.
from notion-graph-view.
Hello, the project has been updated and published to PyPi.
If any chance, please have a try again. Thanks for using.
from notion-graph-view.
Related Issues (11)
- Authorisation problem - can you please help? HOT 1
- Crashes while building a graph HOT 5
- δΈζδΉ±η HOT 2
- requests.exceptions.HTTPError: Invalid input - message HOT 7
- nicodeEncodeError: 'charmap' HOT 3
- link_to_page working properly HOT 2
- Question: more link support? HOT 3
- Getting runtime error even after providing credentials HOT 2
- Could not find block with ID **** HOT 2
- Traceback error HOT 3
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-graph-view.