Pierre Squarra


zimpy: Self hosted wikipedia

zimpy: Personal Wikipedia Hosting

GitHub Repository

zimpy enables you to host Wikipedia content locally through a simplified Flask webserver. It is designed to be used with ZIM files, which are offline Wikipedia archives. This project is built for my specific use case and is not designed for broad compatibility. If your ZIM file structure diverges from the one used here, or if you are utilizing a different Python version, the project may not function as intended. For a more versatile ZIM file reader, please refer to ZIMply.

Table of Contents

Features

Getting Started

Prerequisites

Installation

  1. Clone the repo:
git clone https://github.com/squarra/zimpy
  1. Navigate to the project directory and install the dependencies:
cd zimpy
pip install -r requirements.txt

Usage

  1. Ensure you have a ZIM file for the Wikipedia content you intend to display.
  2. Run the server script:
python main.py
  1. The database is then populated with the contents of the ZIM file. This may take a few minutes.
  2. Access the hosted content by navigating to 127.0.0.1:5000 in your web browser.

Custom Templates

You can modify the default template in templates/base.html or provide a new template as an argument to ZIMServer. Ensure that custom templates are placed in the templates directory.

from zimpy import ZIMServer

server = ZIMServer("wiki.zim", "your_custom_template.html")
server.app.run()

License

Distributed under the GNU General Public License v3.0. See LICENSE for more information.

Acknowledgements