Skip to main content

An SDK to work with the Arachnid Shield API

Project description

arachnid-shield-sdk

An SDK for consuming the Arachnid Shield API.

Installation

pip install arachnid-shield-sdk

Usage

First, obtain login credentials by contacting Project Arachnid.

This client acts simply as a global resource that may live as long as your application. So you may use it in different ways.

Vanilla Python (Sync)

You may use the ArachnidShield client that has all the methods needed to consume the Arachnid Shield API.

from arachnid_shield_sdk import ArachnidShield

shield = ArachnidShield(username="", password="")
    
def process_media(contents):

    scanned_media = shield.scan_media_from_bytes(contents, "image/jpeg")
    if scanned_media.matches_known_image:
        print(f"harmful media found!: {scanned_media}")
    ... 


def main():
    
    with open("some-image.jpeg", "rb") as f:
        contents = f.read()
    
    process_media_for_user(contents)


if __name__ == '__main__':
    main()

Vanilla Python (Async)

In async environments, you may use the ArachnidShieldAsync client which has the exact same interface as the ArachnidShield client but where all the methods are awaitable coroutines.

import asyncio
from arachnid_shield_sdk import ArachnidShieldAsync as ArachnidShield

shield = ArachnidShield(username="", password="")

async def process_media(contents):

    scanned_media = await shield.scan_media_from_bytes(contents, "image/jpeg")
    if scanned_media.matches_known_image:
        print(f"harmful media found!: {scanned_media}")
    ... 


async def main():
    with open("some-image.jpeg", "rb") as f:
        contents = f.read()
    await process_media(contents)


if __name__ == '__main__':
    asyncio.get_event_loop().run_until_complete(main())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arachnid_shield_sdk-0.1.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

arachnid_shield_sdk-0.1.0-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file arachnid_shield_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: arachnid_shield_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for arachnid_shield_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 51bcdf2de378610103690dc03c84979bb7b5858a80e5c9cdcaa631c6e589c526
MD5 d4f661a02e00fef0a29e31e747424508
BLAKE2b-256 1450385cb9a14312cf2eef0417fbbc34f11ffdbdec613076d3497b4466e89bc4

See more details on using hashes here.

File details

Details for the file arachnid_shield_sdk-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for arachnid_shield_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 990252b05986f00e612c07eef477145016d748203dcc8cd004c9c22b66f3e166
MD5 1796ac3d9e69695f24819fb17d4c60a0
BLAKE2b-256 bdf8cad20b17c452145aa88392dcb818b0da07e2212b1a2381d7d57d60744f3e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page