Skip to main content
Armorblox logo

Armorblox Python SDK (Alpha)

PyPI version Apache-2 License

This is an alpha version of the SDK with limited documentation and no support.

Requirements

Python 3.5+

Installation

pip install armorblox-sdk

Usage

from armorblox import client

# Create an API client for your tenant
c = client.Client(api_key='your-api-key-here', instance_name='yourtenantname')

# Fetch information about an incident's analysis data
incident_analysis = c.incidents.analysis(78143)

# Fetch information about an incident's sender data
incident_senders = c.incidents.senders(78143)

# Fetch information about an object associated with an incident (usually mail). 
# Get the object ID from Get Incident by Id's response, under .events[].object_id
incident_object = c.incidents.mail('d72c07bc789c30cb4d63d78ee2861f94add695f9c812e30cfb081b20d3e7e5e7')

# Updates the action to be taken for an incident's objects
update_details = c.incidents.update(78143, body = {
                  "policyActionType": "DELETE",
                  "addSenderToException": False,
                  "actionProfileId": ""
                })


# Fetch a list of threats
threat_incidents, next_page_token, total_incident_count = c.threats.list()

# Fetch a specific threat
incident = c.threats.get(44006)


# Fetch a list of abuse incidents
abuse_incidents, next_page_token, total_incident_count = c.abuse_incidents.list()

# Fetch a specific abuse incident
abuse_incident = c.abuse_incidents.get(44200)


# Fetch a list of DLP incidents
dlp_incidents, next_page_token, total_incident_count = c.dlp_incidents.list()

# Fetch a specific DLP incident
dlp_incident = c.dlp_incidents.get(44010)


# Fetch a list of EAC incidents
eac_incidents, next_page_token, total_incident_count = c.eac_incidents.list()

# Fetch a specific EAC incident
eac_incident = c.eac_incidents.get(67)


# Fetch a list of Graymail incidents
graymail_incidents, next_page_token, total_incident_count = c.graymail_incidents.list()

# Fetch a specific EAC incident
graymail_incident = c.graymail_incidents.get(2627)


# Example to fetch all threats using next_page_token
next_page_token = None
incidents = []
while True:
    threats, next_page_token, total_incident_count = c.threats.list(page_token=next_page_token)
    incidents.extend(threats)
    if not next_page_token:
        break

Contributing

  • Install Poetry
  • Clone the SDK repo & cd into it
git clone https://github.com/armorblox/armorblox-python-sdk
cd armorblox-python-sdk
  • Run poetry install to install the dependencies
  • Run tox to run the tests

Publishing

TestPyPI

One-time setup

poetry config repositories.test-pypi https://test.pypi.org/legacy/
poetry config pypi-token.test-pypi <your-TestPyPI-token>

Publishing

poetry publish --build -r test-pypi

Use

pip install --index-url https://test.pypi.org/simple/ --no-deps armorblox-sdk

to make sure the installation works correctly.

PyPI

One-time setup

poetry config pypi-token.pypi <your-PyPI-token>

Publishing

poetry publish --build

Metadata

Release files for armorblox-sdk 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for armorblox-sdk 0.1.4
File Size Uploaded
armorblox-sdk-0.1.4.tar.gz 9.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for armorblox-sdk 0.1.4
File Interpreter ABI Platform
armorblox_sdk-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 20.1 kB

Release files / armorblox-sdk-0.1.4.tar.gz

Download URL armorblox-sdk-0.1.4.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
dba441ff2e18841f2c229db88c81d3f5510ccec86daa2c824812e4bd2bd0ded2
BLAKE2b-256 checksum
How to use checksums
72afbc80e3f846b54303927d41b59559ebe8a7989854d91d72938b62a2f7fab9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.9.5 Darwin/22.3.0

Release files / armorblox_sdk-0.1.4-py3-none-any.whl

Download URL armorblox_sdk-0.1.4-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca8f9d72cb0adc7d106ae5e21281c289a90c3c36ed42f69d9ae85f56365cb86a
BLAKE2b-256 checksum
How to use checksums
7438c7cbafc8211a0a5f0cf0e1cb5f161212f81ae5eab527ac4261fdbd4be5be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.9.5 Darwin/22.3.0

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page