PyAIL
PyAIL - Python library using the AIL Rest API
PyAIL is a Python library to access AIL platforms via their REST API.
Install from pip
It is strongly recommended to use a virtual environment
If you want to know more about virtual environments, python has you covered
Install pyail:
pip3 install pyail
Usage
Creating an AIL client
from pyail import PyAIL
ail_url = 'https://localhost:7000'
ail_key = '<AIL API KEY>'
try:
pyail = PyAIL(ail_url, ail_key, ssl=False)
except Exception as e:
print(e)
sys.exit(0)
pyail.ping()
Feeding items to AIL
data = 'my item content'
metadata = {}
source = '<FEEDER NAME>'
source_uuid = '<feeder UUID v4>'
pyail.feed_json_item(data, metadata, source, source_uuid)
Import Crawler capture
pyail.import_crawler_capture(capture={"last_redirected_url": "https://mywebsite.com", "html": "<html><body><h1>HELLO WORLD</h1></body></html>"})
Export chats
Export one chat, including its messages, subchannels, and threads, to a JSON file:
pyail.export_chat(
'<chat instance UUID>',
'<chat ID>',
'exports',
languages=['en', 'fr'],
)
Export every chat from an instance:
pyail.export_chat_instance(
'<chat instance UUID>',
'exports',
languages=['en', 'fr'],
)
Exports stream directly to disk and overwrite existing files. A single chat is saved as exports/<sanitized-chat-id>.json.
An instance is saved under exports/<sanitized-instance-uuid>/, with metadata.json and one file per chat in chats/. languages
can be a comma-separated string or a sequence of language tags.
License
This software is licensed under BSD 3-Clause License
Copyright (C) 2020-2026 CIRCL - Computer Incident Response Center Luxembourg
Copyright (C) 2020-2026 Aurelien Thirion
Release files for pyail 0.0.17
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyail-0.0.17.tar.gz | 11.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyail-0.0.17-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.3 kB
Release files / pyail-0.0.17.tar.gz
| Download URL | pyail-0.0.17.tar.gz |
|---|---|
| Size | 11.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bea6291fcc05d1cc619d6b709197777ac9ba74d065ac3922c109a888482d4334
|
|
BLAKE2b-256 checksum How to use checksums |
9cd6f7d8d72951b2bb366402ea55e116052211d96132561890e64bcf837be79c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.2 CPython/3.10.12 Linux/6.8.0-136-generic
|
Release files / pyail-0.0.17-py3-none-any.whl
| Download URL | pyail-0.0.17-py3-none-any.whl |
|---|---|
| Size | 12.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f2c556e97ede2c68c1aba989798e2ede86de3997e3e2b8a076ae849aca689a80
|
|
BLAKE2b-256 checksum How to use checksums |
67f3849efbc73aa04b2edcf3605b4b4811a21c2a18b3ee5b0fe9585fc6a47bf6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.2 CPython/3.10.12 Linux/6.8.0-136-generic
|