funblog
本地笔记发布工具:把本地目录下的 Markdown / Jupyter Notebook(.md / .ipynb)文件按目录结构扫描成「分类-文章」树,记录到本地 SQLite,再通过 XML-RPC(metaWeblog 协议)批量发布/更新到 Typecho 博客。仓库里还带了一个尚未实现的 Yuque(语雀)发布模块的空壳。
安装
pip install funblog
从源码安装(开发用):
git clone https://github.com/farfarfun/funblog.git
cd funblog
pip install -e .
运行时依赖 fundata(提供 SqliteTable 等基础能力)、nbformat、nbconvert(用于解析 .ipynb)、farlog、tqdm,均已写入 pyproject.toml。funbuild 只是发布本包时用到的构建工具,不是运行时依赖,无需单独安装即可使用本包。
用法示例
from funblog.publish.core import BlogManage
# path_root: 本地笔记根目录,子目录会被当作分类,.md/.ipynb 文件会被当作文章
blog = BlogManage(path_root="/path/to/notes", db_path="/path/to/blog.db")
# 1. 扫描本地文件,写入分类表/文章表
blog.local_scan()
# 2. 发布到 Typecho(通过 XML-RPC)
blog.publish_typecho(
rpc_url="https://your-blog.com/action/xmlrpc",
username="your-username",
password="your-password",
)
BlogManage 内部用 BlogCategoryDB / BlogPageDB(均基于 SQLite)记录分类和文章的本地 id 与 Typecho 端 id 的对应关系,重复运行 local_scan() + publish_typecho() 可以做到增量更新:已发布过的文章会走 edit_page,未发布过的走 new_page。
底层的 Typecho 客户端 funblog.blog.typecho.Typecho 封装了 metaWeblog / WordPress 兼容的 XML-RPC 接口(文章、页面、分类、标签、附件、评论),可以单独使用:
from funblog.blog.typecho import Typecho
typecho = Typecho(
rpc_url="https://your-blog.com/action/xmlrpc",
username="your-username",
password="your-password",
)
print(typecho.get_categories())
已知局限
- Yuque(语雀)发布模块(
funblog/blog/yuque/)目前是空文件,功能未实现。
关于 farfarfun
farfarfun 是一个专注于实用工具库的开源组织, 涵盖云存储、数据处理、AI、多媒体与开发工具链等方向。
- 🏠 组织主页:https://github.com/farfarfun
- 📦 PyPI:https://pypi.org/user/niuliangtao/
- 📧 联系:farfarfun@qq.com
本项目基于 MIT 协议开源。
Metadata
Release files for funblog 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| funblog-0.6.0-py3-none-any.whl | Python 3 | none | any | Details for funblog-0.6.0-py3-none-any.whl |
Release files / funblog-0.6.0-py3-none-any.whl
| Download URL | funblog-0.6.0-py3-none-any.whl |
|---|---|
| Size | 16.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2e74db42e838d954a0999c73ac743e6543a77a08133633c29722eaaae500cd1e
|
|
BLAKE2b-256 checksum How to use checksums |
2a90480bacec7b353f3366096a37e5b6544e548cba580411f66ec68f6011035d
|
| 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}
|
Security for funblog 0.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.