Metadata-Version: 2.4
Name: telepress
Version: 0.14.2
Summary: Publish Markdown, images, and galleries to Telegraph
Author: redtidev1918
License-Expression: MIT
Project-URL: Changelog, https://github.com/redtidev1918/TelePress/blob/master/CHANGELOG.md
Project-URL: Documentation, https://redtidev1918.github.io/TelePress/
Project-URL: Issues, https://github.com/redtidev1918/TelePress/issues
Project-URL: Repository, https://github.com/redtidev1918/TelePress
Keywords: telegraph,markdown,publishing,image-hosting,file-hosting,imgbb,imgur,r2,catbox,uploadcare
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Markdown>=3.5
Requires-Dist: Pillow>=12.3.0
Requires-Dist: requests>=2.31
Requires-Dist: telegraph>=2.2
Provides-Extra: api
Requires-Dist: fastapi>=0.110; extra == "api"
Requires-Dist: python-multipart>=0.0.32; extra == "api"
Requires-Dist: uvicorn>=0.52.4; extra == "api"
Provides-Extra: s3
Requires-Dist: boto3>=1.34; extra == "s3"
Provides-Extra: yaml
Requires-Dist: PyYAML>=6; extra == "yaml"
Provides-Extra: dev
Requires-Dist: boto3>=1.34; extra == "dev"
Requires-Dist: build>=1.5.0; extra == "dev"
Requires-Dist: fastapi>=0.110; extra == "dev"
Requires-Dist: httpx>=0.27; extra == "dev"
Requires-Dist: numpy>=1.26; extra == "dev"
Requires-Dist: pytest>=9.1.1; extra == "dev"
Requires-Dist: pytest-cov>=5; extra == "dev"
Requires-Dist: python-multipart>=0.0.32; extra == "dev"
Requires-Dist: PyYAML>=6; extra == "dev"
Requires-Dist: twine>=5; extra == "dev"
Requires-Dist: uvicorn>=0.52.4; extra == "dev"
Dynamic: license-file

# TelePress

**语言 / Language:** 中文 · [English](README.en.md)

> **向 Telegraph 发布文本、图片与档案的 Python 库与 CLI。**

[![CI](https://github.com/redtidev1918/TelePress/actions/workflows/ci.yml/badge.svg)](https://github.com/redtidev1918/TelePress/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/telepress.svg)](https://pypi.org/project/telepress/)
[![Python](https://img.shields.io/pypi/pyversions/telepress.svg)](https://pypi.org/project/telepress/)
[![Docs](https://img.shields.io/badge/Docs-文档站点-6366f1?style=flat-square)](https://redtidev1918.github.io/TelePress/)

[完整文档](https://redtidev1918.github.io/TelePress/)

TelePress 把 Markdown、纯文本、图片和富媒体内容发布为 Telegraph 页面，
不关心内容来自哪个平台。

- 纯文本 / Markdown：自动分页并生成上一页、下一页导航
- 图片 / ZIP 图集：压缩后发布为 Telegra.ph 相册
- 富媒体（REST）：通过 `/publish/rich-novel` 发布 Markdown + 本地图
- 图片可在「上传图床」与「通用 CDN 代理」两条路径间选择

## 安装

```bash
pip install telepress

# 可选：REST API 服务
pip install "telepress[api]"

# 可选：S3 / R2 / OSS / MinIO 等 S3 兼容图床
pip install "telepress[s3]"

# 可选：YAML 配置
pip install "telepress[yaml]"
```

## 30 秒快速开始

```bash
pip install telepress
telepress article.md --title "我的文章"

# 或者显式子命令
telepress publish article.md --title "我的文章"
```

发布图片 / ZIP 图集前先配置一个图床：

```bash
telepress configure
telepress check
telepress photo.jpg --title "照片"
telepress gallery.zip --title "图集"
```

需要服务化时：

```bash
pip install "telepress[api]"
telepress-server --host 127.0.0.1 --port 8000
# OpenAPI 交互文档：http://127.0.0.1:8000/docs
```

运行时首次使用会自动创建并保存 Telegraph token（默认 `~/.telegraph_token`）。

## 文档

README 不是全量文档；稳定契约放在 `docs/`：

- 快速开始与配置：[getting-started.md](/docs/getting-started.md) · [configuration.md](/docs/configuration.md)
- REST API：[docs/api/README.md](/docs/api/README.md)
- 图片与媒体：[docs/media/README.md](/docs/media/README.md)
- Python API / CLI：[python-api.md](/docs/python-api.md) · [cli.md](/docs/cli.md)
- 架构：[architecture/publishing-plane.md](/docs/architecture/publishing-plane.md)
- 运维与当前状态：[operations/current-state.md](/docs/operations/current-state.md)

## License

[MIT](LICENSE)

## 致谢

TelePress 建立在这些项目之上：

- [Python-Markdown](https://python-markdown.github.io/)：Markdown 解析与扩展。
- [Pillow](https://github.com/python-pillow/Pillow)：图集压缩。
- [requests](https://github.com/psf/requests)：HTTP 客户端。
- [telegraph](https://github.com/python-telegram-bot/telegraph)（python-telegram-bot 团队的 Telegraph 封装）：Telegraph 页面发布。
- 可选 REST 发布层：[FastAPI](https://fastapi.tiangolo.com/) · [Uvicorn](https://www.uvicorn.org/)。

接口与规范参考：[Telegraph API](https://telegra.ph/api)。
