Skip to main content

NB Defense CLI.

Project description

NB Defense

Quick Start

  1. Install NBDefense using pip:

    $ pip install nbdefense
    
  2. Install Spacy Model en_core_web_trf (required if you are using the PII plugin):

    $ python -m spacy download en_core_web_trf
    
  3. Run a scan with nbdefense:

    $ nbdefense scan -s
    

Dev installation

To install development dependencies to your environment and set up the cli for live updates, clone nbdefense and run the following command in the root of the repository:

$ make install-dev

Poetry

The following install commands require Poetry. To install Poetry you can follow this installation guide. Poetry can also be installed with brew using the command brew install poetry.

Tips:

  • You can add a dependency with the command poetry add pendulum==0.0.0. To specify a group use poetry add pendulum==0.0.0 --group dev
  • You can remove a dependency with the command poetry remove pendulum

Formatting

Run the formatter with:

$ make format

Prod build

To build the cli for prod installs run the following:

$ make install
$ make build-prod

or if you want dynamic versioning with dunamai

$ make install-prod
$ make build-prod

CLI Usage

nbdefense scan command

nbdefense scan --help
Usage: nbdefense scan [OPTIONS] [PATH]

  Scan [PATH] for .ipynb files for potential issues.

Options:
  -r, --recursive                 Scan all nested directories for .ipynb
                                  files.
  -s, --serve                     Run an HTTP Server to view the report
                                  instead of persisting the report as an html
                                  file.
  -q, --quiet                     Suppress all output.
  -d, --dependency-file PATH      Specify a requirements.txt file to scan for
                                  CVEs and license compatibility.
  -f, --output-file FILE          Specify an output filename for the report.
  -o, --output-format [json|html]
                                  The output format for the report.
  -y, --yes                       Bypass all prompts with an affirmative
                                  response.
  --settings-file FILE            Specify a settings file to use for the scan.
                                  Defaults to [PATH]/settings.toml.
  --no-progress-bars              Hide progress bars, but keep other logging
                                  active.
  --help                          Show this message and exit.

nbdefense settings create command

nbdefense settings create --help
Usage: nbdefense settings create [OPTIONS]

  Create a settings file in the current working directory.

Options:
  -f, --force          Overwrite existing settings file if it exists.
  -l, --location FILE  The specific filepath to write the settings.toml file.
  --help               Show this message and exit.

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

nbdefense-1.0.3.tar.gz (39.5 kB view hashes)

Uploaded Source

Built Distribution

nbdefense-1.0.3-py3-none-any.whl (57.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page