Python SDK for Nightfall
Project description
Nightfall Python SDK
This is a python SDK for working with the Nightfall API.
Installation
This module requires Python 3.6 or higher.
pip install nightfall
Quickstart
Make a new API Token and Detection Rule Set in Nightfall and store the values as environment variables.
from nightfall import Nightfall
nightfall = Nightfall(
os.getenv('NIGHTFALL_TOKEN'),
os.getenv('NIGHTFALL_CONDITION_SET')
)
response = nightfall.scan(['test string'])
print(response)
Contributing
Please create an issue with a description of your problem, or open a pull request with the fix.
Development
Installing Development Dependencies
If you want to hack on this project, you should set up your local development environment with the following commands:
- Fork and clone this repo and open a terminal with the root of this repository in your working directory.
- Create and activate a virtualenv
python3 -m venv venv && source venv/bin/activate
- Install development dependencies with
pip install -r dev-requirements.txt
- 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:
- Add what changed to the CHANGELOG file.
- Update the version in
setup.py
- Commit changes and push to the main branch.
- Create a new release in the GitHub UI.
- Observe the release action succeed and see the latest version of this library on PyPI.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file nightfall-0.4.0.tar.gz
.
File metadata
- Download URL: nightfall-0.4.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1dc5cc699fd25e2202521fc0e9e6da2dc659a9c7042e49c2463c06c49f736ba8 |
|
MD5 | eca078981e59802cfc01a8d7f19d4785 |
|
BLAKE2b-256 | 4f3089d15cdf763691840b208e1aa7ebf71d511285bccaf62cce0b7177a4d743 |
File details
Details for the file nightfall-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: nightfall-0.4.0-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26b12bb2ec92d2eee2a6019758c25f897d2fecb4e602af6fa2f1c057eba99848 |
|
MD5 | cdec75a856f26617cda13af8249ce1ef |
|
BLAKE2b-256 | ffa1fe3dc2cea86fe893241fd7cc0a0f3ef25c5f14d811a435e2444006733be6 |