Skip to main content

Langchain Document loader for Outline

Project description

Langchain Outline Document Loader

Overview

langchain-outline provides a DocumentLoader for Langchain that allows you to load documents directly from an Outline knowledge base instance.

This loader uses the Outline API to fetch all documents within your instance.

Installation

pip install langchain-outline

Configuration

The loader requires the URL of your Outline instance and an API key for authentication.

Usage

import os
from langchain_outline.outline import OutlineLoader

# Option 1: Using environment variables (ensure they are set)
# os.environ["OUTLINE_INSTANCE_URL"] = "YOUR_OUTLINE_URL"
# os.environ["OUTLINE_API_KEY"] = "YOUR_API_KEY"
# loader = OutlineLoader()

# Option 2: Passing parameters directly
loader = OutlineLoader(
    outline_base_url="YOUR_OUTLINE_URL",
    outline_api_key="YOUR_API_KEY"
)

# Load documents (iteratively)
docs_iterator = loader.lazy_load()
for doc in docs_iterator:
    print(f"Loaded document: {doc.metadata['title']}")
    # Process the document...

# Or load all documents into a list (might consume more memory for large instances)
all_docs = loader.load()
print(f"Loaded {len(all_docs)} documents.")

Replace "YOUR_OUTLINE_URL" and "YOUR_API_KEY" with your actual Outline instance URL and API key.

Async usage

OutlineLoader also supports non-blocking async loading, backed by httpx.AsyncClient, for use in async applications:

import asyncio
from langchain_outline.outline import OutlineLoader

async def main():
    loader = OutlineLoader(
        outline_base_url="YOUR_OUTLINE_URL",
        outline_api_key="YOUR_API_KEY"
    )

    # Load documents (iteratively)
    async for doc in loader.alazy_load():
        print(f"Loaded document: {doc.metadata['title']}")
        # Process the document...

    # Or load all documents into a list (might consume more memory for large instances)
    all_docs = await loader.aload()
    print(f"Loaded {len(all_docs)} documents.")

asyncio.run(main())

httpx is a direct dependency of this package used for the async loading path.

For maintainers

To build and test publishing to TestPyPi

To publish a new version of the package you can use poetry (or twine, etc). First test using TestPyPi first.

  1. Make sure you have TestPyPi as a repo:

poetry config repositories.testpypi https://test.pypi.org/legacy/

  1. Obtain API token from TestPyPi and add it to poetry config:

poetry config pypi-token.testpypi <<token from testpypi>>

  1. Publish the package to TestPypi (make sure version defined in pyproject.toml follows PEP440):

poetry publish --build --repository testpypi

To publish to PyPi

To publish a new version of the package you can use poetry (or twine, etc). First test using TestPyPi first.

  1. Obtain API token from PyPi and add it to poetry config:

poetry config pypi-token.pypi <<token from pypi>>

  1. Publish the package to PyPi (make sure version defined in pyproject.toml follows PEP440):

poetry publish --build

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_outline-0.4.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

langchain_outline-0.4.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file langchain_outline-0.4.0.tar.gz.

File metadata

  • Download URL: langchain_outline-0.4.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.11 Darwin/25.5.0

File hashes

Hashes for langchain_outline-0.4.0.tar.gz
Algorithm Hash digest
SHA256 d4ef176ee9dd3292129dad2d43ce152dc72035fc6d55251583424cd075cffeef
MD5 8ff85dd1d677ee9875c6ccd125d50d3d
BLAKE2b-256 ac8cfc6ad9a98fcabd1ceb11121410a73c2e524dbee4ba4ed9437e4d611ce7e6

See more details on using hashes here.

File details

Details for the file langchain_outline-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: langchain_outline-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.11 Darwin/25.5.0

File hashes

Hashes for langchain_outline-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 292fc38d8caf0e7634f48f26e009b9bf6dc36584ff09b2704e8e86980fc26312
MD5 f8aa962958c9a65edcb83dcae90c3076
BLAKE2b-256 d3c144f91b5b8933ba9becf0bb0ee700c2155ad51fb50cdde65ee079f55ea97f

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