Python SDK for Gitee API
Project description
Gitee OpenAPI SDK
一个面向常用 Gitee 开发协作流程、结构清晰、易于使用的 Python SDK 包,使用 uv 进行依赖管理。
功能特点
- 覆盖仓库、Issue、Pull Request、Release 等核心开发协作 API
- 模块化设计,结构清晰
- 简洁易用的接口
- 完善的错误处理
- 支持分页处理
- 类型提示,提高IDE支持
- 详细的文档和示例
安装
pip install gitee-openapi
使用uv安装:
uv pip install gitee-openapi
快速开始
from gitee import GiteeClient
# 创建客户端
client = GiteeClient(token="your_access_token")
# 获取用户仓库列表
repos = client.repositories.list()
for repo in repos:
print(f"{repo['full_name']}: {repo['description']}")
# 创建Issue
issue = client.issues.create(
owner="octocat",
repo="hello-world",
title="Found a bug",
body="I'm having a problem with this."
)
print(f"Created issue #{issue['number']}: {issue['title']}")
支持的API
- 仓库管理 (Repositories)
- README、目录内容、文件新建/更新/删除、提交对比、blame、多文件提交
- 分支创建、分支保护、协作者权限查询
- Release CRUD 与附件列表/获取/删除/下载
- Issues管理
- Pull Requests
- 合并状态、审查/测试、审查者/测试者指派、关联 issues、标签、评论管理
- 用户管理 (Users)
- 组织管理 (Organizations)
- 代码片段 (Gists)
- 企业管理 (Enterprises)
- 邮箱管理 (Emails)
- 标签管理 (Labels)
- 里程碑管理 (Milestones)
- Webhooks
- 动态通知 (Activities)
- 门禁检查项 (Checks)
- 仓库数据 (Git Data)
- 搜索 (Search)
- 杂项 (Miscellaneous)
详细文档
查看设计文档了解更多关于SDK架构和设计的信息。
开发
环境设置
# 克隆仓库
git clone https://github.com/bojackli/gitee-sdk.git
cd gitee-sdk
# 使用uv安装依赖
uv pip install -e ".[dev]"
运行测试
pytest
贡献
欢迎贡献代码、报告问题或提出改进建议!
许可证
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gitee_openapi-0.2.16.tar.gz
(21.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gitee_openapi-0.2.16.tar.gz.
File metadata
- Download URL: gitee_openapi-0.2.16.tar.gz
- Upload date:
- Size: 21.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f470287ae01aca026fa1cb7bd75638805eef13a5e5b6c98dcca73b8052904d5d
|
|
| MD5 |
379608c4c39385c6f16fbd190d8bf77a
|
|
| BLAKE2b-256 |
2139dee156d4eb151ad0f6b8ba2ca71ecafbaeab49bb2e68fdaa5586dc379e57
|
File details
Details for the file gitee_openapi-0.2.16-py3-none-any.whl.
File metadata
- Download URL: gitee_openapi-0.2.16-py3-none-any.whl
- Upload date:
- Size: 32.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
531c84528585c9e1029f5e57755f883580956d774fb8f833e518340cf0dfe9f2
|
|
| MD5 |
2e96834dc9639e49d57cb79596ede5f8
|
|
| BLAKE2b-256 |
1cc323ecf734f4840a8b0f2f433f960650a6a09763b8b7da3d4dd8242ac86bd6
|