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 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 examples/analytics-raw-data/ to try it out:

msgram extract -sp 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.0rc1.tar.gz (78.5 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.0rc1-py3-none-any.whl (81.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: msgram-3.4.0rc1.tar.gz
  • Upload date:
  • Size: 78.5 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.0rc1.tar.gz
Algorithm Hash digest
SHA256 0a6e2e31485066edac703f1ec45920bed4b701839b591ce85cf882fae72b39d5
MD5 26e98500ad9117bbb0aa283d36ec5048
BLAKE2b-256 6b249b19f9683498e2806bca4e52c7a9421a4ae61503b7142ff689e70dfd14df

See more details on using hashes here.

Provenance

The following attestation bundles were made for msgram-3.4.0rc1.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.0rc1-py3-none-any.whl.

File metadata

  • Download URL: msgram-3.4.0rc1-py3-none-any.whl
  • Upload date:
  • Size: 81.6 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.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 101e18a1d0870f85cfb1b2e6226e4e0728c7e866c4d57d49e00b6b3ccc5615ee
MD5 b6680b030ef058265f8f8e9d56d88372
BLAKE2b-256 32d4da20fe90e7ceca1fe4ec8f74f4ee860df6299affdd909895ec1c9591d127

See more details on using hashes here.

Provenance

The following attestation bundles were made for msgram-3.4.0rc1-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.0rc1 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