Skip to main content

funlesson-api

Funlesson 后端服务,面向教师备课场景:把课程视频链接转成结构化的大纲、思维导图、PPT 和架构图。 核心处理逻辑在 funlesson,这里只是 FastAPI 封装。

配套 Web 界面见 funlesson-web。

功能特性

  • 提交课程视频链接,异步处理并可轮询进度
  • 产出:转写文字稿、结构化大纲、思维导图(markmap 文本)、PPT(可下载)、架构图(Mermaid 文本)

快速开始

环境要求

同 funlesson 的环境要求: 系统需要 ffmpeg,本机需要已登录的 Claude Code CLI(claude 命令)。

安装

包发布在私有 index(组织私有 PyPI,非公开 pypi.org),需要组织账号密码(找管理员要, 不要把密码提交进仓库);该 index 不代理公网包,fastapi/uvicorn 等公开依赖需要额外 指定公网 index:

pip install funlesson-api \
    --index-url https://<user>:<password>@packages.aliyun.com/5fc5eb115dbd287006145e5f/pypi/funpy/simple/ \
    --extra-index-url https://pypi.org/simple

运行

生产/常规用法,funlesson-api 自带服务生命周期命令:

funlesson-api server start --host 0.0.0.0 --port 18812
funlesson-api server status
funlesson-api server stop
funlesson-api server restart

调试用前台模式(--reload 开发时自动重载):

funlesson-api server run --reload --port 18812

也可以不装 CLI、直接用 uvicorn:

uvicorn funlesson_api.main:app --reload --port 18812

server 各命令默认监听 127.0.0.1:18812,--host/--port/--config 可覆盖; --config 缺省时读 ${XDG_CONFIG_HOME:-~/.config}/farfarfun/funlesson-api/config.toml。 start 写的 PID 文件(server.pid)和日志(server.log)都放在同一个配置目录下。

任务产物默认落盘到 ./data,可通过环境变量 FUNLESSON_DATA_DIR 修改。

从源码开发

pip install -e ../funlesson
pip install -e .

API 文档

见 doc/API.md。

开发指南

pytest

测试通过 monkeypatch 替换 funlesson.pipeline.process,不依赖真实下载/转写/claude 调用。

变更日志

见 CHANGELOG.md。

许可证

MIT

Metadata

Release files for funlesson-api 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for funlesson-api 0.1.4
File Interpreter ABI Platform
funlesson_api-0.1.4-py3-none-any.whl Python 3 none any Details

Release files / funlesson_api-0.1.4-py3-none-any.whl

Download URL funlesson_api-0.1.4-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
07afd193b86e76b45b3150317a08bb7a7abeb1c834178627c620c36f414df342
BLAKE2b-256 checksum
How to use checksums
d539421c1b54c629312d3776fea9e012389f25ac29d52d8ff0571348b4bdb0db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"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":null}

Release history Release notifications | RSS feed

0.1.5

1 release file

This release

0.1.4 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page