https://github.com/ashcrow/maintainers
Python3 library for parsing MAINTAINERS files.
https://github.com/ashcrow/maintainers
Last synced: about 1 year ago
JSON representation
Python3 library for parsing MAINTAINERS files.
- Host: GitHub
- URL: https://github.com/ashcrow/maintainers
- Owner: ashcrow
- License: other
- Created: 2016-03-18T19:57:16.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-03-18T20:54:40.000Z (about 10 years ago)
- Last Synced: 2025-02-13T18:34:51.655Z (over 1 year ago)
- Language: Python
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
maintainers
===========
Python3 library for parsing MAINTAINERS files. It can parse the non toml formats listed at [lgtm](https://lgtm.co/docs/maintainers/).
Example
-------
```python
import maintainers
all_maintainers = maintainers.parse('/path/to/MAINTAINERS')
for maintainer in all_maintainers:
print('Name: {}'.format(maintainer.name)) # Name: Jane Developer
print('Login: {}'.format(maintainer.login)) # Login: janesgithub_username
print('Email: {}'.format(maintainer.email)) # Email: jdeveloper@example.com
print(maintainer) # name=Jane Developer, login=janesgithub_username, email=jdeveloper@example.com
print(maintainer.json()) # '{"name": "Jane Developer", "login": "janesgithub_username", "email": "jdeveloper@example.com"}'
jane = maintainer.Maintainer(name='Jane Developer', login='janesgithub_username', email="jdeveloper@example.com")
jill = maintainer.Maintainer(name='Jill Engineer', login='jillsgithub_username', email="jengineer@example.com")
print(all_maintainers.is_maintainer(jane)) # True
print(all_maintainers.is_maintainer(jill)) # False
```