Skip to main content

Help convert dynamic webistes to static ones.

Project description

Geler

Help convert dynamic websites to static ones.

Install

pip install geler-CERTIC

Usage

As a library in your own program:

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

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

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.

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 and HTTP errors.

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 or href 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
  • only patches URLs in *.html files and *.css files, not *.js files (watch out for modules import)
  • does not throttle requests
  • does not respect robots.txt or <meta name="robots" content="noindex"> or any other robot directives.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geler_certic-0.4.5.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geler_certic-0.4.5-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file geler_certic-0.4.5.tar.gz.

File metadata

  • Download URL: geler_certic-0.4.5.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.10 {"installer":{"name":"uv","version":"0.9.10"},"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}

File hashes

Hashes for geler_certic-0.4.5.tar.gz
Algorithm Hash digest
SHA256 d298a48ab3fa30faaf3a238f59d982bf3ccb3f2534310931ed97c85d161b9360
MD5 42ff42e1e172524293c346e1e2c490b8
BLAKE2b-256 026a07f106c923fe155a0b7e554a12822f4695f8904c0e18b1747baf261afc73

See more details on using hashes here.

File details

Details for the file geler_certic-0.4.5-py3-none-any.whl.

File metadata

  • Download URL: geler_certic-0.4.5-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.10 {"installer":{"name":"uv","version":"0.9.10"},"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}

File hashes

Hashes for geler_certic-0.4.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f1d34282afb9acd1d29b37914d5460207335011a461707751bcf18f31c7c6e9a
MD5 8c17ef745277dadd4aba83ca8fade8dd
BLAKE2b-256 efeecaa4ff2ac17a4c7e1f52089013a4f462dd987d994baf35912c1ebe231189

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page