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

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.18
File Size Uploaded
pyail-0.0.18.tar.gz 11.9 kB Details

Built distribution (wheel)

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

Total release size: 24.8 kB

Release files / pyail-0.0.18.tar.gz

Download URL pyail-0.0.18.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
121249bf590b1240fb44d59be8fc651ac085ff4e97bad05876b4e58b994240aa
BLAKE2b-256 checksum
How to use checksums
7ed13de473d3e4c77007d0d3a62423c5b58ac63627b96d903b7237ab815f51f0
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.18-py3-none-any.whl

Download URL pyail-0.0.18-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
888160afaacc5de48924a3e5d082ad23ae87b2a9fcd270cf526c427e1d930a7b
BLAKE2b-256 checksum
How to use checksums
e604870c61a6596af73713856411e6ce9c8c7eb0dd5213d7ec4e30618681815d
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

0.0.19

2 release files

This release

0.0.18 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