Skip to main content

gitkit

Git-хостинг абстракция: GitHub/GitLab read-layer.

Единая интерфейс для работы с произвольными git-репозиториями на GitHub, GitLab и self-hosted GitLab инстансах. Provider pattern позволяет добавить новых провайдеров.

Возможности

  • GitProvider Protocol — read-only операции (list_tags, resolve_tag, fetch_file, fetch_tree, clone_url)
  • GitHubProvider — поддержка github.com и GitHub Enterprise
  • GitLabProvider — поддержка gitlab.com и self-hosted GitLab
  • GitProviderFactory — автоматический выбор провайдера по URL
  • Парсинг URL — поддержка https и scp-like git URL-ов
  • Retry-политика — автоматический retry с exponential backoff (3 попытки)

Установка

uv add s-gitkit

Имя пакета для импорта — gitkit.

Быстрый старт

import gitkit

# Автоматический выбор провайдера по URL
factory = gitkit.GitProviderFactory()
provider, repo = factory.create(
    "https://github.com/owner/repo.git",
    token="ghp_xxx"  # опционально
)

# Работа с репозиторием
tags = await provider.list_tags(repo=repo)
sha = await provider.resolve_tag(repo=repo, tag="v1.0.0")
content = await provider.fetch_file(repo=repo, ref="main", path="README.md")
tree = await provider.fetch_tree(repo=repo, ref="main")

# Clone URL
clone = provider.clone_url(repo=repo)

Self-hosted GitLab

Для поддержки self-hosted GitLab инстансов передайте хосты при создании фабрики:

factory = gitkit.GitProviderFactory(
    self_hosted_hosts=["git.example.com", "gitlab.company.org"]
)
provider, repo = factory.create(
    "https://git.example.com/group/project.git",
    token="glpat_xxx"
)

GitHub Enterprise

Для GitHub Enterprise используйте github_base_url:

factory = gitkit.GitProviderFactory(
    github_base_url="https://github.enterprise.com/api/v3"
)

Разработка

uv sync --extra dev
uv run pytest -q
uv run ruff check gitkit

Лицензия

MIT © 2026 Dmitry.

Metadata

Release files for s-gitkit 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for s-gitkit 0.1.1
File Size Uploaded Provenance Actions
s_gitkit-0.1.1.tar.gz 13.4 kB Without provenance Details for s_gitkit-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for s-gitkit 0.1.1
File Interpreter ABI Platform Actions
s_gitkit-0.1.1-py3-none-any.whl Python 3 none any Details for s_gitkit-0.1.1-py3-none-any.whl

Total release size: 26.3 kB

Release files / s_gitkit-0.1.1.tar.gz

Download URL s_gitkit-0.1.1.tar.gz
Size 13.4 kB
Tags Source
SHA-256 checksum
How to use checksums
39c569cf28124440aea1cc688b5a9b9ae94023f67439a14b6af87317c6c902c7
BLAKE2b-256 checksum
How to use checksums
c4e8c8bfbc1497de816b8889fe58a7c72fef605573b5d1002520ccb4e009fdd3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / s_gitkit-0.1.1-py3-none-any.whl

Download URL s_gitkit-0.1.1-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b7031be5c4b27ac15ad5236614939f39ae92fbf9fbd42991342a97524b353b9
BLAKE2b-256 checksum
How to use checksums
e08ec96a58a8823ddcbcee343029576c6ecea9c3b57b717e64f81fca775a3604
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for s-gitkit 0.1.1

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page