Skip to content

Commit 8ea80db

Browse files
author
Dan Hertz
committed
revert remove docs
1 parent eaa4451 commit 8ea80db

File tree

96 files changed

+22644
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+22644
-0
lines changed

Makefile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
.PHONY: help clean dev docs serve-docs package test
2+
3+
help:
4+
@echo "This project assumes that an active Python virtualenv is present."
5+
@echo "The following make targets are available:"
6+
@echo " dev install all deps for dev env"
7+
@echo " docs create pydocs for all relveant modules"
8+
@echo " serve-docs serve generated documentation locally"
9+
@echo " test run all tests with coverage"
10+
11+
clean:
12+
rm -rf dist/*
13+
14+
dev:
15+
pip install -r dev-requirements.txt
16+
pip install -e .
17+
18+
docs:
19+
$(MAKE) -C docsrc html
20+
@cp -a docsrc/_build/html/. docs
21+
22+
serve-docs:
23+
python3 -m http.server --directory docs
24+
25+
package:
26+
python -m build --sdist --wheel --outdir dist/
27+
28+
test:
29+
coverage run -m unittest discover
30+
coverage html

docs/.buildinfo

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Sphinx build info version 1
2+
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3+
config: 896b03f6111f682ae6016d8ce3222ee9
4+
tags: 645f666f9bcd5a90fca523b33c5a78b7

docs/.nojekyll

Whitespace-only changes.

docs/_sources/api.rst.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
API
2+
===
3+
4+
Nightfall Object
5+
----------------
6+
7+
.. automodule:: nightfall.api
8+
:members:
9+
:private-members:
10+
11+
Exceptions
12+
----------
13+
14+
.. automodule:: nightfall.exceptions
15+
:members:

docs/_sources/changelog.rst.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.. include:: ../CHANGELOG

docs/_sources/index.rst.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.. Nightfall documentation master file, created by
2+
sphinx-quickstart on Thu Jun 10 23:19:08 2021.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Welcome to Nightfall's documentation!
7+
=====================================
8+
9+
The Nightfall library is a python SDK for the `Nightfall API <https://nightfall.ai/>`_.
10+
11+
.. include:: contents.rst.inc

docs/_sources/quickstart.rst.txt

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
Quickstart
2+
==========
3+
4+
Installation
5+
------------
6+
7+
.. note::
8+
Nightfall requires Python 3.6 or higher.
9+
10+
You can install the latest version of Nightfall with:
11+
12+
::
13+
14+
pip install nightfall
15+
16+
Basic Usage
17+
-----------
18+
19+
Make a new `API Token <https://app.nightfall.ai/api/>`_ and `Detection Set <https://app.nightfall.ai/detection-engine/detection-rules>`_ in the Nightfall UI and export these as environment variables.
20+
21+
Import Nightfall and start using methods:
22+
23+
::
24+
25+
from nightfall import Nightfall
26+
27+
nightfall = Nightfall(
28+
os.getenv('NIGHTFALL_TOKEN'),
29+
os.getenv('NIGHTFALL_CONDITION_SET')
30+
)
31+
32+
response = nightfall.scan({'id': 'test string'})
33+
34+
print(response)
35+
36+
Enable Debug Logging
37+
--------------------
38+
39+
Log API request and response data to the console:
40+
41+
::
42+
43+
import logging
44+
45+
nightfall = Nightfall(token, condition_set)
46+
logging.basicConfig()
47+
nightfall.logger.setLevel(logging.DEBUG)
48+
49+
Log API request and response data to a file:
50+
51+
::
52+
53+
import logging
54+
55+
nightfall = Nightfall(token, condition_set)
56+
logging.basicConfig(filename="./nightfall_log.txt)
57+
nightfall.logger.setLevel(logging.DEBUG)

0 commit comments

Comments
 (0)