Python API#

Public interface#

The top-level package re-exports the two most commonly used functions:

from zenodo_release_drift import lint_repo, lint_repo_explain

Reference#

zenodo_release_drift.main.lint_repo(owner: str, repo: str, github_collector: GitHubCollector | None = None, zenodo_collector: ZenodoCollector | None = None) → list[dict[str, Any]][source]#

Lint a repository for Zenodo release drift.

zenodo_release_drift.main.lint_repo_explain(owner: str, repo: str, github_collector: GitHubCollector | None = None, zenodo_collector: ZenodoCollector | None = None) → str[source]#

Lint a repository and return a Markdown explanation report.

zenodo_release_drift.main.explain_finding(finding: dict[str, Any]) → str[source]#

Return a human-readable explanation for a finding.

zenodo_release_drift.main.check_user(username: str, github_user_collector: GitHubUserCollector | None = None) → CheckUserResult[source]#

Return drift findings for Zenodo-integrated repos owned by a GitHub user.

Core classes#

class zenodo_release_drift.main.GitHubCollector(owner: str, repo: str, client: Github | None = None)[source]#

Collects GitHub releases.

get_release_dates() → dict[str, str][source]#

Return a mapping of tag name → ISO date string (YYYY-MM-DD).

get_releases() → list[str][source]#

Return release tag names from GitHub.

class zenodo_release_drift.main.ZenodoCollector(owner: str, repo: str, client: Client | None = None)[source]#

Collects Zenodo records for a GitHub repository.

get_versions() → list[str][source]#

Return version strings from Zenodo records (cached).

class zenodo_release_drift.main.VersionMatcher[source]#

Matches GitHub releases with Zenodo versions.

match(github_releases: list[str], zenodo_versions: list[str]) → dict[str, Any][source]#

Return matching results between two version lists.

class zenodo_release_drift.main.DriftEngine(github_collector: GitHubCollector | None = None, zenodo_collector: ZenodoCollector | None = None)[source]#

Detects release drift between GitHub and Zenodo.

detect(owner: str, repo: str) → list[dict[str, Any]][source]#

Return findings for the given repository.

class zenodo_release_drift.main.GitHubUserCollector(username: str, client: Github | None = None)[source]#

Lists repos owned by a GitHub user or org.

get_repos() → list[str][source]#

Return repo names owned by the user.

class zenodo_release_drift.main.CheckUserResult(findings: dict[str, list[dict[str, Any]]], repos_total: int, repos_with_zenodo: int)[source]#

Result of check_user, including counts for meaningful CLI output.