Skip to main content

LangChain Tools & Toolkit for Notion (search pages, get page, create page).

Project description

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.

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

langchain_notion-0.1.1.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_notion-0.1.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file langchain_notion-0.1.1.tar.gz.

File metadata

  • Download URL: langchain_notion-0.1.1.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.12.2 Linux/6.8.0-60-generic

File hashes

Hashes for langchain_notion-0.1.1.tar.gz
Algorithm Hash digest
SHA256 89d5defcf4fa47126d3f169026aca6cdc0baac5a9bf7588adbdc8ab7a90a2d17
MD5 ef0500ed77fb527fa72293b31934e4cc
BLAKE2b-256 4470aec42d22b01201b657f762c9956566c0f257aecb18e5188cea79ac9f5100

See more details on using hashes here.

File details

Details for the file langchain_notion-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: langchain_notion-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.12.2 Linux/6.8.0-60-generic

File hashes

Hashes for langchain_notion-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0b2600570bb2a4f373c14cb3444c6ec7530ce9c38d47b951bcd4682ddb395f58
MD5 f9eefae120bd6a0dbb71522929a963bd
BLAKE2b-256 245f6112c2bd7c786c403967b24461b21b08ec5526fff2ca7a174ec11c0e7862

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