toc

Python SDK

A full reference of our Python SDK.

The Evervault Python SDK is a toolkit for encrypting data as it enters your server.

Installation

Our Python SDK is distributed via pypi, and can be installed using pip.

bash
pip install evervault

Initialization

python
import evervault
# Initialize the client with your team’s API key
evervault.api_key = '<YOUR_API_KEY>'
# Encrypt your data
encrypted = evervault.encrypt({ 'name': 'Alice' })
# Process the encrypted data in a Cage
result = evervault.run('demo-cage', encrypted)

Reference

The Evervault Python SDK exposes two functions:

  • evervault.encrypt()
  • evervault.run()

evervault.encrypt()

evervault.encrypt() encrypts data for use in your Cages. To encrypt data at the server, simply pass a dict or string into the evervault.encrypt() function. Store the encrypted data in your database as normal.

python
evervault.encrypt(data = dict | string)
ParameterTypeDescription
datadict or stringData to be encrypted.

evervault.run()

evervault.run() lets you invoke a Cage with a given payload.

python
evervault.run(cageName = str, data = dict[, options = dict])
ParameterTypeDescription
cageNamestringName of the Cage to be run.
datadictPayload for the Cage.
optionsdictOptions for the cage run.
OptionsTypeDefaultDescription
asyncBooleanFalseRun your Cage in async mode. Async Cage runs will be queued for processing.
versionIntegerNoneSpecify the version of your Cage to run. By default, the latest version will be run.