Skip to main content

Yet another unofficial Notion API client.

Project description

Nothion

Yet another unofficial Notion API client.

Installation

pip install nothion

Usage

from nothion import NotionClient

client = NotionClient(auth_secret="your_auth_token",
                      tasks_db_id: str | None = None,
                      stats_db_id: str | None = None,
                      notes_db_id: str | None = None,
                      expenses_db_id: str | None = None)
client.tasks.get_active_tasks()

Features

Tasks Handler

  • get_active_tasks()
  • get_notion_task(ticktick_task: Task)
  • get_notion_id(ticktick_task: Task)
  • is_already_created(task: Task)
  • create(task: Task)
  • update(task: Task)
  • complete(task: Task)
  • delete(task: Task)

Notes Handler

  • is_page_already_created(title: str, page_type: str)
  • create_page(title: str, page_type: str, page_subtype: tuple[str], date: datetime, content: str)

Stats Handler

  • get_incomplete_dates(limit_date: datetime) -> List[str]
  • update(stat_data: PersonalStats, overwrite_stats: bool = False)
  • get_between_dates(start_date: datetime, end_date: datetime) -> List[PersonalStats]

Expenses Handler

  • add_expense_log(expense_log: ExpenseLog)

Data Models

PersonalStats

This package uses a custom attrs model to store personal stats:

  • date: str
  • time_stats: TimeStats
  • weight: float

TimeStats

  • work_time: float
  • leisure_time: float
  • focus_time: float

ExpenseLog

This package uses a custom attrs model to store expense log data:

  • fecha: str
  • egresos: float
  • producto: str

Environment Variables

  • NT_AUTH: Notion auth token, for example secret_t1CdN9S8yicG5eWLUOfhcWaOscVnFXns.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nothion-0.4.3.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nothion-0.4.3-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file nothion-0.4.3.tar.gz.

File metadata

  • Download URL: nothion-0.4.3.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for nothion-0.4.3.tar.gz
Algorithm Hash digest
SHA256 fc631bf074145bfbfc6bf181e38e8555499d8ba1c8c231cf8c60e09f1cedd787
MD5 31a570abb37cfef91cee4168ec42cb10
BLAKE2b-256 39b698f2091ab2de7ed51294096c1e44b19daee71d26bf003386f4db00680a1c

See more details on using hashes here.

File details

Details for the file nothion-0.4.3-py3-none-any.whl.

File metadata

  • Download URL: nothion-0.4.3-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for nothion-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ea9646426e63f499e51b8d89282a6c8fd0bc847f58b3c291fcbeac614127eaba
MD5 1d42e097bd90c54fca409e0959978e15
BLAKE2b-256 93eead3d399e483e9f39de9b9ae48fd7063dfab5a37ddf9c759cf4da24e9d7da

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page