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

Uploaded Python 3

File details

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

File metadata

  • Download URL: nothion-0.4.2.tar.gz
  • Upload date:
  • Size: 13.3 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.2.tar.gz
Algorithm Hash digest
SHA256 aa04d867973e85224a2e44ca9ba8aef6799abc0d1f6b00fb35ecb1786dbe9738
MD5 818d42291887fdb67d0caf88094fdd60
BLAKE2b-256 f8bd3badc48df5217426cf442f06bf77de519c2739a296bfa5e5d548580d45e8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nothion-0.4.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fcb03e29f2b0b47e324ec2eea59bf545e1ae8402081bd394c98970a2f89c4fe2
MD5 d6802d638c00529a2617794b83cdb364
BLAKE2b-256 475f7bfbad4353d2ceb1ffc4a9c82795cc58b733452318d8b747d891d7692303

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