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.2.tar.gz (45.4 kB view details)

Uploaded Source

Built Distribution

nbdefense-1.0.2-py3-none-any.whl (63.5 kB view details)

Uploaded Python 3

File details

Details for the file nbdefense-1.0.2.tar.gz.

File metadata

  • Download URL: nbdefense-1.0.2.tar.gz
  • Upload date:
  • Size: 45.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.8.16 Linux/5.15.0-1034-azure

File hashes

Hashes for nbdefense-1.0.2.tar.gz
Algorithm Hash digest
SHA256 828155e2caca33ca5832d4c56efa94969e44423ca7e56a4a1f4231805122f305
MD5 bdf82e804bc762bc7f54f3f65fe86a43
BLAKE2b-256 39a80c4472a51993a19c0cbbc5baa2589c5a03c56e81ef0c74af527ef9d36af3

See more details on using hashes here.

File details

Details for the file nbdefense-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: nbdefense-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 63.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.8.16 Linux/5.15.0-1034-azure

File hashes

Hashes for nbdefense-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0b1282f4c656dadcc60d17576ee488928d0cb9b01eabb0153d51a05d5aa3ac2a
MD5 3fca5f34820f977c0f113ff3f27c95b7
BLAKE2b-256 539dc648d6c2711c1899340a592f2375e74b25a608f4c7a339f8d0df084cb759

See more details on using hashes here.

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