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.0

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.0
File Size Uploaded Provenance Actions
lupaxa_github_extractor-0.1.0.tar.gz 42.2 kB With provenance Details for lupaxa_github_extractor-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 67.7 kB

Release files / lupaxa_github_extractor-0.1.0.tar.gz

Download URL lupaxa_github_extractor-0.1.0.tar.gz
Size 42.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3b44e07cba515ea751dd816f98be983d60ec2a74079cbb1712d9dc5dd58da217
BLAKE2b-256 checksum
How to use checksums
665e8c7c78fcece62b756a7f6471500bc6052a97d6b9b9198339bb58aae38acc
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 21, 2026.

Transparency log

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

Download URL lupaxa_github_extractor-0.1.0-py3-none-any.whl
Size 25.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e079dbee35a09397abc13e44eee3b9b28b712df306bc6d1536116bb0723c2a50
BLAKE2b-256 checksum
How to use checksums
b503e253a613f8a4def8df403715157be5f3f46346e76414e79d65d822154f93
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 21, 2026.

Transparency log

Security for lupaxa-github-extractor 0.1.0

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.0.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 21, 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.0 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