Skip to main content

API Extractor Toolbox

GitHub Extractor

Read-only access to GitHub organisations, repositories, and the related data you ask for. It is a Python library, lupaxa.github_extractor, and a github-extractor command. It does not create, update, or delete GitHub data.

Installation

pip install lupaxa-github-extractor

Note: The command reads the token from --token, then GITHUB_TOKEN, then gh auth token, and passes that string into GitHubExtractor. The library does not read the environment.

Library

from lupaxa.github_extractor import GitHubExtractor

client = GitHubExtractor(token)
repos = client.repositories_by_org(
    "acme",
    resources=("topics", "workflows", "languages", "commits", "issues"),
)

for repo in repos:
    names = [] if repo.topics is None else repo.topics.names
    workflows = [] if repo.workflows is None else [item.name for item in repo.workflows]
    print(repo.full_name, names, workflows, repo.languages)
    for failure in repo.errors:
        print(failure.addon, failure.status, failure.message)

resources is one list. These names can be mixed in the same call: branches, contributors, languages, releases, tags, topics, workflows, commits, issues, pulls, milestones, forks, stargazers, subscribers, collaborators, labels, workflow_runs, deployments, environments, and contents. Organisation extras include audit_log. User extras include notifications. A name that was not requested is None.

params sets query strings per resource name. Each key must appear in the resources list for that call. issues and pulls default to state=all. notifications defaults to all=true. Caller values replace defaults.

repo = client.repository(
    "acme/widget",
    resources=("topics", "workflows", "workflow_runs", "issues"),
    params={"issues": {"state": "closed"}},
)
user = client.authenticated_user(
    resources=("repos", "notifications"),
    repository_resources=("topics", "commits"),
)

repository(full_name, ...) returns one repository. On authenticated_user, repository_resources fetches extras on each repo in repos, starred, or subscriptions when one of those lists is requested.

topics is one object with names. workflows is a list of workflow objects, without total_count. languages is a dictionary of byte counts. forks in that list replaces GitHub's integer fork count. Other fields from the repository JSON stay on repo.raw.

A 404, 409, or 410 on one extra stores an empty list for that name and records the failure on errors. The rest of the result is still returned. Authentication failures, rate limits, and other 403 responses raise.

slugs=True stays a boolean. It returns names only and does not fetch resources, even when that list is set.

names = client.repositories_by_org("acme", slugs=True)

The other list methods are user_repositories (omit username for the authenticated user), visible_repositories, and organisation_repositories. organisations(resources=("members", "teams", "hooks")) lists the token's organisations. authenticated_user(resources=("emails", "repos")) returns the token's user. get("/repos/acme/widget/commits") returns raw JSON for any read-only API path. max_pages=None follows every page. A positive integer stops after that many pages.

Command Line

Flags are the command-line form of the same resource names. Order on the command line does not matter.

github-extractor repo acme/widget --topics --workflows --workflow-runs
github-extractor repos org acme --topics --workflows --languages --commits --issues
github-extractor repos user --username ada --releases --tags --pulls
github-extractor repos visible --skip-private --include 'acme/*' --topics
github-extractor repos organisations --include-org 'acme*'
github-extractor repos organizations --include-org 'acme*'
github-extractor organisations --members --teams --hooks
github-extractor user --repos --topics --notifications
github-extractor repos org acme --issues --param issues.state=closed --api-root https://github.example/api/v3
github-extractor repos org acme --slugs
github-extractor get /repos/acme/widget/commits --max-pages 2

--include and --ignore are case-insensitive globs on full_name. --include-name and --ignore-name match the repository name. --include-org and --ignore-org limit repos organisations and repos organizations. Repeat a flag to pass more than one glob. --param sets name.key=value query parameters. --api-root overrides the API host. --max-pages caps paging. --timeout and --max-workers default to 10 seconds and 8 workers.

The command prints JSON indented with two spaces. It exits 0 on success, 2 for usage and a missing token, 3 for authentication, 4 for a rate limit, 5 when a primary request is not found, and 1 for everything else.

Documentation

Longer walks and the full method list are in the documentation.

The Lupaxa Project Footer

Metadata

Release files for lupaxa-github-extractor 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 lupaxa-github-extractor 0.1.1
File Size Uploaded Provenance Actions
lupaxa_github_extractor-0.1.1.tar.gz 21.2 kB With provenance Details for lupaxa_github_extractor-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lupaxa-github-extractor 0.1.1
File Interpreter ABI Platform Actions
lupaxa_github_extractor-0.1.1-py3-none-any.whl Python 3 none any Details for lupaxa_github_extractor-0.1.1-py3-none-any.whl

Total release size: 46.3 kB

Release files / lupaxa_github_extractor-0.1.1.tar.gz

Download URL lupaxa_github_extractor-0.1.1.tar.gz
Size 21.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8efaf42c6e3364cf7d7ecb3ef349c93dfcb7003af37e26d4c00f5a949df37cd8
BLAKE2b-256 checksum
How to use checksums
f4a9b8be7fdada8b7b75b74d54215f905f84f98a15f1b39f0d6e8478f3a9bafe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

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

Download URL lupaxa_github_extractor-0.1.1-py3-none-any.whl
Size 25.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7f04c01b60519aa47d59760d8eab87ff53d7945ba0f898be762d76b2b291c2e
BLAKE2b-256 checksum
How to use checksums
11f90055554bba2c0ef8d3d756d0e0ca2074bdbe09f842791e878384651d829d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for lupaxa-github-extractor 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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for lupaxa_github_extractor-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

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 Full 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