Skip to main content

xy_git_api_tools 模块

Project description

git_api_tools

简体中文 繁體中文 English

说明

希洋开源软件包运行环境.

源码仓库

Github Gitee GitCode

安装

# bash
pip install xy_git_api_tools

使用

!!! 注意: 当请求GitHub仓库时候必须带上username参数,无论是命令行传入还是配置到配置文件中 !!! 默认配置文件路径为 ~/.xy_config/xy_git.toml

1. 配置文件
# config.toml
[git_config]
platform = "github"
# platform = "https://gitlab.com/api/v4/projects"
# platform = 0
# platform = "GitCode"
# platform = "giTcOde"
# platform = "giTCODe"

access_token = "ghp_454545454sadf1dfsa"
# access_token = "glpat-asdjklfjweroijweoirjwoer"

username = "yuyangit"
  1. 查看命令
xy_git_api_tools -w list_api
# =========================================================

# 1. fetch_repos  获取所有仓库信息
# 2. clone_repos  克隆所有仓库, 
# 本地对应目录结构和仓库url相同
  1. 获取所有仓库信息
xy_git_api_tools -c fetch_repos -cfg ./config.toml
# [
#     {
#         "id": 4357570,
#         "full_name": "xy-opensource/xy_git_api_tools",
#         "human_name": "xy-opensource / xy_git_api_tools",
#         "url": "https://api.gitcode.com/api/v5/repos/xy-opensource/xy_git_api_tools",
#         "namespace": {
#             "id": 3536801,
#             "type": "enterprise",
#             "name": "xy-opensource",
#             "path": "xy-opensource",
#             "html_url": "https://gitcode.com/xy-opensource"
#         },
#         "path": "xy_git_api_tools",
#         "name": "xy_git_api_tools",
#         "description": "\u5173\u4e8eGit\u7684Api\u5de5\u5177",
#         "status": "\u5f00\u59cb",
#         "ssh_url_to_repo": "git@gitcode.com:xy-opensource/xy_git_api_tools.git",
#         "http_url_to_repo": "https://gitcode.com/xy-opensource/xy_git_api_tools.git",
#         "web_url": "https://gitcode.com/xy-opensource/xy_git_api_tools",
#         "created_at": "2024-11-24T13:11:49.606+08:00",
#         "updated_at": "2024-11-24T13:11:49.606+08:00",
#         "homepage": "https://gitcode.com/xy-opensource/xy_git_api_tools",
#         "members": [
#             "yuyangit"
#         ],
#         "assignee": [
#             {
#                 "id": "2173437",
#                 "login": "yuyangit",
#                 "name": "yuyangit",
#                 "avatar_url": "https://cdn-img.gitcode.com/fe/fd/f06483269e5f85434d8dc1aa80c1361e9f1fed704b5681043bed4eecaaffce8e.jpeg?time=1731978609795",
#                 "html_url": "https://gitcode.com/yuyangit",
#                 "type": "User"
#             }
#         ],
#         "forks_count": 0,
#         "stargazers_count": 0,
#         "project_labels": [],
#         "relation": "master",
#         "permission": {
#             "pull": true,
#             "push": true,
#             "admin": true
#         },
#         "internal": false,
#         "open_issues_count": 0,
#         "has_issue": false,
#         "watched": false,
#         "watchers_count": 0,
#         "assignees_number": 1,
#         "enterprise": {
#             "id": 3536801,
#             "path": "xy-opensource",
#             "html_url": "https://gitcode.com/xy-opensource",
#             "type": "enterprise"
#         },
#         "default_branch": "main",
#         "fork": false,
#         "owner": {
#             "id": "2173437",
#             "login": "yuyangit",
#             "name": "yuyangit",
#             "type": "User"
#         },
#         "assigner": {
#             "id": "2173437",
#             "login": "yuyangit",
#             "name": "yuyangit",
#             "type": "User"
#         },
#         "issue_template_source": "project",
#         "language": "Python",
#         "private": false,
#         "public": true
#     },
#     {
#         "id": 4357105,
#         "full_name": "xy-opensource/xy_pypi_builder_mirror",
#         "human_name": "xy-opensource / xy_pypi_builder_mirror",
#         "url": "https://api.gitcode.com/api/v5/repos/xy-opensource/xy_pypi_builder_mirror",
#         "namespace": {
#             "id": 3536801,
#             "type": "enterprise",
#             "name": "xy-opensource",
#             "path": "xy-opensource",
#             "html_url": "https://gitcode.com/xy-opensource"
#         },
#         "path": "xy_pypi_builder_mirror",
#         "name": "xy_pypi_builder_mirror",
#         "description": "\u7f16\u8bd1python\u6a21\u5757\u7684pypi\u73af\u5883\u7684\u955c\u50cf.",
#         "status": "\u5f00\u59cb",
#         "ssh_url_to_repo": "git@gitcode.com:xy-opensource/xy_pypi_builder_mirror.git",
#         "http_url_to_repo": "https://gitcode.com/xy-opensource/xy_pypi_builder_mirror.git",
#         "web_url": "https://gitcode.com/xy-opensource/xy_pypi_builder_mirror",
#         "created_at": "2024-11-24T08:55:04.966+08:00",
#         "updated_at": "2024-11-24T13:05:59.513+08:00",
#         "homepage": "https://gitcode.com/xy-opensource/xy_pypi_builder_mirror",
#         "members": [
#             "yuyangit"
#         ],
#         "assignee": [
#             {
#                 "id": "2173437",
#                 "login": "yuyangit",
#                 "name": "yuyangit",
#                 "avatar_url": "https://cdn-img.gitcode.com/fe/fd/f06483269e5f85434d8dc1aa80c1361e9f1fed704b5681043bed4eecaaffce8e.jpeg?time=1731978609795",
#                 "html_url": "https://gitcode.com/yuyangit",
#                 "type": "User"
#             }
#         ],
#         "forks_count": 0,
#         "stargazers_count": 0,
#         "project_labels": [],
#         "relation": "master",
#         "permission": {
#             "pull": true,
#             "push": true,
#             "admin": true
#         },
#         "internal": false,
#         "open_issues_count": 0,
#         "has_issue": false,
#         "watched": false,
#         "watchers_count": 0,
#         "assignees_number": 1,
#         "enterprise": {
#             "id": 3536801,
#             "path": "xy-opensource",
#             "html_url": "https://gitcode.com/xy-opensource",
#             "type": "enterprise"
#         },
#         "default_branch": "main",
#         "fork": false,
#         "owner": {
#             "id": "2173437",
#             "login": "yuyangit",
#             "name": "yuyangit",
#             "type": "User"
#         },
#         "assigner": {
#             "id": "2173437",
#             "login": "yuyangit",
#             "name": "yuyangit",
#             "type": "User"
#         },
#         "issue_template_source": "project",
#         "language": "Dockerfile",
#         "private": false,
#         "public": true
#     },
# ]
  1. git clone 所有仓库到本地, 根据仓库地址结构对应路径进行存储
xy_git_api_tools -c clone_repos -cfg ./config.toml

许可证

xy_git_api_tools 根据 <木兰宽松许可证, 第2版> 获得许可。有关详细信息,请参阅 LICENSE 文件。

捐赠

如果小伙伴们觉得这些工具还不错的话,能否请咱喝一杯咖啡呢?

pay-total

联系方式

微信: yuyangiit
邮箱: yuyangit.0515@qq.com

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

xy_git_api_tools-0.0.1.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

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

xy_git_api_tools-0.0.1-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

Details for the file xy_git_api_tools-0.0.1.tar.gz.

File metadata

  • Download URL: xy_git_api_tools-0.0.1.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.3

File hashes

Hashes for xy_git_api_tools-0.0.1.tar.gz
Algorithm Hash digest
SHA256 2608e09bde0b1040ae9d5186b6bd8215b76806ccd8566b349eaa541343521af0
MD5 29c18814e6e2eee1d2719e1983e2dfb8
BLAKE2b-256 7fffeb7c72b180b53e3289474f52d2199827c0e68ee07ada34356827f66fb725

See more details on using hashes here.

File details

Details for the file xy_git_api_tools-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for xy_git_api_tools-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 47564696dd5b82a1cce033d323ca4d1b09cfeb5f055c4bb75540f56038c27a25
MD5 38f87dd1f5975a33ea7a1f9c91820bb5
BLAKE2b-256 c7a125c3fcea7d3bbdee2fe71b41b8e9834dbb053583a8e7415e60195072e885

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