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.6.tar.gz (23.6 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.6-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: simple_sonarqube_api-0.1.6.tar.gz
  • Upload date:
  • Size: 23.6 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.6.tar.gz
Algorithm Hash digest
SHA256 19d5952eabdfc92312d60ea118db8aebefea02ad60ece8f6025394e7bdc97b6d
MD5 5ca6030980a2394a6fc7859d3c37b9a0
BLAKE2b-256 3c408982804b14ea6f5b90dacbde10acc55f4e12ee2d89369423878e451f47c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_sonarqube_api-0.1.6.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.6-py3-none-any.whl.

File metadata

File hashes

Hashes for simple_sonarqube_api-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e04d0b47403114606939e7fc719275d9e05340d363f2c1c8fc626c956a5de74e
MD5 fd3b84b07ccc497bf8101b4e142b3278
BLAKE2b-256 6589cfcab73b909f253d2417dde3937ce46f0efa89ba9adf2d86e817907d3a30

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_sonarqube_api-0.1.6-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