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())
Metadata
Release files for arachnid-shield-sdk 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| arachnid_shield_sdk-0.2.2.tar.gz | 9.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| arachnid_shield_sdk-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.2 kB
Release files / arachnid_shield_sdk-0.2.2.tar.gz
| Download URL | arachnid_shield_sdk-0.2.2.tar.gz |
|---|---|
| Size | 9.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
01f85ae99bbbf5e9091dd7679ca3a6f0da451d4119d4719ee93c66f1918edd34
|
|
BLAKE2b-256 checksum How to use checksums |
dc92eba6cb4cecb028d92a72822ee423ad5cb3b6ca126cd6f8894501951c2b57
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.10.18 Linux/6.8.0-1030-azure
|
Release files / arachnid_shield_sdk-0.2.2-py3-none-any.whl
| Download URL | arachnid_shield_sdk-0.2.2-py3-none-any.whl |
|---|---|
| Size | 15.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0e23d5c54f49ae6897c1aafcdcf435ebbe866f1ff7e6d78cda18fa65e6629b9f
|
|
BLAKE2b-256 checksum How to use checksums |
becf85dbe17695f84ad0a594303d8a3d8ba4e5b13d7beaa1450264a074b4d46c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.10.18 Linux/6.8.0-1030-azure
|