Skip to main content

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

Project description

fair-software.nl recommendations

Badges

1. Code repository

GitHub Badge

2. License

License Badge

3. Community Registry

PyPI Badge

4. Enable Citation

Zenodo Badge

code-auditor

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

Installation

The package and command-line utility can be installed easily from PyPI using pip.

pip install code-auditor

To install a specific version, e.g. v0.2.0, use:

pip install code-auditor==0.2.0

To upgrade to the latest version:

pip install --upgrade code-auditor

For the latest development version, you can install directly from the source:

git clone https://github.com/SS-NES/code-auditor.git
cd code-auditor/
pip install .

CLI Usage

Usage: codeauditor [OPTIONS] PATH

  Audits 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

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

codeauditor .

Audit the code repository of code-auditor and display the report in the terminal:

codeauditor https://github.com/SS-NES/code-auditor

Audit the code repository of code-auditor and save the report as report.docx:

codeauditor https://github.com/SS-NES/code-auditor --format docx --output report.docx

Package Usage

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

import codeauditor

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

# Get report output as Markdown
out = report.output(format=codeauditor.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

code_auditor-0.2.1.tar.gz (93.4 kB view details)

Uploaded Source

Built Distribution

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

code_auditor-0.2.1-py3-none-any.whl (109.7 kB view details)

Uploaded Python 3

File details

Details for the file code_auditor-0.2.1.tar.gz.

File metadata

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

File hashes

Hashes for code_auditor-0.2.1.tar.gz
Algorithm Hash digest
SHA256 3e3cf19d5c22b69c69c57e956dc2eb91c73002214b958cc86dbc41ab263b1d8f
MD5 a01e6f0f387cbec81d5debdf35760915
BLAKE2b-256 a88cbafed56deb65d984047e9a5560551fdb331f0852209b2433b225763d6050

See more details on using hashes here.

File details

Details for the file code_auditor-0.2.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for code_auditor-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1c02ae418c8bfc5f533881b570f9e344be15caf40f25ac7ccd4a45d39b545655
MD5 6e7bc8f42bf2f21130c7483fe07da266
BLAKE2b-256 122fec4d4b7e2bdb3c2d05d9237ddbddbb168c9f9de64bbac7cc6a28a98d0469

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