pysvnlite
Python 的 Subversion 命令行封装与 XML 解析库,提供仓库查询、历史读取和工作副本管理 API。
当前版本:0.2.5。Python >=3.9,无第三方运行时依赖,包含类型标记 py.typed。
版本变化见变更日志;main 分支可能包含尚未发布的修改,正式发行包以对应标签为准。
批量目标文件与原生编码约束见 API 参考。
安装
系统需安装 Subversion,并将 svn 加入 PATH。
python -m pip install "pysvnlite==0.2.5"
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控制原始日志输出上限。
文档
许可
Metadata
Release files for pysvnlite 0.2.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pysvnlite-0.2.5.tar.gz | 23.5 kB | Without provenance | Details for pysvnlite-0.2.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pysvnlite-0.2.5-py3-none-any.whl | Python 3 | none | any | Details for pysvnlite-0.2.5-py3-none-any.whl |
Total release size: 52.6 kB
Release files / pysvnlite-0.2.5.tar.gz
| Download URL | pysvnlite-0.2.5.tar.gz |
|---|---|
| Size | 23.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eb12af91fb57cdd5d2d07b26e06d24ccec6b30629908b3c78bb0bbe5c1d5ab6c
|
|
BLAKE2b-256 checksum How to use checksums |
9d2d17041f84683215d08d99df9edbcdf0f6f6c5fcb01e8aaa833ffbd7942b49
|
| 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.5-py3-none-any.whl
| Download URL | pysvnlite-0.2.5-py3-none-any.whl |
|---|---|
| Size | 29.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
47f808ba19def80f564122ec163e1df5e0aba6e40b033f0bb20cda126bc68ff5
|
|
BLAKE2b-256 checksum How to use checksums |
fa86632ef20b10efa53d22435e9e1bc48dde67fbb69a6d3c772f53c525ae061a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Security for pysvnlite 0.2.5
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.