Skip to main content

Python SDK for Nightfall

Project description

Nightfall Python SDK

This is a python SDK for working with the Nightfall API.


This module requires Python 3.6 or higher.

pip install nightfall


Make a new API Token and Detection Rule Set in Nightfall and store the values as environment variables.

from nightfall import Api

nightfall = Api(

response = nightfall.scan(['test string'])

findings = response.json()


Please create an issue with a description of your problem, or open a pull request with the fix.


Installing Development Dependencies

If you want to hack on this project, you should set up your local development environment with the following commands:

  1. Fork and clone this repo and open a terminal with the root of this repository in your working directory.
  2. Create and activate a virtualenv python3 -m venv venv && source venv/bin/activate
  3. Install development dependencies with pip install -r dev-requirements.txt
  4. Install an editable version of this package pip install -e .

Run Unit Tests

Unit tests can be found in the tests/ directory. You can run them with make test. Be sure to have NIGHTFALL_TOKEN and NIGHTFALL_CONDITION_SET set as environment variables before running the tests.

View Code Coverage

You can view the code coverage report by running coverage html and python3 -m http.server --directory htmlcov after running the unit tests.

SDK Documentation

The SDK is documented using the Sphinx library. You can generatre the developer documentation using make docs and preview it on localhost:8000 by running python3 -m http.server --directory docs/_build/html.

Creating a Release

Releases are automatically published to PyPI using GitHub Actions. Creating a release in GitHub will trigger a new build that will publish the latest version of this library to PyPI.

The steps to do this are:

  1. Add what changed to the CHANGELOG file.
  2. Update the version in
  3. Commit changes and push to the main branch.
  4. Create a new release in the GitHub UI.
  5. Observe the release action succeed and see the latest version of this library on PyPI.



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

nightfall-0.3.0.tar.gz (4.3 kB view hashes)

Uploaded Source

Built Distribution

nightfall-0.3.0-py3-none-any.whl (4.7 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