Skip to main content

2026-1 MeasureSoftGram-CLI

Command line project to MeasureSoftGram

Badges

Code Smells Maintainability Rating Security Rating Bugs Vulnerabilities Duplicated Lines (%) Reliability Rating Quality Gate Status Technical Debt Coverage Lines of Code Downloads Downloads Downloads

PyPI

What is the MeasureSoftGram-CLI?

The CLI is a command-line interface to the software.

How to use CLI

How to run the project

Use Python 3.9 or higher. The CI currently uses Python 3.10.

First, clone the repository and enter the project folder:

git clone <repository-url>
cd <repository-folder>

It is recommended to create and activate a virtual environment:

python3 -m venv .venv
source .venv/bin/activate

Then install the project dependencies:

pip install -r requirements.txt

The requirements.txt file already installs the local application in editable mode through -e .. After that, the msgram command is available in the terminal.

To show all MeasureSoftGram commands, use:

msgram -h

If you do not want to use the installed msgram command, run the Python entry point directly:

python3 main.py -h

If a module is not found, check if the virtual environment is activated and run pip install -r requirements.txt again.

Quickstart (msgram demo)

If you just want to see the CLI working end to end without providing your own SonarQube export, run the demo. It ships an embedded sample dataset in src/cli/examples/analytics-raw-data/ and runs the full pipeline (init, extract, calculate) for you:

msgram demo

This creates a ./msgram-demo/ working directory with the generated msgram.json, the extracted .metrics file and the calculated result (calc_msgram.csv by default). No external data or network access is required.

Optional arguments:

msgram demo -o <output_dir>    # choose the working directory
msgram demo -of json           # export the result as JSON instead of CSV

Basic usage

Create the default configuration file:

msgram init

This creates the .msgram/msgram.json file in the current directory.

List the configuration:

msgram list

Extract metrics from SonarQube/SonarCloud JSON files. Point -sp to a directory holding your own JSON exports, or use the sample dataset bundled in src/cli/examples/analytics-raw-data/ to try it out:

msgram extract -sp src/cli/examples/analytics-raw-data -ep .msgram

The -sp argument is the path to the directory with the JSON files. The -ep argument is the path where the extracted .metrics files will be saved.

Calculate the model values from extracted metrics:

msgram calculate -ep .msgram -cp .msgram -o csv

The -ep argument is the path to the extracted metrics. The -cp argument is the path to the folder with msgram.json. The -o argument defines the output format.

To see the options of a specific command, use:

msgram <command> -h

Common errors

If the project does not run, check these points first:

python --version
which python
which msgram

If the error is ModuleNotFoundError: No module named 'dotenv', the dependencies were probably not installed in the current environment. Activate the virtual environment and install the requirements again:

source .venv/bin/activate
pip install -r requirements.txt

If the msgram command is not found, check if the virtual environment is activated. You can also run the project using the Python entry point:

python3 main.py -h

If you use msgram init -cp <path>, make sure the parent directory already exists. The simplest option is to run msgram init inside the project folder.

How to run tests

Install the dependencies:

pip install -r requirements.txt

We are using tox for the tests, so it is good to install tox:

pip install tox

Then you can run the tests using:

tox

If you want to specify a test file, use pytest:

pip install pytest pytest-cov pytest-mock
pytest tests/unit/test_calculate.py

License

AGPL-3.0 License

Documentation

The documentation of this project can be accessed at this website: Documentation.

Contribute

Do you want to contribute with our project? Access our contribution guide where we explain how you do it.

Another informations

Our services are available on Docker Hub:

Wiki

For more informations, you can see our wiki:

Demais repositórios do produto

Metadata

Release files for msgram 3.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for msgram 3.4.0
File Size Uploaded Provenance Actions
msgram-3.4.0.tar.gz 83.9 kB With provenance Details for msgram-3.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for msgram 3.4.0
File Interpreter ABI Platform Actions
msgram-3.4.0-py3-none-any.whl Python 3 none any Details for msgram-3.4.0-py3-none-any.whl

Total release size: 171.2 kB

Release files / msgram-3.4.0.tar.gz

Download URL msgram-3.4.0.tar.gz
Size 83.9 kB
Tags Source
SHA-256 checksum
How to use checksums
596c886034e30a84807aa9513e27903b89d41a2b31d67b314eab0df9fa6ebf3c
BLAKE2b-256 checksum
How to use checksums
ffda40bebd79bcd6236d83a7e034b1941659278863208d9d068c0db7c10d7f13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

Release files / msgram-3.4.0-py3-none-any.whl

Download URL msgram-3.4.0-py3-none-any.whl
Size 87.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6fb1eca56a057a257ff8a30d0c84906cd83306dedcb9ca0df93d29ab8726bf3b
BLAKE2b-256 checksum
How to use checksums
5f359cac58c8cd55ab5fa374c1bd9ccaad8efd90ed8954213f14073af1058885
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

Security for msgram 3.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for msgram-3.4.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

3.4.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page