skillfed

lark-oapi

Lark OpenAPI SDK for Python

lark-oapi v1.7.2 2.9M downloads/30d#2,827 on PyPI549
Permissive license MIT Active released

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-oapi

uv

uv add lark-oapi

poetry

poetry add lark-oapi

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python Modules

Tags

feishu openapi sdk pythonlark api client libraryfeishu messaging sdklark open platform integrationfeishu bot developmentlark server-side api wrapperfeishu event handling sdk
feishu-larkapi-clientbot-framework

More Python Modules packages