Skip to main content

pysvnlite

Python 的 Subversion 命令行封装与 XML 解析库,提供仓库查询、历史读取和工作副本管理 API。

当前版本:0.2.3。Python >=3.9,无第三方运行时依赖,包含类型标记 py.typed。

安装

系统需安装 Subversion,并将 svn 加入 PATH。

python -m pip install "pysvnlite==0.2.3"
svn --version --quiet

使用

from pysvnlite import SVNRepo

repo = SVNRepo("https://svn.example.com/project/trunk", timeout=30)

for entry in repo.list():
    print(entry.kind, entry.name)

for entry in repo.log(limit=10, verbose=True):
    print(entry.revision, entry.author, entry.changed_paths)

功能

  • 仓库查询:信息、目录、状态、属性。
  • 历史读取:日志、路径变更、历史文件、差异、逐行归属。
  • 工作副本:检出、更新、切换、添加、删除、还原、提交。
  • 仓库操作:复制、移动、建目录、导出、锁定与解锁。
  • 执行控制:结构化错误、可选超时、日志输出上限、文件原子下载。

行为约定

  • SVN 调用使用 --non-interactive;认证、证书和 SSH 配置由原生客户端管理。
  • timeout=None 表示不限时。超时后的进程清理不回滚已完成的远端提交。
  • commit 的普通失败可返回 CommitResult(success=False);前置操作和执行失败也可能抛出异常。
  • cat 返回完整文件的 bytes;cat_to_file 下载成功后原子替换目标,失败保留原文件。
  • cat / cat_to_file 支持可选 max_output_bytes,默认不限制,超限不发布截断结果。
  • 显式 commit(paths=...) 的自动准备操作限定于所选目标;不自动扩大到父目录。
  • 支持 peg 的读取方法将 Path 视为字面路径;末尾含字面量 @ 的字符串需显式 peg="" 或具体修订。
  • 日志迭代器在捕获完成后解析输出;max_output_bytes 控制原始日志输出上限。

文档

许可

MIT License

Release files for pysvnlite 0.2.3

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

Source distribution (sdist)

Source distribution for pysvnlite 0.2.3
File Size Uploaded
pysvnlite-0.2.3.tar.gz 22.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pysvnlite 0.2.3
File Interpreter ABI Platform
pysvnlite-0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 50.4 kB

Release files / pysvnlite-0.2.3.tar.gz

Download URL pysvnlite-0.2.3.tar.gz
Size 22.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1beea8037a015b61bccd9c6ed0786b77eabe36d03533c3bf27eec0132f928e6b
BLAKE2b-256 checksum
How to use checksums
f936f381cc3b11685ca5149a0df70b811d263701704f0da9ba9e232810e7bd3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / pysvnlite-0.2.3-py3-none-any.whl

Download URL pysvnlite-0.2.3-py3-none-any.whl
Size 28.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc29c33012a39b046020ac7a6fd425932bc1dd0936dcf5a31ce836c8f2ff243f
BLAKE2b-256 checksum
How to use checksums
7f6bcc0fc64622b56c482cad49f19fe55f7df7c8fa45e4963dacce327f54915b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release history Release notifications | RSS feed

0.2.4

2 release files

This release

0.2.3 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

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