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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file arachnid_shield_sdk-0.2.2.tar.gz.
File metadata
- Download URL: arachnid_shield_sdk-0.2.2.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.10.18 Linux/6.8.0-1030-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01f85ae99bbbf5e9091dd7679ca3a6f0da451d4119d4719ee93c66f1918edd34
|
|
| MD5 |
47a8f35bdf3078bd0dea7a08e80deb16
|
|
| BLAKE2b-256 |
dc92eba6cb4cecb028d92a72822ee423ad5cb3b6ca126cd6f8894501951c2b57
|
File details
Details for the file arachnid_shield_sdk-0.2.2-py3-none-any.whl.
File metadata
- Download URL: arachnid_shield_sdk-0.2.2-py3-none-any.whl
- Upload date:
- Size: 15.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.10.18 Linux/6.8.0-1030-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e23d5c54f49ae6897c1aafcdcf435ebbe866f1ff7e6d78cda18fa65e6629b9f
|
|
| MD5 |
2158c6beaf6430db11df697358a902b4
|
|
| BLAKE2b-256 |
becf85dbe17695f84ad0a594303d8a3d8ba4e5b13d7beaa1450264a074b4d46c
|