Skip to main content

Add your description here

Project description

Anytype Loader

License

Community loader for Anytype spaces. Supports sync and async loading.

Installation

pip install anytype-loader            # defaults to langchain-core (1.x)
# pip install anytype-loader[langchain]  # add langchain 0.x support

Basic usage (sync)

from anytype_loader import AnytypeLoader

loader = AnytypeLoader(
    url="http://127.0.0.1:31009",
    api_key="YOUR_API_KEY",
    space_names=["Personal", "Work"],
    page_size=50,
    query="project",  # optional: use space search endpoint instead of full listing
)

docs = list(loader.lazy_load())

Basic usage (async)

import asyncio
from anytype_loader import AnytypeLoader

async def main():
    loader = AnytypeLoader(
        url="http://127.0.0.1:31009",
        api_key="YOUR_API_KEY",
        space_names=["Your Space"],
        page_size=50,
    )
    docs = [doc async for doc in loader.alazy_load()]
    print(len(docs))
    await loader.aclose()

asyncio.run(main())

What it does

  • Resolves provided space_names via /v1/spaces to get IDs.
  • Lists objects via /v1/spaces/:space_id/objects (or /v1/spaces/:space_id/search when query is set) with pagination (limit/offset).
  • Fetches each object via /v1/spaces/:space_id/objects/:object_id.
  • Returns Document objects with markdown content and flattened metadata including: space_id, space_name, object_id, name, archived, type, tags (tag names), and selected dates (created_at, updated_at, last_opened_at when present).

Example metadata from one document:

{
    "space_id": "<space_id>", 
    "space_name": "Johnson", 
    "object_id": "<object_id>", 
    "id": "<object_id>",
    "name": "Pattern - Availability", 
    "archived": false, 
    "type": "Page", 
    "created_at": "2024-11-02T21:20:00Z", 
    "tags": ["testTag"], 
    "updated_at": "2025-11-28T19:17:37Z", 
    "description": "Test Desc", 
    "last_opened_at": "2025-11-28T19:03:43Z"
}

Notes

  • Async path uses a pooled httpx.AsyncClient and bounded concurrency.
  • For LangChain 0.x support, wrap imports to fall back to langchain modules if langchain_core is unavailable.

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

anytype_loader-1.0.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

anytype_loader-1.0.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file anytype_loader-1.0.0.tar.gz.

File metadata

  • Download URL: anytype_loader-1.0.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for anytype_loader-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ebb8bff609e705b4fd388ea1c253c0b9d341ff991b1648157b7820e8cc7a32d2
MD5 5dc5de6fff6e532d4dae48db28f392ea
BLAKE2b-256 684e6851bde273625adaf17eb7030757c3f204838b471abcc494eea24333648e

See more details on using hashes here.

File details

Details for the file anytype_loader-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: anytype_loader-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for anytype_loader-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 46207c7f615e06bbfa21a9c828c394085664712d914b62c2311c18e854468afb
MD5 bb0def146d3a0aac7413febf402d553f
BLAKE2b-256 08f34039b018af281dd047319f39659dc01b0f6f02ed42d9dbad2c27067eeb7b

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