Skip to main content

The msgram CLI is a command-line interface to use MeasureSoftGram software

Project description

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.

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:

msgram extract -sp 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

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

msgram-3.3.1rc1.tar.gz (74.3 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.3.1rc1-py3-none-any.whl (77.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: msgram-3.3.1rc1.tar.gz
  • Upload date:
  • Size: 74.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for msgram-3.3.1rc1.tar.gz
Algorithm Hash digest
SHA256 a05496ee79123bf08bbff1824feeef0a72ebcee45330c5b960c01951982f2898
MD5 ea761c350c3b4b504def47fd713123af
BLAKE2b-256 e4f1a7fefb38394623a6706149b757a02c8b3efd9b1ae961a67f7c61e5adccad

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: msgram-3.3.1rc1-py3-none-any.whl
  • Upload date:
  • Size: 77.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for msgram-3.3.1rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 69242783dd82f5e368613256030229e5b9a005505fab23ddfe12bc9ff77240b5
MD5 c0ea6b93cc94e782c2a06e2a84f4021f
BLAKE2b-256 c3307b16760ebbf8c073585f9a6b61f48392fbaca5b409c5297da50e3eadba69

See more details on using hashes here.

Provenance

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

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