{"id":19794201,"url":"https://github.com/openzim/gutenberg","last_synced_at":"2025-04-04T09:08:14.449Z","repository":{"id":18453637,"uuid":"21647271","full_name":"openzim/gutenberg","owner":"openzim","description":"Scraper for downloading the entire ebooks repository of project Gutenberg","archived":false,"fork":false,"pushed_at":"2025-03-27T23:15:03.000Z","size":130769,"stargazers_count":144,"open_issues_count":36,"forks_count":45,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-03-28T08:06:43.697Z","etag":null,"topics":["gutenberg","offline","scraper","zim"],"latest_commit_sha":null,"homepage":"https://download.kiwix.org/zim/gutenberg","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openzim.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"kiwix","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2014-07-09T09:45:46.000Z","updated_at":"2025-03-25T10:04:33.000Z","dependencies_parsed_at":"2024-01-17T15:11:59.508Z","dependency_job_id":"95a5e3ed-2a0b-45be-a1cf-7b6414387c1b","html_url":"https://github.com/openzim/gutenberg","commit_stats":{"total_commits":747,"total_committers":23,"mean_commits":32.47826086956522,"dds":0.7041499330655957,"last_synced_commit":"cf43ffd850dbabf03a48d413aadb3374a1fb00ab"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openzim%2Fgutenberg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openzim%2Fgutenberg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openzim%2Fgutenberg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openzim%2Fgutenberg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openzim","download_url":"https://codeload.github.com/openzim/gutenberg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247149501,"owners_count":20891954,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gutenberg","offline","scraper","zim"],"created_at":"2024-11-12T07:12:30.327Z","updated_at":"2025-04-04T09:08:14.432Z","avatar_url":"https://github.com/openzim.png","language":"Python","funding_links":["https://github.com/sponsors/kiwix"],"categories":[],"sub_categories":[],"readme":"# Gutenberg Offline\nThis scraper downloads the whole [Project\nGutenberg](https://www.gutenberg.org) library and puts it in a\n[ZIM](https://openzim.org) file, a clean and user friendly format for\nstoring content for offline usage.\n\n[![CodeFactor](https://www.codefactor.io/repository/github/openzim/gutenberg/badge)](https://www.codefactor.io/repository/github/openzim/gutenberg)\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n[![codecov](https://codecov.io/gh/openzim/gutenberg/branch/main/graph/badge.svg)](https://codecov.io/gh/openzim/gutenberg)\n[![PyPI version shields.io](https://img.shields.io/pypi/v/gutenberg2zim.svg)](https://pypi.org/project/gutenberg2zim/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/gutenberg2zim.svg)](https://pypi.org/project/gutenberg2zim/)\n[![Docker](https://ghcr-badge.egpl.dev/openzim/gutenberg/latest_tag?label=docker)](https://ghcr.io/openzim/gutenberg)\n\n\u003e [!WARNING]  \n\u003e This scraper is now known to have a serious flaw. A critical bug https://github.com/openzim/gutenberg/issues/219 has been discovered which leads to incomplete archives. Work on https://github.com/openzim/gutenberg/issues/97 (complete rewrite of the scraper logic) now seems mandatory to fix these annoying problems. We however currently miss the necessary bandwidth to address these changes. Help is of course welcomed, but be warned this is going to be a significant project (at least 10 man.days to change the scraper logic so that we can fix the issue I would say, so probably the double since human is always bad at estimations).\n\n## Getting Started\n\nThe recommended way to run the Gutenberg scraper is using Docker, as it comes with all required dependencies pre-installed.\n\n### Running with Docker\n\n1. **Run the scraper with Docker**:\n\n```bash\ndocker run -it --rm -v $(pwd)/output:/output ghcr.io/openzim/gutenberg:latest gutenberg2zim\n```\n\nThe `-v $(pwd)/output:/output` option mounts the `output` folder in your current directory to the `/output` folder inside the container (which is the working directory). This ensures that the ZIM file is saved to your local machine.\n\n2. **Show available options**:\n\nTo view all the available options for `gutenberg2zim`, run:\n\n```bash\ndocker run ghcr.io/openzim/gutenberg:latest gutenberg2zim --help\n```\n\n\n### Arguments\n\nCustomize the content download with the following options. For example, to download books in English or French with IDs 100 to 200 and only in PDF format:\n\n```bash\ndocker run -it --rm -v $(pwd)/output:/output ghcr.io/openzim/gutenberg:latest gutenberg2zim -l en,fr -f pdf --books 100-200 --bookshelves --title-search\n```\n\nThis will download books in English and French that have the Id 100 to\n200 in the HTML (default) and PDF format.\nThe -it flags allow you to see progress.\nThe --rm flag removes the container after completion.\n\nYou can find the full arguments list below:\n\n```bash\n-h --help                       Display this help message\n-y --wipe-db                    Empty cached book metadata\n-F --force                      Redo step even if target already exist\n\n-l --languages=\u003clist\u003e           Comma-separated list of lang codes to filter export to (preferably ISO 639-1, else ISO 639-3)\n-f --formats=\u003clist\u003e             Comma-separated list of formats to filter export to (epub, html, pdf, all)\n\n-e --static-folder=\u003cfolder\u003e     Use-as/Write-to this folder static HTML\n-z --zim-file=\u003cfile\u003e            Write ZIM into this file path\n-t --zim-title=\u003ctitle\u003e          Set ZIM title\n-n --zim-desc=\u003cdescription\u003e     Set ZIM description\n-d --dl-folder=\u003cfolder\u003e         Folder to use/write-to downloaded ebooks\n-u --rdf-url=\u003curl\u003e              Alternative rdf-files.tar.bz2 URL\n-b --books=\u003cids\u003e                Execute the processes for specific books, separated by commas, or dashes for intervals\n-c --concurrency=\u003cnb\u003e           Number of concurrent process for processing tasks\n--dlc=\u003cnb\u003e                      Number of concurrent *download* process for download (overwrites --concurrency). if server blocks high rate requests\n-m --one-language-one-zim=\u003cfolder\u003e When more than 1 language, do one zim for each   language (and one with all)\n--no-index                      Do NOT create full-text index within ZIM file\n--check                         Check dependencies\n--prepare                       Download rdf-files.tar.bz2\n--parse                         Parse all RDF files and fill-up the DB\n--download                      Download ebooks based on filters\n--zim                           Create a ZIM file\n--title-search                  Add field to search a book by title and directly jump to it\n--bookshelves                   Add bookshelves\n--optimization-cache=\u003curl\u003e      URL with credentials to S3 bucket for using as optimization cache\n--use-any-optimized-version     Try to use any optimized version found on optimization cache\n```\n\n\n## Contributing Code\n\nMain coding guidelines are from the [openZIM Wiki](https://github.com/openzim/overview/wiki).\n\n### Setting Up the Environment\n\nHere we will setup everything needed to run the source version from your machine, supposing you want to modify it. If you simply want to run the tool, you should either install the PyPi package or use the Docker image. Docker image can also be used for development but needs a bit of tweaking for live reload of your code modifications.\n\n### Install the dependencies\n\nFirst, ensure you use the proper Python version, inline with the requirement of `pyproject.toml` (you might for instance use `pyenv` to manage multiple Python versions in parallel).\n\nYou then need to install the various tools/libraries needed by the scraper.\n\n\nThe setup is divided into two categories: one for simply running the scraper and another for setting up a development environment for contributing and making improvements\n\n**For Users Running the Scraper**:\n\n### GNU/Linux \n```\nsudo apt update \u0026\u0026 sudo apt install -y python3-pip p7zip-full zip zim-tools curl jpegoptim pngquant\n```\n### Fedora \n```\nsudo dnf install -y python3-pip jpegoptim pngquant p7zip curl zip zim-tools\n```\n### Arch linux \n```\nsudo pacman -S python-pip libxml2 jpegoptim pngquant p7zip curl zip zim-tools\n```\n#### macOS\n```\nbrew install jpegoptim pngquant p7zip curl zip zim-tools\n```\n**For Developers Contributing \u0026 Modifying**;\n\n#### GNU/Linux\n\n```\nsudo apt update \u0026\u0026 sudo apt install -y python3-pip libxml2-dev libxslt-dev jpegoptim pngquant p7zip-full curl zip zim-tools\n```\n### Fedora \n```\nsudo dnf install -y python3-pip libxml2-devel libxslt-devel jpegoptim pngquant p7zip curl zip zim-tools\n```\n### Arch linux \n```\nsudo pacman -S python-pip libxml2 libxslt jpegoptim pngquant p7zip curl zip zim-tools\n```\n#### macOS\n```\nbrew install libxml2 libxslt jpegoptim pngquant p7zip curl zip zim-tools\n```\n\n\n### Setup the package\n\nFirst, clone this repository.\n\n```bash\ngit clone git@github.com:openzim/gutenberg.git\ncd gutenberg\n```\n\nIf you do not already have it on your system, install `hatch` to build the software and manage virtual environments (you might be interested by our detailed [Developer Setup](https://github.com/openzim/_python-bootstrap/blob/main/docs/Developer-Setup.md) as well).\n\n```bash\npip3 install hatch\n```\n\nStart a hatch shell: this will install software including dependencies in an isolated virtual environment.\n\n```bash\nhatch shell\n```\n\nThat's it. You can now run `gutenberg2zim` from your terminal.\n\n\n## Screenshots\n\n![](https://raw.githubusercontent.com/openzim/gutenberg/main/pictures/screenshot_1.png)\n![](https://raw.githubusercontent.com/openzim/gutenberg/main/pictures/screenshot_2.png)\n\n## License\n\n[GPLv3](https://www.gnu.org/licenses/gpl-3.0) or later, see\n[LICENSE](LICENSE) for more details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenzim%2Fgutenberg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenzim%2Fgutenberg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenzim%2Fgutenberg/lists"}