Skip to main content

iFixit

ifixit2zim is an openZIM scraper to create offline versions of iFixit website, in all its supported languages.

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

This scraper downloads the iFixit resources (categories, guides, ...) and puts them in a ZIM file, a clean and user friendly format for storing content for offline usage.

Usage

ifixit2zim works off a language version that you must provide via the --language argument. The list of supported languages is visible in the --help message.

Docker

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

Python

ifixit2zim is a Python3 (3.6+) 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. In addition to Python3, you also need to have an up-to-date installation of pip, setuptools and wheel as recommanded here (wheel is important since you will have to build some dependencies).

python3 -m venv .venv
source .venv/bin/activate

# using published version
pip3 install ifixit2zim
ifixit2zim --help

# running from source
pip3 install -r requirements.pip
python3 ifixit2zim/ --help

Call deactivate to quit the virtual environment.

See requirements.txt for the list of python dependencies.

Contributing

All contributions are welcome!

Please open an issue on Github and/or submit a Pull-request.

This project adheres to openZIM's Contribution Guidelines.

This project has implemented openZIM's Python bootstrap, conventions and policies v1.0.0.

Guidelines

  • Don't take assigned issues. Comment if those get staled.
  • If your contribution is far from trivial, open an issue to discuss it first.
  • Ensure your code passed black formatting, isort and flake8 (88 chars)

Create an appropriate Python environment

First time:

python3 -m venv .venv
source .venv/bin/activate
pip3 install -r requirements.pip

Next times:

source .venv/bin/activate

NOTA : there is some limitations to the execution of the underlying libzim library on MacOS with some known bugs. The main issue is that the full-text index is not working, so this shouldn't be a problem for quick tests. In doubt, execute the scraper in a Docker container as explained below.

Test the scraper in a Docker container

First, build the Docker image (to be ran in the main folder of this repo):

docker build -t local-ifixit .

Then run the scraper with CLI arguments needed for your test (everything after ifixit2zim in the example below).

For instance, if you want to run a scrape of only the Apple_PDA category, including its guides, in French :

docker run -it -v $(pwd)/output:/output --rm local-ifixit ifixit2zim --language fr --output /output --tmp-dir /tmp --category Apple_PDA

This will produce a ZIM in the output folder of your current directory.

Test the ZIM produced

To test if the ZIM produced is OK, you should run kiwix-serve, once more with Docker.

For instance, if you produced a file named ifixit_fr_selection_2022-04.zim in the output subfolder, and port 1256 is unused on your machine, you might run:

docker run -it --rm -v $(pwd)/output:/data -p 1256:80 ghcr.io/kiwix/kiwix-tools kiwix-serve /data/ifixit_fr_selection_2022-04.zim

And then navigate to (https://localhost:1256) on your favorite browser.

Once test are complete, you might stop the Docker container by pressing Ctrl-C

Metadata

Release files for ifixit2zim 0.3.1

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

Source distribution (sdist)

Source distribution for ifixit2zim 0.3.1
File Size Uploaded
ifixit2zim-0.3.1.tar.gz 998.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ifixit2zim 0.3.1
File Interpreter ABI Platform
ifixit2zim-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 2.0 MB

Release files / ifixit2zim-0.3.1.tar.gz

Download URL ifixit2zim-0.3.1.tar.gz
Size 998.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1cf5228e54a5cbfeba65b67974a3f9778cef3965b986def228c1c07c81106556
BLAKE2b-256 checksum
How to use checksums
471db18c41a8e8ba3caafeb41a6083aa288f1710c06fb2233457401587f95d5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.8

Release files / ifixit2zim-0.3.1-py3-none-any.whl

Download URL ifixit2zim-0.3.1-py3-none-any.whl
Size 1.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
24350f1bc2674b642055ff3931f9666a88fef41af5e714474cda8240440cffd6
BLAKE2b-256 checksum
How to use checksums
5e1b56f5d43c99866844a9bb1a8b50485667e9e93a7d88bb7ab44be33ed2c180
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.8

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.1

2 release files

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