A python wrapper for the SonarQube web API
Project description
sonarqube-py
A class library and CLI to ease interaction with SonarQube API.
Although this project was written from scratch, it was made possible by understanding the previous work of https://github.com/kako-nawao/python-sonarqube-api
Prerequisites
Pipenv
This script library uses pipenv to set up Python and the required libraries.
Instructions to install pipenv here: https://github.com/pypa/pipenv
Docker
To help development it is useful to run SonarQube as a docker instance.
Use this command:
docker run -d --name sonarqube -p 9000:9000 sonarqube
SonarQube API Docs
SonarQube API docs are not easy to find: They are only available from a running instance of SonarQube.
If you are running sonarqube on localhost try this link:
http://localhost:9000/web_api/
If you have access to sonarcloud, try this:
https://sonarcloud.io/web_api
Usage
import the SonarQube class from the sonarqube.api module:
from sonarqube.api import SonarQube
instantiate the class, and execute any of the supported endpoints:
sq = SonarQube(token=token, host=host, port=port)
Endpoints
sonarqube-py supports the following endpoints:
- get_authentication_validate
- get_projects_search
- get_issues
- get_measures
- get_rule
- get_qualitygates_project_status
- get_qualitygates_get_by_project
- get_qualityprofiles_search
All endpoints support parameters as defined in the sonarqube wep-api documentation. I.e. the python client simply passes through any arguments you provide through to the web service API.
Examples
python -m examples.measures
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for sonarqube_py-0.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30cd593734718bf1e84d62c5f635d62e1cdf6cbadc5b8330a1cf70cf2f8bfbf2 |
|
MD5 | 8a965fb8c0ab9cdc1e318a3be6f0ee89 |
|
BLAKE2b-256 | 03e1b2950865a6d61b302192252776bc13ede3b9680fcf8f2aac06fb9c147c66 |