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")
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)
  • update(stat_data: PersonalStats, overwrite_stats: bool = False)
  • get_between_dates(start_date: datetime, end_date: datetime)

Expenses Handler

  • add_expense_log(expense_log: ExpenseLog)

Personal Stats model

This package uses a custom attrs model to store personal stats, it has the following attributes:

PersonalStats:

  • time_stats: TimeStats
  • weight: float

TimeStats:

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

ExpenseLog model

This package uses a custom attrs model to store expense log data, it has the following attributes:

ExpenseLog:

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

Environment variables

  • NT_AUTH: Notion auth token, for example secret_t1CdN9S8yicG5eWLUOfhcWaOscVnFXns.
  • NT_TASKS_DB_ID: Notion tasks database id
  • NT_NOTES_DB_ID: Notion notes database id
  • NT_STATS_DB_ID: Notion stats database id
  • NT_EXPENSES_DB_ID: Notion expenses database id

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.1.tar.gz (13.5 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.1-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nothion-0.4.1.tar.gz
  • Upload date:
  • Size: 13.5 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.1.tar.gz
Algorithm Hash digest
SHA256 eb857c8891750ffc8ae84d8eb1285cd8a27e9d52da907f3935deb6adce983289
MD5 708b3be3aa703b3e8360728a79567bb1
BLAKE2b-256 78956bfb642cdc23cc0a29eb89d7e29dc0fc9be23e45bf88df6350581ffc21d0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nothion-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 11.3 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bd61438cc6a2cf916321b726bfb6b446b6c934e7fe6f307bfa7848eb7ef4e4b0
MD5 d8fa3c5edb6b93d0cf1add35d116665c
BLAKE2b-256 d8e69f11ed4256a06606ac9f733cc0d21662f73ca50bfbf3f49db66d3e8f7581

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