Skip to main content

Simple Python client for SonarQube Web API

Project description

simple-sonarqube-api

Sonarqube api python module

Usage

Build module

python -m venv .venv

Linux/macOS

source .venv/bin/activate

Windows (PowerShell)

# .\.venv\Scripts\Activate.ps1

build

python -m pip install -U pip
pip install -e .

Example

Install module

$ pip install simple-sonarqube-api

Code example

from simple_sonarqube_api.client import SonarQubeClient

client = SonarQubeClient(
    base_url="https://sonar.midominio",
    token="squ_xxxxxxxxx"
)

assert client.is_authenticated()

issues = list(client.iter_issues(types="VULNERABILITY", resolved=False))
evidence = client.get_issue_code_evidence(issues[0]["key"], context_lines=3)

print(evidence["snippet"])

Check bandit

$ bandit -r src/simple_sonarqube_api

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

simple_sonarqube_api-0.1.5.tar.gz (23.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simple_sonarqube_api-0.1.5-py3-none-any.whl (24.3 kB view details)

Uploaded Python 3

File details

Details for the file simple_sonarqube_api-0.1.5.tar.gz.

File metadata

  • Download URL: simple_sonarqube_api-0.1.5.tar.gz
  • Upload date:
  • Size: 23.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for simple_sonarqube_api-0.1.5.tar.gz
Algorithm Hash digest
SHA256 45109182ccc8c1fa43418aa227511f79178d2733ab92ec85a37bea1736801a22
MD5 763241eba1a589dc71514e4ce5c2c6b7
BLAKE2b-256 8b9b7470ab5c584a51c9d91ffa3c9e66780a8848b73ea9521365fbfd6464c59e

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_sonarqube_api-0.1.5.tar.gz:

Publisher: publish.yml on Mikehenrytech/simple-sonarqube-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file simple_sonarqube_api-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for simple_sonarqube_api-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 eeb60f2e46c6d7b0a0c3ff9a297da62522d3a694276b4a34639b0ed008a5e52f
MD5 61eb4489601cc0c96d4dfe961a9ae6b7
BLAKE2b-256 f16229eac0567e0940a241f8ec92c81cba9346cc3bacfb4cd886f7ea11edf04c

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_sonarqube_api-0.1.5-py3-none-any.whl:

Publisher: publish.yml on Mikehenrytech/simple-sonarqube-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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