LlamaIndex data loaders for Feishu/Lark wiki, docs, and drive
Project description
LlamaIndex Feishu Readers
Load documents from Feishu/Lark into LlamaIndex. This package provides three readers backed by the official lark-oapi SDK:
- FeishuWikiReader — load documents from wiki spaces (with recursive subnode support)
- FeishuDocsReader — load individual docx documents by token
- FeishuDriveReader — load docx documents from cloud drive folders (with recursive subfolder support)
[!NOTE] The official
llama-index-readers-feishu-wikipackage has been removed from LlamaIndex, andllama-index-readers-feishu-docsis no longer maintained. This project carries the work forward with expanded Feishu document loading for wiki, docs, and drive.
Installation
pip install llama-index-readers-feishu
Prerequisites
- Create a Feishu custom app in the developer console.
- Enable permissions based on the reader you use:
| Reader | Required scopes |
|---|---|
| Wiki | wiki:wiki:readonly or wiki:node:retrieve, docs:document.content:read |
| Docs | docs:document.content:read or docx:document:readonly |
| Drive | drive:drive:readonly or drive:drive, docs:document.content:read |
- Grant the app access to the target wiki space or drive folder.
Quick Start
Wiki
from llama_index.readers.feishu import FeishuWikiReader
reader = FeishuWikiReader(app_id="cli_xxx", app_secret="your_app_secret")
documents = reader.load_data(
space_id="your_space_id",
parent_node_token="optional_parent_node_token",
recursive=True,
)
Docs
from llama_index.readers.feishu import FeishuDocsReader
reader = FeishuDocsReader(app_id="cli_xxx", app_secret="your_app_secret")
documents = reader.load_data(document_ids=["docx_token_1", "docx_token_2"])
Drive
from llama_index.readers.feishu import FeishuDriveReader
reader = FeishuDriveReader(app_id="cli_xxx", app_secret="your_app_secret")
documents = reader.load_data(
folder_token="your_folder_token",
recursive=True,
)
The drive reader loads:
- Files with
type=docx - Shortcuts where
shortcut_info.target_type=docx
Other file types (folders, sheets, bitables, etc.) are skipped. Folders are traversed when recursive=True.
Post-process Exported Text
Feishu markdown exports may embed HTML fragments such as tables. Pass plugins to normalize loaded text:
from llama_index.readers.feishu import (
FeishuDriveReader,
RegexPlugin,
html_table_to_markdown_plugin,
)
reader = FeishuDriveReader(
app_id="cli_xxx",
app_secret="your_app_secret",
plugins=[
html_table_to_markdown_plugin,
RegexPlugin(pattern=r"\n{3,}", repl="\n\n", name="collapse_blank_lines"),
],
)
documents = reader.load_data(folder_token="your_folder_token")
Use default_markdown_plugins() for the built-in HTML table converter and Feishu markdown unescape plugin.
User Access Token
To access content with user identity instead of tenant identity:
reader = FeishuWikiReader(
app_id="cli_xxx",
app_secret="your_app_secret",
user_access_token="u-xxxxxxxx",
)
Lark (Overseas)
reader = FeishuWikiReader(
app_id="cli_xxx",
app_secret="your_app_secret",
domain="https://open.larksuite.com",
)
Or switch after initialization:
reader = FeishuWikiReader(app_id="cli_xxx", app_secret="your_app_secret")
reader.set_lark_domain()
Use with LlamaIndex
from llama_index.core import VectorStoreIndex
index = VectorStoreIndex.from_documents(documents)
query_engine = index.as_query_engine()
response = query_engine.query("Summarize the content")
print(response)
Examples
Integration scripts under examples/ load live content and export markdown files. Copy .env.example to .env and fill in your credentials:
cp .env.example .env
# edit .env with your Feishu app credentials and target IDs
# Wiki
python examples/load_wiki_documents.py
# Docs
python examples/load_docs_documents.py
# Drive
python examples/load_drive_documents.py
Development
uv sync
uv run poe hooks-install
uv run poe lint
uv run poe test
uv run poe test-cov # optional: with coverage report
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llama_index_readers_feishu-0.1.0.tar.gz.
File metadata
- Download URL: llama_index_readers_feishu-0.1.0.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a83889a4928ef88663f61d9dee04802781ad11367d21c928e5dfe944d38300d
|
|
| MD5 |
6dbbee9457b51bf32a9c7f2548fae997
|
|
| BLAKE2b-256 |
76b3f222b634496b54871cdee252d87b97d9948b49aebd3274c7737c49b73fe0
|
Provenance
The following attestation bundles were made for llama_index_readers_feishu-0.1.0.tar.gz:
Publisher:
publish.yml on jinzcdev/llama-index-readers-feishu
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llama_index_readers_feishu-0.1.0.tar.gz -
Subject digest:
8a83889a4928ef88663f61d9dee04802781ad11367d21c928e5dfe944d38300d - Sigstore transparency entry: 2143328385
- Sigstore integration time:
-
Permalink:
jinzcdev/llama-index-readers-feishu@f631affa0f669b0c21b44d760d5f3ad2a2626336 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/jinzcdev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f631affa0f669b0c21b44d760d5f3ad2a2626336 -
Trigger Event:
release
-
Statement type:
File details
Details for the file llama_index_readers_feishu-0.1.0-py3-none-any.whl.
File metadata
- Download URL: llama_index_readers_feishu-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad35d0e8777c4266d71f348e287bc4db2e15a0c917c0fac1c722ba55beaece7b
|
|
| MD5 |
eb1b882f37657e1459897fb29ef72157
|
|
| BLAKE2b-256 |
33432e12de41ff143873bba16c3f0ba7f5955864347b084b393dd44badd3f13f
|
Provenance
The following attestation bundles were made for llama_index_readers_feishu-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on jinzcdev/llama-index-readers-feishu
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llama_index_readers_feishu-0.1.0-py3-none-any.whl -
Subject digest:
ad35d0e8777c4266d71f348e287bc4db2e15a0c917c0fac1c722ba55beaece7b - Sigstore transparency entry: 2143328409
- Sigstore integration time:
-
Permalink:
jinzcdev/llama-index-readers-feishu@f631affa0f669b0c21b44d760d5f3ad2a2626336 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/jinzcdev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f631affa0f669b0c21b44d760d5f3ad2a2626336 -
Trigger Event:
release
-
Statement type: