https://github.com/sbdchd/codeowners
:honeybee: A Python library for codeowners files
https://github.com/sbdchd/codeowners
codeowners python
Last synced: 3 months ago
JSON representation
:honeybee: A Python library for codeowners files
- Host: GitHub
- URL: https://github.com/sbdchd/codeowners
- Owner: sbdchd
- License: mit
- Created: 2019-08-03T14:40:16.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-03-07T23:35:26.000Z (over 1 year ago)
- Last Synced: 2025-03-31T10:03:34.684Z (4 months ago)
- Topics: codeowners, python
- Language: Python
- Homepage:
- Size: 74.2 KB
- Stars: 41
- Watchers: 3
- Forks: 18
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: codeowners/__init__.py
Awesome Lists containing this project
README
# codeowners [](https://circleci.com/gh/sbdchd/codeowners) [](https://pypi.org/project/codeowners/)
> Python codeowners parser based on [softprops's Rust
> library](https://crates.io/crates/codeowners) and [hmarr's Go
> library](https://github.com/hmarr/codeowners/).## Why?
To allow Python users to parse [codeowners
files](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax)
in Python.## Install
```shell
pip install codeowners
```## Usage
```python
from codeowners import CodeOwnersexample_file = """\
# owners for js files
*.js @ghost
# python
*.py [email protected]
# misc
/build/logs/ @dmin
docs/* [email protected]
"""owners = CodeOwners(example_file)
assert owners.of("test.js") == [('USERNAME', '@ghost')]
```## Dev
```shell
poetry installs/test
s/lint
```## Releasing a New Version
```shell
# bump version in pyproject.toml# update CHANGELOG.md
# commit release commit to GitHub
# build and publish
poetry publish --build# create a release in the GitHub UI
```