python-gitlab
is a Python package providing access to the GitLab server API.
It supports the v4 API of GitLab, and provides a CLI tool (gitlab
).
python-gitlab depends on:
pip install python-gitlab
docker build -t python-gitlab:TAG .
docker run -it --rm -e GITLAB_PRIVATE_TOKEN=<your token> -v /path/to/python-gitlab.cfg:/python-gitlab.cfg python-gitlab <command> ...
or run it directly from the upstream image:
docker run -it --rm -e GITLAB_PRIVATE_TOKEN=<your token> -v /path/to/python-gitlab.cfg:/python-gitlab.cfg registry.gitlab.com/python-gitlab/python-gitlab:v1.8.0 <command> ...
To change the GitLab URL, use -e GITLAB_URL=<your url>
Bring your own config file:
docker run -it --rm -v /path/to/python-gitlab.cfg:/python-gitlab.cfg -e GITLAB_CFG=/python-gitlab.cfg python-gitlab <command> ...
Please report bugs and feature requests at https://github.com/python-gitlab/python-gitlab/issues.
The full documentation for CLI and API is available on readthedocs.
You can build the documentation using sphinx
:
pip install sphinx python setup.py build_sphinx
You can contribute to the project in multiple ways:
- Write documentation
- Implement features
- Fix bugs
- Add unit and functional tests
- Everything else you can think of
We enforce commit messages to be formatted using the conventional-changelog. This leads to more readable messages that are easy to follow when looking through the project history.
Please provide your patches as github pull requests. Thanks!
We use black as code formatter, so you'll need to format your changes using the black code formatter.
Just run
cd python-gitlab/
pip3 install --user black
black .