Skip to main content

Turn StackExchange dumps into ZIM files for offline usage

Project description

Sotoki

Sotoki (Stack Overflow to Kiwix) is an openZIM scraper to create offline versions of Stack Exchange websites such as Stack Overflow.

It is based on Stack Exchange's Data Dumps hosted by The Internet Archive.

CodeFactor Docker License: GPL v3 PyPI version shields.io PyPI - Python Version

Usage

Sotoki works off a dump of a StackExchange website, as regularly created by StackExchange team. You must provide a --mirror to use to download this dump and the --domain you want to scrape.

For instance, to download Sports StackExchange website as of August 2024 and based on dump hosted on archive.org, you have to use --mirror https://archive.org/download/stackexchange_20240829 --domain sports.stackexchange.com. Value of mirror is hence continuously updated as new dumps are published by StackExchange team.

Other CLI parameters are mandatory:

  • --title: ZIM title, must be less than 30 chars. E.g. Gardening and Landscaping
  • --description: ZIM description, must be less than 80 chars

Docker

docker run -v my_dir:/output ghcr.io/openzim/sotoki sotoki --help

Installation

sotoki is a Python3 software. If you are not using the Docker image, you are advised to use it in a virtual environment to avoid installing software dependencies on your system.

python3 -m venv ./env  # creates a virtual python environment in ./env folder
./env/bin/pip install -U pip  # upgrade pip (package manager). recommended
./env/bin/pip install -U sotoki  # install/upgrade sotoki inside virtualenv

# direct access to in-virtualenv sotoki binary, without shell-attachment
./env/bin/sotoki --help
# alias or link it for convenience
sudo ln -s $(pwd)/env/bin/sotoki /usr/local/bin/

# alternatively, attach virtualenv to shell
source env/bin/activate
sotoki --help
deactivate  # unloads virtualenv from shell

Developers

Anybody is welcome to improve the Sotoki.

See CONTRIBUTING.md for setup instructions, code style guidelines, and changelog requirements.

Users

You don't have to make your own ZIM files of Stack Exchange's Web sites. Updated ZIM files are built on a regular basis for all of them. Look at https://library.kiwix.org/?category=stack_exchange to download them.

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

sotoki-3.1.0.tar.gz (93.9 kB view details)

Uploaded Source

Built Distribution

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

sotoki-3.1.0-py3-none-any.whl (96.2 kB view details)

Uploaded Python 3

File details

Details for the file sotoki-3.1.0.tar.gz.

File metadata

  • Download URL: sotoki-3.1.0.tar.gz
  • Upload date:
  • Size: 93.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sotoki-3.1.0.tar.gz
Algorithm Hash digest
SHA256 fb10af5d740482c3451684b8fe1f5838c5abf193e4ce889677a963da31fbfaaf
MD5 abe8047f4c304e8aae70f9f79d18c1f9
BLAKE2b-256 819132320839cd5f630d955d4247240e7bf94f0fec200aac3b23598ba2d934c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for sotoki-3.1.0.tar.gz:

Publisher: Publish.yml on openzim/sotoki

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sotoki-3.1.0-py3-none-any.whl.

File metadata

  • Download URL: sotoki-3.1.0-py3-none-any.whl
  • Upload date:
  • Size: 96.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sotoki-3.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8e8a045a82ede77fc7cd4d331dc149266955d7198c6790127fd8c2c92a92fa9e
MD5 34600ca22ef1bf86509ebf352e530721
BLAKE2b-256 c5dbeaf5a1a6374bc4fb93940cee63831bf2cfb5b57fc6920f995db1af0b843a

See more details on using hashes here.

Provenance

The following attestation bundles were made for sotoki-3.1.0-py3-none-any.whl:

Publisher: Publish.yml on openzim/sotoki

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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