Skip to content

A Python framework to build polite, but tenacious crawlers / scrapers with a MariaDB backend


Notifications You must be signed in to change notification settings


Repository files navigation


pypi version Supported Python Versions Build Last commit Downloads Coverage

Machine Learning and other applications make it necessary to download thousands or sometimes hundreds of thousands of files.

Using a high-speed-connection carries the risk to run an involuntary denial-of-service attack on the servers that provide those files and webpages.

Exoskeleton is a Python framework that helps you build a crawler / scraper that avoids too high loads on the connection and instead runs permanently and fault tolerant to ultimately download all files.

Its main functionalities are:

  • Managing the download queue and document data within a MariaDB database.
  • Avoid processing the same URL more than once.
  • Working through the queue by either
    • downloading files to disk,
    • storing the page source code into a database table,
    • storing the page text,
    • or making PDF-copies of webpages.
  • Managing already downloaded files:
    • Storing multiple versions of a specific file.
    • Assigning labels to downloads, so they can be found and grouped easily.
  • Sending progress reports to the admin.


How To Use Exoskeleton

Example Uses

  • Downloading an Archive : A quite complex use case requiring some custom SQL. This is the actual project that triggered the development of exoskeleton.

Technical Documentation


#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging

import exoskeleton


# Create a bot
# exoskeleton makes reasonable assumptions about
# parameters left out, like:
# - host = localhost
# - port = 3306 (MariaDB standard)
# - ...
exo = exoskeleton.Exoskeleton(
    database_settings={'database': 'exoskeleton',
                       'username': 'exoskeleton',
                       'passphrase': ''},
    # True, to stop after the queue is empty, Otherwise it will
    # look consistently for new tasks in the queue:
    bot_behavior={'stop_if_queue_empty': True},

# => Will be saved in the target directory. The filename will be the
#    chosen prefix followed by the database id and .txt.

    {'example-label', 'foo'})
# => Duplicate will be recognized and not added to the queue,
#    but the labels will be associated with the file in the
#    database.

# => Nonexistent file: will be marked, but will not stop the bot.

# Save a page's code into the database:

# Use chromium or Google chrome to generate a PDF of the website:

# work through the queue: