Skip to main content

统一管理GitHub、HuggingFace等Git仓库的代码存储工具

Project description

FunHub

FunHub 是一个专门用于将 GitHub、HuggingFace 等 Git 仓库同步到 fundrive 的工具。

🎯 设计理念

FunHub 采用完全解耦的架构设计:

  • 同步端:FunHub 只负责将 Git 仓库同步到 fundrive,并返回文件 ID (fid)
  • 使用端:用户直接使用 fid 通过 fundrive 下载数据,无需再经过 FunHub

这种设计实现了数据同步与数据使用的完全分离,提高了系统的灵活性和可维护性。

🚀 快速开始

安装

pip install funhub

基本使用

  1. 同步仓库到 fundrive
# 同步 GitHub 仓库
funhub sync https://github.com/user/repo

# 同步 HuggingFace 仓库
funhub sync https://huggingface.co/user/model

# 指定分支
funhub sync https://github.com/user/repo --branch dev
  1. 查看已同步的仓库
# 列出所有已同步的仓库
funhub list

# 只显示 GitHub 仓库
funhub list --source github
  1. 获取仓库信息和 fid
funhub info github user repo
  1. 使用 fid 下载数据
# 注意:下载由 fundrive 负责,不经过 funhub
fundrive download <fid> ./target_folder

📋 功能特性

  • ✅ 支持 GitHub 仓库同步
  • ✅ 支持 HuggingFace 仓库同步
  • ✅ 支持指定分支同步
  • ✅ 同步记录管理
  • ✅ 代理支持
  • ✅ 配置管理
  • ✅ 完全解耦的架构设计

🏗️ 架构说明

┌─────────────────┐    sync     ┌─────────────────┐
│                 │ ──────────> │                 │
│     FunHub      │             │    FunDrive     │
│   (同步端)       │   返回 fid   │   (存储端)       │
│                 │ <────────── │                 │
└─────────────────┘             └─────────────────┘
                                          │
                                          │ download
                                          ▼
                                 ┌─────────────────┐
                                 │                 │
                                 │   用户端         │
                                 │  (使用端)        │
                                 │                 │
                                 └─────────────────┘

工作流程

  1. 同步阶段:FunHub 从 Git 平台下载仓库,上传到 fundrive,返回 fid
  2. 使用阶段:用户直接使用 fid 通过 fundrive 下载数据
  3. 完全解耦:同步和使用完全分离,互不依赖

🛠️ 开发指南

环境搭建

# 克隆项目
git clone https://github.com/farfarfun/funhub.git
cd funhub

# 安装依赖
pip install -e .

代码规范

  • 使用中文注释
  • 遵循 PEP8 编码规范
  • 函数和类必须有文档字符串
  • 重要的业务逻辑必须有注释说明

测试

# 运行测试
pytest tests/

# 测试覆盖率
pytest --cov=funhub tests/

📖 API 文档

详细的 API 文档请参考 docs/API.md

📝 变更日志

详细的变更记录请参考 docs/CHANGELOG.md

🤝 贡献指南

欢迎提交 Issue 和 Pull Request!

  1. Fork 本仓库
  2. 创建您的特性分支 (git checkout -b feature/AmazingFeature)
  3. 提交您的更改 (git commit -m 'Add some AmazingFeature')
  4. 推送到分支 (git push origin feature/AmazingFeature)
  5. 打开一个 Pull Request

📄 许可证

本项目采用 MIT 许可证 - 查看 LICENSE 文件了解详情

📞 联系方式

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

funhub-0.1.1-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file funhub-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: funhub-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.3

File hashes

Hashes for funhub-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 73069a9422708c32a2e676ea8291c2c265dcc54037f0db401bb84ef551298df8
MD5 2a9de90a8f3fbc451bf1d54ceabd8414
BLAKE2b-256 f8c60902a9455003f19f8e33f959b0be716e088aa032c1ac04b9453e0ad60d55

See more details on using hashes here.

Supported by

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