Skip to main content

Geler

Help convert dynamic websites to static ones.

Install

Requires Python 3.10 or newer.

=> dans un venv

pip install geler-CERTIC

=> de manière isolée et indépendante (mais disponible globalement)

pipx install geler-CERTIC

Usage

As a library in your own program:

import geler

def main():
    freezer = geler.Freezer(
        "https://acme.tld/",
        "/save/to/path/",
        thread_pool_size=10,
        http_get_timeout=30,
        skip_extensions=[".mp4", ".mp3"],
    )
    freezer.freeze()

    for err in freezer.http_errors:
        print(f'{err.get("status_code")}: {err.get("url")}')

if __name__ == "__main__":
    main()

The main guard is required in scripts because link patching starts worker processes using spawn. Run library code from an importable Python script; interactive shells and notebooks do not support this process-pool setup.

As a CLI tool:

$> geler --help
usage: geler [-h] [-t THREAD_POOL_SIZE] [--http-get-timeout HTTP_GET_TIMEOUT] [-s SKIP_EXTENSIONS] [-v] start-from-url save-to-path

positional arguments:
  start-from-url        -
  save-to-path          -

optional arguments:
  -h, --help            show this help message and exit
  -t THREAD_POOL_SIZE, --thread-pool-size THREAD_POOL_SIZE
                        1
  --http-get-timeout HTTP_GET_TIMEOUT
                        30
  -s SKIP_EXTENSIONS, --skip-extensions SKIP_EXTENSIONS
                        -
  -v, --verbose         False

Thread pool size (--thread-pool-size) defaults to 1. Increase the number to have multiple downloads in parallel.

HTML/CSS/JavaScript parsing uses 10 processes by default while HTTP downloads remain threaded. Set --parse-process-pool-size to change the process count; use 0 to parse in download threads. For example:

geler --thread-pool-size 10 https://acme.tld/ /path/to/local/dir

The library default is Freezer(..., parse_process_pool_size=10). Process workers return normalized content and discovered URLs. The parent process validates and schedules URLs, writes files, and updates the checkpoint. At most twice the parsing worker count of response bodies can be queued or parsing; download threads wait for a slot before buffering another text response. Binary files bypass the parsing pool. Workers start only when a text response arrives, including during a dry run. The parsing pool shuts down before final patching, so the two process pools do not run together.

Callbacks stay in the parent process. An HTML callback_before_save still receives an editable BeautifulSoup tree; with process parsing, rebuilding that tree in the parent adds overhead. This also applies to the CLI's verbose save callback. Parser failures are checkpointed as failed downloads and retried by --resume; changing parsing worker counts does not invalidate a checkpoint. On interruption, queued parses are cancelled and running parses are drained; uncommitted results remain pending for resume.

Process parsing helps when parsing consumes substantial CPU time; it adds startup and data-transfer overhead for smaller sites. See the download/parsing benchmark for measured results.

After downloading, link patching uses a separate process pool with up to 10 workers, capped by the CPU count and number of files. Each process receives the URL mapping once. callback_after_patch runs in the calling process, once per completed file, in completion order. Worker errors propagate to the caller. Dry runs do not start patch worker processes.

See the synthetic patching benchmark for reproducible measurements, including process-startup overhead on small workloads.

HTTP get timeout (--http-get-timeout) default to 30s. This includes the time needed to download the file. Increase the number to increase the timeout, or set it to 0 for no timeout.

List of skipped (--skip-extensions) is a comma-separated list of extensions that won't be downloaded.

Verbose mode (--verbose) will show downloaded URLs, a patch <path> trace after each file is patched, and HTTP errors.

Every non-dry run stores its crawl progress in .geler-state.sqlite3 inside the destination directory. If a crawl is interrupted, resume it with the same URL, destination, and skipped extensions:

geler --resume https://acme.tld/ /path/to/local/dir

Resume retries interrupted and failed downloads, skips files that were completed, and patches links again when the crawl finishes. Patch writes use a temporary .part file and atomic replacement, so interrupted writes leave the downloaded file intact; resume removes stale temporary files. Ctrl+C during patching cancels pending jobs and waits for active patch workers before returning. A run without --resume starts a new checkpoint. Geler refuses to resume if the root URL or skipped extensions do not match the checkpoint. Dry runs do not create checkpoints and cannot be resumed.

Complete example:

geler --http-get-timeout 30 --thread-pool-size 10 --skip-extension ".mp4,.zip" https://acme.tld/ /path/to/local/dir

Why ?

For MaX and associated tools, we needed a lightweight, portable, pure Python solution to convert small dynamic websites to static ones.

Alternatives

This tool has a narrow scope, on purpose. Please turn to these solutions if you need more:

Known Limitations

  • only works with HTTP GET
  • does not submit forms (even with GET method)
  • only considers URLs in src, href, or URL-like JavaScript string literals in onclick attributes
  • only considers URLs with http or https schemes
  • only downloads what is in the same netloc (same domain, same port) as the start URL
  • patches URLs in *.html, *.css and JavaScript module imports in *.js files, but does not parse arbitrary JS URL construction patterns
  • does not throttle requests
  • does not respect robots.txt or <meta name="robots" content="noindex"> or any other robot directives.

Metadata

Release files for geler-CERTIC 0.7.0

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

Source distribution (sdist)

Source distribution for geler-CERTIC 0.7.0
File Size Uploaded Provenance Actions
geler_certic-0.7.0.tar.gz 35.6 kB Without provenance Details for geler_certic-0.7.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for geler-CERTIC 0.7.0
File Interpreter ABI Platform Actions
geler_certic-0.7.0-py3-none-any.whl Python 3 none any Details for geler_certic-0.7.0-py3-none-any.whl

Total release size: 58.6 kB

Release files / geler_certic-0.7.0.tar.gz

Download URL geler_certic-0.7.0.tar.gz
Size 35.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6ef1a81faec268345a1d2da7d4dfa8d2d91e064f29087946c59e76a1968766bc
BLAKE2b-256 checksum
How to use checksums
d4baf9cbee8784e64da009e8ffeeb445299086acc1953f87c308edd79a71fcc6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / geler_certic-0.7.0-py3-none-any.whl

Download URL geler_certic-0.7.0-py3-none-any.whl
Size 23.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c287fd9eab9d7b42e7836547ed4818404b46a43c90237647e47832793dec82ae
BLAKE2b-256 checksum
How to use checksums
80b1bd89f67a796e033caa3f6d3ae962864e59b3c041b018f2e9e65172c43be6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for geler-CERTIC 0.7.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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