Skip to main content

A package and command-line utility to check code quality and compliance with best practices.

Project description

This is a package and command-line utility to check code quality and compliance with best practices.

Installation

  1. Clone or download the source code:

    git clone https://github.com/SS-NES/codescholar.git
  2. Go to the root directory:

    cd codescholar/
  3. Compile and install using pip:

    pip install .

CLI Usage

Usage: codescholar [OPTIONS] PATH

  Scans the code base, where PATH is the path or URL address of the code base.

Options:
  --skip-analyser [change_log|citation|code_markdown|code_python|conduct|contributing|dependency_python|documentation|git|jupyter_notebook|license|notice|packaging_python|testing_python]
                                  List of analysers to skip.
  --skip-aggregator [citation|code|community|documentation|license|packaging|repository|testing|version_control|metadata]
                                  List of aggregators to skip.
  --skip-type [citation|code|community|dependency|documentation|license|metadata|packaging|publishing|repository|testing|version_control]
                                  List of processor types to skip.
  -r, --reference FILENAME        Path of the reference metadata for
                                  comparison (e.g. SMP).
  -b, --branch TEXT               Branch or tag of the remote code repository.
  -t, --path-type [zip|tar|tgz|tar.gz|git]
                                  Type of the file located at the path.
  -m, --metadata FILENAME         Path to store the metadata extracted from
                                  the code base.
  -o, --output PATH               Path to store the analysis output.
  -f, --format [plain|html|json|yaml|markdown|rst|rtf|docx]
                                  Output format.  [default: rst]
  -p, --plain                     Enable plain output.
  -l, --message-level INTEGER RANGE
                                  Message level.  [default: 1; 1<=x<=5]
  -d, --debug                     Enable debug mode.
  -v, --version                   Show the version and exit.
  -h, --help                      Show this message and exit.

Examples

Analyse the code in the current working directory and display the report in the terminal:

codescholar .

Analyse the code repository of Code Scholar and display the report in the terminal:

codescholar https://github.com/SS-NES/codescholar

Analyse the code repository of Code Scholar and save the report as report.docx:

codescholar https://github.com/SS-NES/codescholar --format docx --output report.docx

Package Usage

Analyse the code in the current working directory and display the report in the terminal:

import codescholar

# Generate analysis report
report = codescholar.analyse('.')

# Get report output as Markdown
out = report.output(format=codescholar.report.OutputType.MARKDOWN)

# Display output
print(out)

Acknowledgements

This software was developed as part of the TDCC-NES Bottleneck Project “Best Practices for Sustainable Software” funded by the Thematic Digital Competence Centre (TDCC) for the Natural & Engineering Sciences (NES).

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

codescholar-0.2.0.tar.gz (191.9 kB view details)

Uploaded Source

Built Distribution

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

codescholar-0.2.0-py3-none-any.whl (210.2 kB view details)

Uploaded Python 3

File details

Details for the file codescholar-0.2.0.tar.gz.

File metadata

  • Download URL: codescholar-0.2.0.tar.gz
  • Upload date:
  • Size: 191.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for codescholar-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d385358c547295e5c74a8d56c523ea845d01aeb8b85e23975b1a783d4e9626b8
MD5 9ad2b065fd4448528e9b742af39afd73
BLAKE2b-256 9921d17a067282b9752e98247d9b53d273b3e2aa1ff4e17c5a1cd60b14d681a4

See more details on using hashes here.

File details

Details for the file codescholar-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: codescholar-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 210.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for codescholar-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f3e3aceefe4b08cdf3dd2206e36e205dad51f27ba10ffeb051e27d6deafaa04f
MD5 c184e35da7341e47e470bc0493becc00
BLAKE2b-256 b8be19edc7dae53dc8ef259e5b76f2678770b5230ab24d3f0e564fd864f3d6e5

See more details on using hashes here.

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