Skip to main content

MuMu-Notion

Mumu-Notion, a simple and easy-to-use Notion client, is based on the official SDK modification.

Implemented features

  • Latest Notion API support: The code uses the 2022-06-28 version of Notion.
  • Complete API coverage: all methods of the official Notion API documentation (https://developers.notion.com/reference/) have been wrapped.
  • Simple request validation: locally verifies whether the user's request is legal, currently supports key validation of the outermost parameters (e.g., whether the parameters provided by the user are complete, whether there are parameters not included in the API documentation), while value validation and nested parameter validation are still under development.
  • Synchronous Client request, which uses httpx for synchronous HTTP requests, asynchronous request feature is under development.
  • Complete code examples covering 100% of the client methods and over 90% of the code.
  • Complete tests, covering 98%+ of the client code.

Requirements

  • Python >= 3.7
  • httpx >= 0.23.0

Installation

Just install it using pip.

pip install mumu-notion

Usage

Before using mumu-notion, you need to create an integration token, and share at least one page with that integration.

Client initialization

To initialize Notion Client by passing in a dictionary (dictionary parameter style) containing auth_token (the token of the above integration, starting with secret_).

from mumu_notion import Client

client = Client({
    "auth_token": "your_integration_token"
})

There is another way to initialize, passed in keyword parameter style.

from mumu_notion import Client

client = Client(
    auth_token="your_integration_token"
)

The dictionary parameter style and the keyword parameter style also apply to the methods of the client, and we will give the invocation of each style later.

💡 Note!!!

To avoid leaks of the integration token, we do not recommend hard-coding the token explicitly in your source code. It is better to write it to the environment variables and then initialize the client by

import os
from mumu_notion import Client

token = os.getenv("NOTION_AUTH_TOKEN")
client = Client(
auth_token=token
)

In addition to auth_token, Client has several optional initialization parameters, whose names and meanings are shown in the following table.

parameter name type default value description
auth_token str no default value Integration Token
notion_version str "2022-06-28" Notion's version
base_url str "https://api.notion.com/v1" The root URL for sending API requests
timeout_ms int 90_000 The number of milliseconds to wait before issuing a RequestTimeoutError

How-tos

See our wikis for details.

Code Examples

We provide code examples that cover all methods of the client and the data is taken from Notion's official documentation.

See also: https://github.com/JezaChen/mumu-notion/tree/master/examples/official_guides

Metadata

Release files for mumu-notion 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mumu-notion 0.0.3
File Size Uploaded
mumu-notion-0.0.3.tar.gz 16.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mumu-notion 0.0.3
File Interpreter ABI Platform
mumu_notion-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 34.6 kB

Release files / mumu-notion-0.0.3.tar.gz

Download URL mumu-notion-0.0.3.tar.gz
Size 16.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a5ec3e3cceddecf9f4ddb799c64758d21b67cde088cdc10161203aaed9cd64d9
BLAKE2b-256 checksum
How to use checksums
cecd7450d96a5422f0cdf3d2875b700598ae256d8ae48cde7b3c851b6cda1d76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / mumu_notion-0.0.3-py3-none-any.whl

Download URL mumu_notion-0.0.3-py3-none-any.whl
Size 18.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca5a6098bbb239f5be87dc35231c9edf701365a4af307da3614a4b77799ca022
BLAKE2b-256 checksum
How to use checksums
2d9aa24953048209e49d3c44a134afe17d394e57bfeac4e94b1cd598371042cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page