Skip to content

rage28/py-sonarqube-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python SonarQube Client

A python client for SonarQube

ℹ️
This project is still a WIP and will have missing features

Installation

pip install git+https://github.com/rage28/py-sonarqube-client

Compatibility

  • This package is compatible Python versions 3.6+

  • Tested with SonarQube EE v7.9

Usage

The API handler is easy to use, you just need to initialize it with the connection parameters (by default localhost on port 9000 without authentication) and use any of the methods to get the required information or create rules.

Example getting projects with coverage and issues metrics

from sonarqube import SonarQubeAPI

h = SonarQubeClient(user='admin', password='admin')
for project in h.projects:
    # do something with project data...

Since the actual response data from SonarQube server is usually paged, all methods return generators to optimize memory as well retrieval performance of the first items.

Sonar authentication tokens can also be used in place of username and password, which is particularly useful when accessing the SonarQube API from a CI server, as tokens can easily be revoked in the event of unintended exposure::

h = SonarQubeClient(token='<TOKEN>')

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages