Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sbdchd/codeowners
:honeybee: A Python library for codeowners files
https://github.com/sbdchd/codeowners
codeowners python
Last synced: 2 days 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 (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-03-07T23:35:26.000Z (10 months ago)
- Last Synced: 2024-12-25T07:06:29.107Z (9 days ago)
- Topics: codeowners, python
- Language: Python
- Homepage:
- Size: 74.2 KB
- Stars: 38
- Watchers: 4
- 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 [![CircleCI](https://circleci.com/gh/sbdchd/codeowners.svg?style=svg)](https://circleci.com/gh/sbdchd/codeowners) [![pypi](https://img.shields.io/pypi/v/codeowners.svg)](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
```