Git + GitHub Actions utilities (clone, branch, commit, retry, remote helpers, gh secrets/variables with SHA256 sidecar) — standalone module from the SciTeX ecosystem
Project description
scitex-git
Git operations and utilities — clone, init, branch, remote, retry decorator.
Full Documentation · uv pip install scitex-git[all]
Installation
pip install scitex-git
Architecture
scitex_git/
├── _clone.py ← clone_repo, ls_remote, get_remote_url
├── _init.py ← git_init, init_git_repo, find_parent_git
├── _commit.py ← git_add_all, git_commit
├── _branch.py ← checkout_new_branch, branch_rename, setup_branches
├── _remote.py ← remote-URL helpers, head-hash queries
├── _retry.py ← @git_retry decorator (transient-error backoff)
├── _validation.py ← repo-state guards
├── _workflow.py ← high-level multi-step flows
├── _vendor_sh.py ← ~70-LOC subprocess wrapper (replaces scitex.sh)
└── _skills/ ← agent-facing skill pages
Pure-stdlib core. _vendor_sh.py is intentionally tiny so the package
has no scitex.* runtime dependency. The umbrella scitex.git import
resolves through a sys.modules bridge.
1 Interfaces
Python API
import scitex_git as sxg
# Clone / init
sxg.clone_repo(url, dest_dir)
sxg.git_init(repo_path)
# Add / commit
sxg.git_add_all(repo_path)
sxg.git_commit(repo_path, message="…")
# Branch
sxg.git_checkout_new_branch(repo_path, branch_name)
sxg.git_branch_rename(repo_path, old, new)
sxg.setup_branches(repo_path, template_name)
# Repo init / discovery
sxg.init_git_repo(project_dir, git_strategy="parent")
sxg.find_parent_git(project_dir)
sxg.create_child_git(project_dir)
sxg.remove_child_git(project_dir)
# Remote
sxg.get_remote_url(repo_path)
sxg.is_cloned_from(repo_path, url)
sxg.ls_remote(url)
sxg.get_head_hash(repo_path)
# Retry decorator
@sxg.git_retry(max_attempts=3)
def maybe_flaky_operation(): ...
Demo
flowchart LR
A["scitex_git.clone_repo<br/>(url, dest)"] --> B["@git_retry<br/>(transient errors)"]
B --> C["repo on disk"]
C --> D["git_add_all + git_commit"]
D --> E["checkout_new_branch<br/>+ branch_rename"]
E --> F["get_remote_url /<br/>get_head_hash"]
>>> import scitex_git as sxg
>>> sxg.clone_repo("https://github.com/foo/bar", "./bar")
>>> sxg.git_add_all("./bar")
>>> sxg.git_commit("./bar", message="initial")
Quick Start
import scitex_git as sxg
sxg.clone_repo("https://github.com/foo/bar", "./bar")
sxg.git_add_all("./bar")
sxg.git_commit("./bar", message="initial")
Status
Standalone fork of scitex.git. scitex.logging.getLogger is replaced by stdlib
logging.getLogger; the scitex.sh.sh shell wrapper is replaced by a tiny
~70-LOC _vendor_sh.py that supports just the call-shape used here. The
optional scitex.writer.verify_tree_structure validation step in
create_child_git is gated behind a try/except so it only runs when
scitex-writer is installed.
The umbrella package's scitex.git import path is preserved via a
sys.modules-alias bridge so existing code continues to work.
Part of SciTeX
scitex-git is part of SciTeX. Install via
the umbrella with pip install scitex[git] to use as
scitex.git (Python) or scitex git ... (CLI).
Four Freedoms for Research
- The freedom to run your research anywhere — your machine, your terms.
- The freedom to study how every step works — from raw data to final manuscript.
- The freedom to redistribute your workflows, not just your papers.
- The freedom to modify any module and share improvements with the community.
AGPL-3.0 — because we believe research infrastructure deserves the same freedoms as the software it runs on.
License
AGPL-3.0-only (see 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 Distribution
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 scitex_git-0.3.1.tar.gz.
File metadata
- Download URL: scitex_git-0.3.1.tar.gz
- Upload date:
- Size: 33.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e63375c2cf3b4242b1b76542d610f53a94b5bc042a1912ecbf84fc7e7195bed
|
|
| MD5 |
696e0e2aba995b8be2a6785006821f94
|
|
| BLAKE2b-256 |
47de3318626f02871d5a173234d2ddc12efa1f452576631d9ef7f1d0c2a99608
|
Provenance
The following attestation bundles were made for scitex_git-0.3.1.tar.gz:
Publisher:
publish-pypi.yml on ywatanabe1989/scitex-git
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scitex_git-0.3.1.tar.gz -
Subject digest:
7e63375c2cf3b4242b1b76542d610f53a94b5bc042a1912ecbf84fc7e7195bed - Sigstore transparency entry: 1568267066
- Sigstore integration time:
-
Permalink:
ywatanabe1989/scitex-git@7304cc0dbc10b344817ecb422213b4c05c8e1cf1 -
Branch / Tag:
refs/heads/develop - Owner: https://github.com/ywatanabe1989
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@7304cc0dbc10b344817ecb422213b4c05c8e1cf1 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file scitex_git-0.3.1-py3-none-any.whl.
File metadata
- Download URL: scitex_git-0.3.1-py3-none-any.whl
- Upload date:
- Size: 38.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
abe8d35e2d77ae1e788f627b4eb6a7ddf994799f18e6bacb93b0f7c3baf68e8c
|
|
| MD5 |
b1af9b70315d82210cb62bed1620cecf
|
|
| BLAKE2b-256 |
2d1b0a4c722cae1fd9ba0d4f487f0120618004c5d8650820f25f9d5f4c415922
|
Provenance
The following attestation bundles were made for scitex_git-0.3.1-py3-none-any.whl:
Publisher:
publish-pypi.yml on ywatanabe1989/scitex-git
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scitex_git-0.3.1-py3-none-any.whl -
Subject digest:
abe8d35e2d77ae1e788f627b4eb6a7ddf994799f18e6bacb93b0f7c3baf68e8c - Sigstore transparency entry: 1568267161
- Sigstore integration time:
-
Permalink:
ywatanabe1989/scitex-git@7304cc0dbc10b344817ecb422213b4c05c8e1cf1 -
Branch / Tag:
refs/heads/develop - Owner: https://github.com/ywatanabe1989
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@7304cc0dbc10b344817ecb422213b4c05c8e1cf1 -
Trigger Event:
workflow_dispatch
-
Statement type: