Skip to main content

codeowners-cli

Python codeowners parser with a CLI — look up file owners from your CODEOWNERS file.

This is a fork of sbdchd/codeowners, which is a Python port of hmarr's Go library and softprops's Rust crate. This fork adds a codeowners-cli entry point installable via uvx, and modernizes the project tooling to use uv, ruff, and ty.

Install

# Run once with uvx
uvx codeowners-cli <filenames>

# Or install persistently
uv tool install codeowners-cli

CLI Usage

# Auto-detects CODEOWNERS in the current git repo
codeowners-cli src/foo.py tests/bar.py

# Explicit path
codeowners-cli --codeowners .github/CODEOWNERS src/foo.py

# Only show files that have owners
codeowners-cli --only-owners src/foo.py src/bar.py

# Structured output
codeowners-cli --output json src/foo.py
codeowners-cli --output csv  src/foo.py
codeowners-cli --output tsv  src/foo.py

# Omit header row
codeowners-cli --no-header src/foo.py

Default text output:

filename        owners
src/foo.py      @alice @team/backend
src/bar.py      user@example.com

Library Usage

from codeowners import CodeOwners

owners = CodeOwners(open("CODEOWNERS").read())
print(owners.of("src/foo.py"))
# [('USERNAME', '@alice'), ('TEAM', '@team/backend')]

Development

uv sync

# Run tests
uv run pytest

# Lint
uv run ruff check .

# Format
uv run ruff format .

# Type check
uv run ty check

Metadata

Release files for codeowners-cli 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 codeowners-cli 0.1.0
File Size Uploaded Provenance
codeowners_cli-0.1.0.tar.gz 4.7 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for codeowners-cli 0.1.0
File Interpreter ABI Platform
codeowners_cli-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.5 kB

Release files / codeowners_cli-0.1.0.tar.gz

Download URL codeowners_cli-0.1.0.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
371c40b5240f53af6d672389e075a29f6fe7d34b3f23d51bdb13dd34cce03645
BLAKE2b-256 checksum
How to use checksums
9776acc8f36a5c20e6add347deb10b6df6672a64434389b015d5af94c969d41c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 26, 2026.

Transparency log

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

Download URL codeowners_cli-0.1.0-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f61b5980a353315691f8ded3446727ab4a85d7bca500b8022c5389106c19b07a
BLAKE2b-256 checksum
How to use checksums
3534ec7e0c64d704d771de31dff8ea3f0284bbbae61180006aa7ffb96cf4b185
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 26, 2026.

Transparency log

Security for codeowners-cli 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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for codeowners_cli-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 May 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.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