Skip to main content

langchain-notion

This package provides a LangChain integration for interacting with Notion via the LangchainNotion toolkit and tools. It enables you to access, search, create, and update Notion pages programmatically using LangChain interfaces.

Installation

pip install -U langchain-notion

Configuration

Set your Notion API key as an environment variable before using the toolkit:

export NOTION_API_KEY="your-notion-api-key"

Usage: Notion Toolkit & Tools

The toolkit provides tools for interacting with Notion pages:

import os
from langchain_notion.toolkits import LangchainNotionToolkit
from langchain_notion.notion_wrapper import NotionWrapper

key = os.environ.get("NOTION_API_KEY")
api = NotionWrapper(api_key=key)
toolkit = LangchainNotionToolkit.from_notion_wrapper(api, include_write_tools=True)
tools = toolkit.get_tools()

# Example: Search for pages
tool = next(t for t in tools if t.name == "Search Pages")
print(tool.invoke({"tool_input": "test"}))

Project Structure & Maintenance

  • All code is in the langchain_notion/ directory.
  • Tests are in tests/unit_tests/.
  • The .gitignore is set up to ignore build, cache, and notebook checkpoint files.

Publishing to LangChain

After publishing your package to PyPI, you can submit it to the LangChain Hub by following their contribution guidelines. Make sure your package is well-documented and tested.

License

This project is licensed under the MIT License.

Metadata

Release files for langchain-notion 0.1.1

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

Source distribution (sdist)

Source distribution for langchain-notion 0.1.1
File Size Uploaded
langchain_notion-0.1.1.tar.gz 6.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-notion 0.1.1
File Interpreter ABI Platform
langchain_notion-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 14.3 kB

Release files / langchain_notion-0.1.1.tar.gz

Download URL langchain_notion-0.1.1.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
89d5defcf4fa47126d3f169026aca6cdc0baac5a9bf7588adbdc8ab7a90a2d17
BLAKE2b-256 checksum
How to use checksums
4470aec42d22b01201b657f762c9956566c0f257aecb18e5188cea79ac9f5100
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.4 CPython/3.12.2 Linux/6.8.0-60-generic

Release files / langchain_notion-0.1.1-py3-none-any.whl

Download URL langchain_notion-0.1.1-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0b2600570bb2a4f373c14cb3444c6ec7530ce9c38d47b951bcd4682ddb395f58
BLAKE2b-256 checksum
How to use checksums
245f6112c2bd7c786c403967b24461b21b08ec5526fff2ca7a174ec11c0e7862
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.4 CPython/3.12.2 Linux/6.8.0-60-generic

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

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