PanSync - 百度网盘同步工具
基于 bypy 的多客户端百度网盘同步工具,支持定时同步、冲突检测和分布式锁管理。
功能特性
- 🔄 智能同步: 基于文件哈希和时间戳的双向同步
- 🔒 分布式锁: 防止多客户端同时操作的锁机制
- 🗑️ 垃圾回收: 本地删除的文件移至云端 trash 目录
- ⚙️ 灵活配置: 支持定时同步、限速、并发控制
- 🖥️ 多客户端: 自动客户端注册和管理
- 📊 状态管理: 二进制索引文件记录文件状态
- 🚀 服务化: 支持 Supervisor 管理和开机自启
安装
# 克隆项目
git clone <repository-url>
cd pansync
# 安装依赖
pip install -r requirements.txt
# 安装项目
pip install -e .
配置
配置文件位于 ~/.pansync/config.yaml,首次运行会自动创建。
使用
# 启动同步服务
pansync start
# 停止同步服务
pansync stop
# 查看状态
pansync status
# 手动同步
pansync sync
架构设计
多客户端同步协议
- 锁获取: 客户端通过
.pansync/.config/lock.txt获取分布式锁 - 索引同步: 上传本地索引到
.pansync/.index.dat - 文件同步: 根据索引差异进行文件上传/下载
- 状态同步: 通过
.pansync/.config/.index.dat维护文件状态
文件同步逻辑
- 云端删除 → 本地删除
- 本地删除 → 移至云端 trash 目录
- 双向修改 → 冲突检测和报告
开发
# 开发模式安装
pip install -e .[dev]
# 运行测试
pytest tests/
# 代码格式化
black src/
flake8 src/
许可证
MIT License
Metadata
Release files for pansync 0.1.0
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 |
|---|---|---|---|---|
| pansync-0.1.0.tar.gz | 39.8 kB | Without provenance | Details for pansync-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pansync-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for pansync-0.1.0-py3-none-any.whl |
Total release size: 83.6 kB
Release files / pansync-0.1.0.tar.gz
| Download URL | pansync-0.1.0.tar.gz |
|---|---|
| Size | 39.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eb2a16483393ee4d917d2172553895dd14ba7d172c0c3e02ac94c325f09c993d
|
|
BLAKE2b-256 checksum How to use checksums |
2db572efa4683f72eef06a46245057f27019cad349821ad5d84ebf067959d39f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.11
|
Release files / pansync-0.1.0-py3-none-any.whl
| Download URL | pansync-0.1.0-py3-none-any.whl |
|---|---|
| Size | 43.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2d12a63c0323bcb6b7448e89214d6b6bc81e7fa72aa130d18f559ebcb8d30a80
|
|
BLAKE2b-256 checksum How to use checksums |
76425270aae939bcaf420900149fd398f4b4052da089cd282d68930f701e6b93
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.11
|
Security for pansync 0.1.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.