21 lines
577 B
Python
21 lines
577 B
Python
|
from notion_client import Client
|
||
|
|
||
|
|
||
|
class NotionClient:
|
||
|
client: Client
|
||
|
|
||
|
def __init__(self, token: str):
|
||
|
self.client = Client(auth=token)
|
||
|
|
||
|
def get_database_state(self, database_id: str):
|
||
|
return self.client.databases.query(database_id=database_id)
|
||
|
|
||
|
def update_card(self, page_id: str, **kwargs):
|
||
|
pass
|
||
|
# return self.client.databases.update(page_id, **kwargs)
|
||
|
|
||
|
def create_card(self, database_id: str, **kwargs):
|
||
|
return self.client.pages.create(
|
||
|
parent={"database_id": database_id}, properties=kwargs
|
||
|
)
|