# 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 CodeOwners
example_file = """\
# owners for js files
*.js @ghost
# python
*.py user@example.com
# misc
/build/logs/ @dmin
docs/* docs@example.com
"""
owners = CodeOwners(example_file)
assert owners.of("test.js") == [('USERNAME', '@ghost')]
```
## Dev
```shell
poetry install
s/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
```
Raw data
{
"_id": null,
"home_page": "https://github.com/sbdchd/codeowners",
"name": "codeowners",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7,<4.0",
"maintainer_email": "",
"keywords": "codeowners,git,github",
"author": "Steve Dignam",
"author_email": "steve@dignam.xyz",
"download_url": "https://files.pythonhosted.org/packages/75/66/ddba64473b0ce0b2c30cd0e1e32d923839834ed91948ad92bad23b2eadeb/codeowners-0.7.0.tar.gz",
"platform": null,
"description": "# 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/)\n\n> Python codeowners parser based on [softprops's Rust\n> library](https://crates.io/crates/codeowners) and [hmarr's Go\n> library](https://github.com/hmarr/codeowners/).\n\n## Why?\n\nTo allow Python users to parse [codeowners\nfiles](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax)\nin Python.\n\n## Install\n\n```shell\npip install codeowners\n```\n\n## Usage\n\n```python\nfrom codeowners import CodeOwners\n\nexample_file = \"\"\"\\\n# owners for js files\n*.js @ghost\n# python\n*.py user@example.com\n# misc\n/build/logs/ @dmin\ndocs/* docs@example.com\n\"\"\"\n\nowners = CodeOwners(example_file)\nassert owners.of(\"test.js\") == [('USERNAME', '@ghost')]\n```\n\n## Dev\n\n```shell\npoetry install\n\ns/test\n\ns/lint\n```\n\n## Releasing a New Version\n\n```shell\n# bump version in pyproject.toml\n\n# update CHANGELOG.md\n\n# commit release commit to GitHub\n\n# build and publish\npoetry publish --build\n\n# create a release in the GitHub UI\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Codeowners parser for Python",
"version": "0.7.0",
"project_urls": {
"Homepage": "https://github.com/sbdchd/codeowners",
"Repository": "https://github.com/sbdchd/codeowners"
},
"split_keywords": [
"codeowners",
"git",
"github"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "92d14091c351ac4de65fa22da912bdb395011e6dc8e630f070348b7b3fdd885d",
"md5": "3c42b682de5ca91d56065b5d458db0a8",
"sha256": "0df5cd47299f984ba2e120dc4a0a7be68b528d53016ff39d06e86f85e33c7fc2"
},
"downloads": -1,
"filename": "codeowners-0.7.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3c42b682de5ca91d56065b5d458db0a8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7,<4.0",
"size": 8718,
"upload_time": "2024-03-07T23:34:54",
"upload_time_iso_8601": "2024-03-07T23:34:54.069540Z",
"url": "https://files.pythonhosted.org/packages/92/d1/4091c351ac4de65fa22da912bdb395011e6dc8e630f070348b7b3fdd885d/codeowners-0.7.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7566ddba64473b0ce0b2c30cd0e1e32d923839834ed91948ad92bad23b2eadeb",
"md5": "a53a05711e5c39e55e21ce5592fa7b1a",
"sha256": "a842647b20968c14da6066e4de4fffac4fd7c1c30de9cfa8b2fc8f534b3d9f48"
},
"downloads": -1,
"filename": "codeowners-0.7.0.tar.gz",
"has_sig": false,
"md5_digest": "a53a05711e5c39e55e21ce5592fa7b1a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7,<4.0",
"size": 7706,
"upload_time": "2024-03-07T23:34:55",
"upload_time_iso_8601": "2024-03-07T23:34:55.077559Z",
"url": "https://files.pythonhosted.org/packages/75/66/ddba64473b0ce0b2c30cd0e1e32d923839834ed91948ad92bad23b2eadeb/codeowners-0.7.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-07 23:34:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "sbdchd",
"github_project": "codeowners",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"circle": true,
"tox": true,
"lcname": "codeowners"
}