Skip to main content

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

架构设计

多客户端同步协议

  1. 锁获取: 客户端通过 .pansync/.config/lock.txt 获取分布式锁
  2. 索引同步: 上传本地索引到 .pansync/.index.dat
  3. 文件同步: 根据索引差异进行文件上传/下载
  4. 状态同步: 通过 .pansync/.config/.index.dat 维护文件状态

文件同步逻辑

  • 云端删除 → 本地删除
  • 本地删除 → 移至云端 trash 目录
  • 双向修改 → 冲突检测和报告

开发

# 开发模式安装
pip install -e .[dev]

# 运行测试
pytest tests/

# 代码格式化
black src/
flake8 src/

许可证

MIT License

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pansync-0.1.0.tar.gz (39.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pansync-0.1.0-py3-none-any.whl (43.7 kB view details)

Uploaded Python 3

File details

Details for the file pansync-0.1.0.tar.gz.

File metadata

  • Download URL: pansync-0.1.0.tar.gz
  • Upload date:
  • Size: 39.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.11

File hashes

Hashes for pansync-0.1.0.tar.gz
Algorithm Hash digest
SHA256 eb2a16483393ee4d917d2172553895dd14ba7d172c0c3e02ac94c325f09c993d
MD5 223d4ec586125cbdb21619955863d8e3
BLAKE2b-256 2db572efa4683f72eef06a46245057f27019cad349821ad5d84ebf067959d39f

See more details on using hashes here.

File details

Details for the file pansync-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pansync-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 43.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.11

File hashes

Hashes for pansync-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d12a63c0323bcb6b7448e89214d6b6bc81e7fa72aa130d18f559ebcb8d30a80
MD5 9c75e3c2fff1d2947a73dba9bcf7db9a
BLAKE2b-256 76425270aae939bcaf420900149fd398f4b4052da089cd282d68930f701e6b93

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page