Codeowners parser and CLI for Python
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codeowners_cli-0.1.0.tar.gz.
File metadata
- Download URL: codeowners_cli-0.1.0.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
371c40b5240f53af6d672389e075a29f6fe7d34b3f23d51bdb13dd34cce03645
|
|
| MD5 |
cfd0ca9be67d230073259335b768f05f
|
|
| BLAKE2b-256 |
9776acc8f36a5c20e6add347deb10b6df6672a64434389b015d5af94c969d41c
|
Provenance
The following attestation bundles were made for codeowners_cli-0.1.0.tar.gz:
Publisher:
publish.yml on blackary/codeowners
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codeowners_cli-0.1.0.tar.gz -
Subject digest:
371c40b5240f53af6d672389e075a29f6fe7d34b3f23d51bdb13dd34cce03645 - Sigstore transparency entry: 1634178770
- Sigstore integration time:
-
Permalink:
blackary/codeowners@ca4714594c11ba14b8c24d286eb71991cabcd657 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/blackary
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ca4714594c11ba14b8c24d286eb71991cabcd657 -
Trigger Event:
release
-
Statement type:
File details
Details for the file codeowners_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: codeowners_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f61b5980a353315691f8ded3446727ab4a85d7bca500b8022c5389106c19b07a
|
|
| MD5 |
729c7d2f833f2162da2b7ec117433635
|
|
| BLAKE2b-256 |
3534ec7e0c64d704d771de31dff8ea3f0284bbbae61180006aa7ffb96cf4b185
|
Provenance
The following attestation bundles were made for codeowners_cli-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on blackary/codeowners
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codeowners_cli-0.1.0-py3-none-any.whl -
Subject digest:
f61b5980a353315691f8ded3446727ab4a85d7bca500b8022c5389106c19b07a - Sigstore transparency entry: 1634178787
- Sigstore integration time:
-
Permalink:
blackary/codeowners@ca4714594c11ba14b8c24d286eb71991cabcd657 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/blackary
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ca4714594c11ba14b8c24d286eb71991cabcd657 -
Trigger Event:
release
-
Statement type: