Welcome to PyDragonfly’s documentation!

Robust Python SDK and Command Line Client for interacting with Certego’s Dragonfly service’s API.

Installation

$ pip install pydragonfly

Usage as CLI

On successful installation, The pydragonfly entryscript should be directly invokable. For example,

 $ pydragonfly
 Usage: pydragonfly [OPTIONS] COMMAND [ARGS]...

 Options:
   -d, --debug  Set log level to DEBUG
   --version    Show the version and exit.
   -h, --help   Show this message and exit.

 Commands:
   access-info  Get user access info
   analysis     Analysis Management
   config       Set or view config variables
   profile      Profile Management
   rule         Rule Management

Configuration:

You can use set to set the config variables and get to view them.

$ pydragonfly config set -k <dragonfly_api_key>
$ pydragonfly config get

Hint

The CLI would is well-documented which will help you navigate various commands easily. Invoke pydragonfly -h or pydragonfly <command> -h to get help.

Usage as SDK/library

1 from pydragonfly import Dragonfly, DragonflyException
2
3 df = Dragonfly(api_key="<dragonfly_api_key>")
4
5 try:
6    response = df.Analysis.list()
7    print(response)
8 except DragonflyException as exc:
9    print("Oh no! Error: ", exc)

Tip

We very much recommend going through the pydragonfly.Dragonfly docs.

Index

Indices and tables