lark-oapi
Lark OpenAPI SDK for Python
What it is and what it does
This is the official Python SDK for Feishu (also known as Lark), a workplace collaboration platform. It abstracts away the repetitive work of calling Feishu's server-side APIs—handling OAuth token lifecycle, cryptographic request signing, payload encryption/decryption, and event routing—so you can focus on building features rather than protocol plumbing. The SDK provides typed request and response models for messaging, contact management, approval workflows, spreadsheets, and other Feishu capabilities.
You build a client with your app credentials, then call methods like `client.im.v1.message.create()` to send messages or handle incoming events through a dispatcher. The SDK supports both traditional app_secret authentication and keyless JWT-based assertion flows for external signing services. It also includes a one-click app registration flow that guides users through OAuth device-flow setup and lets you pre-configure scopes, events, and callbacks before they confirm.
Use it for:
- Build a Feishu bot that sends notifications or responds to messages in channels and direct chats.
- Integrate Feishu messaging into a third-party service to notify users of events or alerts.
- Automate approval workflows by programmatically creating and updating approval instances.
- Sync data between Feishu Sheets or Base and external systems via the SDK's typed API models.
- Handle incoming Feishu events (messages, card interactions) through the SDK's event dispatcher.
- Register and configure a new Feishu app on behalf of a user via the OAuth device-flow helper.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Python SDK for the Feishu Open Platform that wraps API calls, token management, request signing, encryption/decryption, event dispatching, and typed request/response models for messaging, contacts, approval, sheets, Base, and other Feishu capabilities.
Yes. The SDK is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and installs with low friction. It is the canonical way to integrate with Feishu's server APIs from Python; if you are building on Feishu or Lark, this is the right choice.
Install
lark-oapi on PyPI
pip
pip install lark-oapiuv
uv add lark-oapipoetry
poetry add lark-oapiInstalling lark-oapi
Before you install
Low install friction with a pure-wheel distribution. Active maintenance with a release 9 days ago and 549 repository stars. Supports Python 3.8 through 3.12.
License in practice
MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute this package freely provided you include the license notice.
Quickstart
pip install lark-oapi
import lark_oapi as lark
from lark_oapi.api.im.v1 import *
client = lark.Client.builder().app_id("cli_xxx").app_secret("your_app_secret").build()
request = CreateMessageRequest.builder().receive_id_type("chat_id").request_body(CreateMessageRequestBody.builder().receive_id("oc_xxx").msg_type("text").content("{\"text\":\"hello world\"}").build()).build()
response = client.im.v1.message.create(request)
Requires Python 3.8 or later and valid Feishu app credentials (app_id and app_secret or client_assertion provider).
Verify before relying
- Scope and completeness of Feishu API endpoints covered by this SDK version.
- Performance characteristics and rate-limiting behavior under production load.
- Backward compatibility guarantees across minor and patch versions.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — requests, requests_toolbelt, pycryptodome, websockets, httpx |
| Maintenance | actively maintained — 9 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,910,710/month — #2,827 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: lark_oapi-1.7.2-py3-none-any.whl
Keywords: Lark, OpenAPI
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
larkLark is a parsing library that builds abstract…
permissive · top 1,000 on PyPI
lark-jsLark-js is a command-line tool that generates…
permissive · top 15,000 on PyPI
lark-parserLark is a parsing library that builds abstract…
permissive · top 5,000 on PyPI
onesignal-python-apiA Python client library for the OneSignal API…
unclear · top 15,000 on PyPI
alibabacloud-openapi-utilProvides utility functions for constructing and…
permissive · top 5,000 on PyPI
schwab-pyUnofficial wrapper for the Charles Schwab API…
permissive · top 15,000 on PyPI
longbridgeLongbridge provides a Python SDK for accessing…
unclear · top 15,000 on PyPI
twitchAPIA Python client library for the Twitch Helix…
permissive · top 15,000 on PyPI
alibabacloud-tea-openapiProvides a Python SDK for calling Alibaba Cloud…
permissive · top 5,000 on PyPI
fastapi-cloudauthIntegrates FastAPI applications with cloud…
permissive · top 15,000 on PyPI