Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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

Download files

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

Source Distribution

msgram-3.4.0rc3.tar.gz (83.9 kB view details)

Uploaded Source

Built Distribution

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

msgram-3.4.0rc3-py3-none-any.whl (87.4 kB view details)

Uploaded Python 3

File details

Details for the file msgram-3.4.0rc3.tar.gz.

File metadata

  • Download URL: msgram-3.4.0rc3.tar.gz
  • Upload date:
  • Size: 83.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for msgram-3.4.0rc3.tar.gz
Algorithm Hash digest
SHA256 9b09cde126776014aefd79712807656c64f01798fb88ac172bb0dc5b16478c7e
MD5 b2625891544482081e551a3d064f16ff
BLAKE2b-256 b91d6bdfa550ef1901a6e06d2327047dace06dafe80a521de2b8bd80d2849528

See more details on using hashes here.

Provenance

The following attestation bundles were made for msgram-3.4.0rc3.tar.gz:

Publisher: python-publish.yml on fga-eps-mds/2026.1-MeasureSoftGram-CLI

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

File details

Details for the file msgram-3.4.0rc3-py3-none-any.whl.

File metadata

  • Download URL: msgram-3.4.0rc3-py3-none-any.whl
  • Upload date:
  • Size: 87.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for msgram-3.4.0rc3-py3-none-any.whl
Algorithm Hash digest
SHA256 6dc4c983bf6fd9807c98a74ba531a5c7f53494afc5b6bd7e9b681f2da8d19647
MD5 32bba6c08fe67751336ff9d9866d2293
BLAKE2b-256 5389abde388fa198eec63a183d2c14082c947d4be1b28b452e4b727bbe666814

See more details on using hashes here.

Provenance

The following attestation bundles were made for msgram-3.4.0rc3-py3-none-any.whl:

Publisher: python-publish.yml on fga-eps-mds/2026.1-MeasureSoftGram-CLI

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

Release history Release notifications | RSS feed

3.4.0

2 files

This release

3.4.0rc3 This release

2 files

3.3.0

2 files

3.2.2

2 files

3.2.1

2 files

3.2.0

2 files

3.1.9

2 files

3.1.8

2 files

3.1.7

2 files

3.1.6

2 files

3.1.5

2 files

3.1.4

2 files

3.1.3

2 files

3.1.2

2 files

3.1.1

2 files

3.1.0

2 files

3.0.3

2 files

3.0.2

2 files

3.0.0

2 files

1.2.2

2 files

1.2.1

2 files

1.1.2

2 files

1.1.0

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.1.0

2 files

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