← Back to Skills Marketplace
534422530

Notion助手

by 534422530 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
47
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install laosi-notion
Description
Notion API助手 - 创建和管理Notion页面、数据库,支持笔记和知识管理。
README (SKILL.md)

Notion Helper - Notion助手

激活词: Notion / 笔记管理 / 知识库

安装

pip install notion-client

获取API密钥

  1. 访问 https://www.notion.so/my-integrations
  2. 创建新集成
  3. 复制API密钥
  4. 分享数据库给集成

Python实现

from notion_client import AsyncClient
import asyncio

class NotionHelper:
    def __init__(self, token: str):
        self.client = AsyncClient(auth=token)
    
    async def create_page(self, parent_id: str, title: str, content: str = ""):
        await self.client.pages.create(
            parent={"database_id": parent_id},
            properties={
                "title": {
                    "title": [{"text": {"content": title}}]
                }
            },
            children=[{
                "object": "block",
                "type": "paragraph",
                "paragraph": {
                    "rich_text": [{"type": "text", "text": {"content": content}}]
                }
            }]
        )
    
    async def query_database(self, db_id: str, filter_props: dict = None):
        params = {"database_id": db_id}
        if filter_props:
            params["filter"] = filter_props
        return await self.client.databases.query(**params)
    
    async def update_page(self, page_id: str, properties: dict):
        await self.client.pages.update(page_id, properties=properties)
    
    async def get_page(self, page_id: str):
        return await self.client.pages.retrieve(page_id)
    
    async def search(self, query: str):
        return await self.client.search(query)

使用示例

async def main():
    helper = NotionHelper("secret_xxx")
    
    # 创建页面
    await helper.create_page(
        parent_id="database_id",
        title="AI学习笔记",
        content="今天学习了机器学习..."
    )
    
    # 搜索页面
    results = await helper.search("AI")
    for page in results['results']:
        print(page['title'])
    
    # 查询数据库
    pages = await helper.query_database("database_id")
    for page in pages['results']:
        print(page['properties']['title']['title'][0]['text']['content'])

asyncio.run(main())

数据类型

类型 说明
title 标题
rich_text 文本
number 数字
checkbox 复选框
select 单选
multi_select 多选
date 日期
url 链接
email 邮箱
phone_number 电话

使用场景

  1. 知识库管理
  2. 任务跟踪
  3. 笔记整理
  4. 项目管理
Usage Guidance
This skill appears to be what it says: instructions and examples only interact with the Notion API. Before installing or using it: 1) Install 'notion-client' in a virtualenv and verify the package/version on PyPI. 2) Create a Notion integration with the minimum scopes needed and share only the relevant database(s). 3) Do not paste your integration token into public chat; prefer setting NOTION_TOKEN (or another env var) and passing it to the code at runtime. 4) If you plan to let an automated agent use this skill, restrict the token's permissions and monitor activity in your Notion workspace.
Capability Analysis
Type: OpenClaw Skill Name: laosi-notion Version: 1.0.0 The skill bundle provides a standard and transparent implementation for interacting with the Notion API using the official 'notion-client' library. The Python code in SKILL.md contains basic CRUD operations (create, query, update, search) that align perfectly with the stated purpose of a Notion helper, with no evidence of data exfiltration, malicious execution, or prompt injection.
Capability Assessment
Purpose & Capability
Name and description describe Notion API operations (create/query/update/search). The SKILL.md provides pip install instructions and Python examples using notion-client and a Notion integration token — these are coherent with the stated purpose.
Instruction Scope
Runtime instructions and example code are limited to interacting with the Notion API and do not instruct reading unrelated files, system config, or sending data to external endpoints other than Notion. The examples do show passing an integration token directly to the helper (inline 'secret_xxx'), which is a documentation choice rather than scope creep.
Install Mechanism
This is an instruction-only skill with no install spec; SKILL.md recommends 'pip install notion-client' (a public PyPI package). This is a common, low-risk installation route, but users should install Python packages in a virtual environment and verify the package source/version before installing.
Credentials
The skill reasonably requires a Notion integration token, and does not request unrelated credentials. However, the registry metadata lists no required env vars while the examples expect a token value; the author should declare a primary credential (e.g., NOTION_TOKEN). Users should avoid pasting tokens into chat and prefer environment variables or secure secrets storage with least privilege.
Persistence & Privilege
The skill does not request persistent privileges (always:false), does not modify other skills or system-wide settings, and is user-invocable. Autonomous invocation is permitted by platform default but is not combined with any broad or unexplained privileges here.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install laosi-notion
  3. After installation, invoke the skill by name or use /laosi-notion
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of Notion Helper: - Provides async Python class for interacting with the Notion API - Supports creating, querying, updating, and retrieving Notion pages and databases - Includes examples for note-taking, database querying, and knowledge management - Simple setup instructions for API key and `notion-client` dependency
Metadata
Slug laosi-notion
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Notion助手?

Notion API助手 - 创建和管理Notion页面、数据库,支持笔记和知识管理。 It is an AI Agent Skill for Claude Code / OpenClaw, with 47 downloads so far.

How do I install Notion助手?

Run "/install laosi-notion" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Notion助手 free?

Yes, Notion助手 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Notion助手 support?

Notion助手 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Notion助手?

It is built and maintained by 534422530 (@534422530); the current version is v1.0.0.

💬 Comments