Python SDK for the TruSTAR REST API


Keywords
python-sdk, security, trustar-api
License
MIT
Install
pip install trustar==0.3.15

Documentation

Python SDK for the TruSTAR API

API/SDK Documentation

See https://docs.trustar.co/ for the official documentation to the TruSTAR Python SDK.

Installation/Upgrade

Pre-requisites

Make sure you have the latest version of Requests package

$ sudo pip install requests --upgrade

Using pip (recommended)

$ pip install trustar --upgrade

Manual Installation

  1. Get the latest SDK by downloading as a ZIP and extract locally. You can also clone the repository directly from GitHub

  2. Install requirements

  • Python 2.7+:
$ sudo pip install future python-dateutil pytz requests configparser
  • Python 3:
$ sudo pip3 install future python-dateutil pytz requests configparser
  1. Install SDK
$ cd trustar-python
$ python setup.py install --force

Uninstallation

$ pip uninstall trustar

Running examples and tests

  • Retrieve or generate API credentials from the TruSTAR Station: https://station.trustar.co/settings/api
  • Inside the examples directory, create your own trustar.conf file from trustar.conf.example and Copy in your credentials and enclave IDs
$ cd examples
$ python basic_usage.py
$ python3 basic_usage.py

Development

To setup this project for development:

  1. Create a virtualenv using python 3:
virtualenv --no-site-packages -p python3 venv3
  1. Activate the virtualenv:
source ./venv3/bin/activate
  1. Install this package in editable mode:
pip install -e .
  1. Although step 3 will install the core requirements for the package, some additional packages are used during development (specifically, nose). To install these, run
pip install -r requirements.txt