Metadata-Version: 2.5
Name: hugoh-repokit
Version: 0.2.1
Summary: Toolkit for scripts that operate over a GitHub account's repos: list/filter them, run an async CLI, fan work out with bounded concurrency
Project-URL: Homepage, https://github.com/hugoh/fleet-tools/tree/main/repokit
Project-URL: Issues, https://github.com/hugoh/fleet-tools/issues
Project-URL: Repository, https://github.com/hugoh/fleet-tools
Author: Hugo Haas
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: asyncgh>=0.2.0
Requires-Dist: reconcilekit>=0.2.0
Description-Content-Type: text/markdown

# repokit

[![PyPI](https://img.shields.io/pypi/v/hugoh-repokit)](https://pypi.org/project/hugoh-repokit/)

A small toolkit for scripts that operate over a GitHub account's repos:
fetch them via [`asyncgh`](../asyncgh/README.md), keep the
non-archived/non-fork (by default) ones matching an `only`/`skip` filter,
run an async CLI entrypoint with shared-client cleanup (`run_cli`), and fan
work out over the repos in bounded parallel via
[`reconcilekit`](../reconcilekit/README.md) (`run_parallel`). No config-file
loading, no sops, no fork/exclude policy — those are a caller concern, which
is why `list_repos`'s `include_forks` defaults to none included rather than
reading any file.

Published to PyPI as `hugoh-repokit`; imported as `repokit`.

## API

Full API reference, generated from the docstrings:
[hugoh.github.io/fleet-tools/repokit](https://hugoh.github.io/fleet-tools/repokit/)
(rebuilt on every push that touches this package — see
`.github/workflows/docs.yml`).

## Example

```python
import asyncio
import os

from repokit import list_repos, run_cli


async def main(args) -> int:
    repos = await list_repos(os.environ["GH_OWNER"], only=args.only, skip=args.skip)
    for repo in repos:
        print(repo.name)
    return 0


def cli(argv: list[str]) -> int:
    return run_cli(main, parse_args(argv))
```

## Consumers

`repo-admin/` (in this repo) uses the full surface for
`repo_admin.py`/`activity.py`, consumed as a uv workspace member —
`repo-admin/lib.py` layers its own config-file-backed fork/exclude policy,
sops-based secrets, and `console`/`progress_bar`/etc. re-exports from
`asyncgh`/`reconcilekit` on top, kept local since none of that is generic.
[`digest-action`](https://github.com/hugoh/digest-action) (a separate repo,
since GitHub Marketplace only publishes actions from a repository root)
consumes it as a regular PyPI dependency for `list_repos` + `run_cli`.
