--- id: pysonar version: "1.7.0.5143" license: LGPL-3.0-only license_treatment: copyleft maintenance: active --- # pysonar — Sonar Scanner for the Python Ecosystem License: copyleft · Maintenance: active · Downloads: 321.3K/mo ## What it is and what it does pysonar is a Python wrapper around SonarQube's scanning infrastructure, designed to let developers run code quality analysis directly from the command line without needing the standalone SonarScanner binary. It reads your project configuration from multiple sources—CLI flags, environment variables, pyproject.toml, or a sonar-project.properties file—and communicates with a running SonarQube instance or SonarCloud to perform static analysis on your codebase. The package depends on jproperties, requests, and tomli to parse configuration files, make HTTP calls to the Sonar server, and handle TOML parsing. It targets modern Python versions (3.10+) and is actively maintained by SonarSource. Configuration is flexible and can be layered across multiple sources with clear precedence rules, making it adaptable to both local development workflows and CI/CD pipelines. Use it for: - Integrate code quality gates into CI/CD pipelines by running pysonar as a build step before deployment. - Analyze Python projects locally during development using pyproject.toml configuration without installing SonarScanner separately. - Enforce organization-wide code standards by configuring sonar-project.properties and running scans across multiple repositories. - Monitor code quality trends over time by submitting analysis results to SonarCloud for public or private projects. - Combine with environment variables in containerized workflows to pass credentials and server URLs without hardcoding them. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A command-line scanner that integrates Python projects with SonarQube or SonarCloud for code quality analysis, supporting configuration via CLI arguments, environment variables, or pyproject.toml. Yes, if you are already using SonarQube or SonarCloud and want a lightweight Python-native scanner. The low install friction, active maintenance, and flexible configuration make it a practical choice for Python projects. The copyleft license (LGPL-3.0-only) requires review in proprietary contexts but poses no barrier for internal or open-source use. No known vulnerabilities as of 2026-08-14. ## Install pip install pysonar uv add pysonar poetry add pysonar ## Installing pysonar Before you install: Low friction installation with a pure Python wheel and minimal dependencies. Active maintenance with recent releases; last commit on 2026-08-13 and latest release on 2026-07-08 indicate ongoing support. License in practice: Licensed under LGPL-3.0-only (copyleft). Derivative works and distributions must retain the same license and provide source code access; suitable for internal tools and open-source projects but requires careful review in proprietary contexts. Quickstart: pip install pysonar pysonar --token "MyToken" -Dsonar.projectKey=my:project Requires SonarQube v10.6 or above (or SonarCloud account) running and accessible; Python 3.10 or above required. Verify before relying: - Whether the scanner supports incremental analysis or only full scans. - Performance characteristics when analyzing large codebases. - Compatibility with CI/CD platforms beyond the documented examples. ## Package facts - License: LGPL-3.0-only (copyleft) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 321.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags sonarqube scanner python, code quality analysis tool, sonarcloud integration, python static analysis, sonar project scanner, code coverage reporting, quality gate automation, code-quality, ci-cd, static-analysis [View on SkillFed](https://skillfed.io/packages/pysonar) · [View on PyPI](https://pypi.org/project/pysonar/)