Skip to main content

Client library and CLI for sonarqube API

Project description

Python Sonarqube Client

This library provide a programmatic interface to interact with SonarQube. It exposes both a client class and a CLI.

Installation

pip install sonar-client

Example Usage

Using python interface

from sonar_client import SonarClient

sonar_token = "fake-token"
sonar = SonarClient(sonar_token, sonar_url="https://sonarcloud.io")
projects = sonar.search_project(organization="myorg")

Using CLI interface

You can discover available CLI commands by using --help options.

$ sonar-cli --help
Usage: sonar-cli [OPTIONS] COMMAND [ARGS]...

  SonarQube CLI

Options:
  --token TEXT  Sonar access token
  --help        Show this message and exit.

Commands:
  project  Sonar project management
$ sonar-cli project create --help
Usage: sonar-cli project create [OPTIONS]

  Create sonarqube project

Options:
  --org TEXT    Sonar organization  [required]
  --key TEXT    Sonar project key  [required]
  --title TEXT  Sonar project title  [required]
  --help        Show this message and exit.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sonar-client-0.0.5.tar.gz (4.0 kB view hashes)

Uploaded Source

Built Distribution

sonar_client-0.0.5-py3-none-any.whl (5.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page