Skip to main content

PyAIL

Python 3.6

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()

Proxy authentication

For a reverse proxy using HTTP Basic authentication:

from requests.auth import HTTPBasicAuth

pyail = PyAIL(
    'https://example.org/ail',
    '<AIL API KEY>',
    auth=HTTPBasicAuth('<PROXY USERNAME>', '<PROXY PASSWORD>'),
)

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.19

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

Source distribution (sdist)

Source distribution for pyail 0.0.19
File Size Uploaded
pyail-0.0.19.tar.gz 11.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyail 0.0.19
File Interpreter ABI Platform
pyail-0.0.19-py3-none-any.whl Python 3 none any Details

Total release size: 24.8 kB

Release files / pyail-0.0.19.tar.gz

Download URL pyail-0.0.19.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9edc69944934b39c9f86f35de4484c6418ee1cb217f3a06efef67e9e1204e479
BLAKE2b-256 checksum
How to use checksums
be517d8dbc90315c675336f265704685e234181e163ecd539e80c96d0c86485b
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.19-py3-none-any.whl

Download URL pyail-0.0.19-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4e9b1ad5a8512121c39a8664273254e612b26a4cb6c4ce69ca80343919729c05
BLAKE2b-256 checksum
How to use checksums
520bbfc90b5d46e0f94440cf54c506b99ce373ce487309ec6105b138aeab33a7
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 history Release notifications | RSS feed

This release

0.0.19 This release

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.1

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