# HathiTrust Downloader
[![PyPI](https://img.shields.io/pypi/v/hathitrust-downloader?style=flat-square&logo=pypi)][pypi]
[![PyPI - Downloads](https://img.shields.io/pypi/dm/hathitrust-downloader?logo=pypi&style=flat-square)][pypi]
[![GitHub version](https://img.shields.io/github/release/Addono/HathiTrust-downloader.svg?style=flat-square&logo=github)][github-releases]
[![GitHub download](https://img.shields.io/github/downloads/Addono/HathiTrust-downloader/total.svg?style=flat-square&logo=github)][github-releases]
[![GitHub stars](https://img.shields.io/github/stars/Addono/HathiTrust-downloader?style=flat-square)](https://github.com/Addono/HathiTrust-downloader/stargazers)
[![License](https://img.shields.io/github/license/Addono/HathiTrust-downloader.svg?style=flat-square)](LICENSE)
## Installing
### Python 3 (OS Agnostic)
Check that you have Python 3 installed and available on your shell. The following command should return something like `Python 3.12.5`.
```bash
python -V
```
> Windows users: Make sure to enable the "Add to PATH" option when installing Python.
Now you can install using `pip` with the following command.
```bash
pip install hathitrust-downloader
```
Which allows you to interact with the downloader from the command line:
```bash
hathitrust-downloader --help
```
### Windows Executable
There are also Windows executables available. Download the `downloader.zip` from [releases](https://github.com/Addono/HathiTrust-downloader/releases/) and extract it. Then open a shell, e.g. `cmd` or `powershell`, to the directory where the ZIP is extracted. The easiest way to do this is by opening the folder in Explorer and right click while holding shift, now select the option "Open PowerShell Window Here".
The executable is bundled with Python and all other dependencies, hence you do not need to have anything installed. Now the tool can be used like:
```powershell
.\downloader.exe --help
```
## Usage
The help should give some instructions on how to use the tool:
```bash
usage: hathitrust-downloader [-h] [--name NAME] id start_page end_page
Book downloader for HathiTrust
positional arguments:
id The ID of the book, e.g 'mdp.39015027794331'.
start_page The page number of the first page to be downloaded.
end_page The last number of the last page to be downloaded (inclusive).
options:
-h, --help show this help message and exit
--name NAME The start of the filename. Defaults to using the id. This can also be used to change the path.
```
For example, the following command will download page 1 until (and including) 10 of the book with id `mdp.39015073487137` and naming the files output files `my-book_page_<page_number>.pdf`:
```bash
hathitrust-downloader mdp.39015073487137 1 10 --name my-book
```
> [!IMPORTANT]
> The ID of the file can be found as part of the URL when opening a book through your browser. Below is an example URL and where to find the ID:
> ```
> https://babel.hathitrust.org/cgi/pt?id=mdp.39015073487137&seq=13
> ^^^^^^^^^^^^^^^^^^ This demarks the ID of this book
> ```
## Troubleshooting
### No Progess / Progress Bar is Stuck
Make sure that you can access books on HathiTrust. Try to open a book in your browser to see if everything is working fine. HathiTrust can require you to connect from an American IP. In addition, they limit the amount of pages you can download to 15 every 5 minutes. When you hit that limit you will need to wait, the tool will automatically wait and resume when the timeout is finished.
[pypi]: https://pypi.org/project/hathitrust-downloader/
[github-releases]: https://github.com/Addono/HathiTrust-downloader/releases/latest
## Developing
Clone the repository:
```bash
git clone https://github.com/Addono/HathiTrust-downloader.git
cd ./HathiTrust-downloader
```
(Optional) Create a virtual Python environment, recommended but not required.
Install the package with dependencies:
```
pip install .
```
Now you can run the tool with:
```bash
python -m hathitrustdownloader.cli --help
```
Raw data
{
"_id": null,
"home_page": "http://github.com/addono/hathitrust-downloader",
"name": "hathitrust-downloader",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "hathitrust download downloader cli",
"author": "Adriaan Knapen",
"author_email": "hi@aknapen.nl",
"download_url": "https://files.pythonhosted.org/packages/a7/33/4549b7e7a6f28342e0660de5faa321fe212bb6b9a0710b625fe7f38d463b/hathitrust-downloader-1.2.1.tar.gz",
"platform": null,
"description": "# HathiTrust Downloader\n[![PyPI](https://img.shields.io/pypi/v/hathitrust-downloader?style=flat-square&logo=pypi)][pypi]\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/hathitrust-downloader?logo=pypi&style=flat-square)][pypi]\n[![GitHub version](https://img.shields.io/github/release/Addono/HathiTrust-downloader.svg?style=flat-square&logo=github)][github-releases]\n[![GitHub download](https://img.shields.io/github/downloads/Addono/HathiTrust-downloader/total.svg?style=flat-square&logo=github)][github-releases]\n[![GitHub stars](https://img.shields.io/github/stars/Addono/HathiTrust-downloader?style=flat-square)](https://github.com/Addono/HathiTrust-downloader/stargazers)\n[![License](https://img.shields.io/github/license/Addono/HathiTrust-downloader.svg?style=flat-square)](LICENSE)\n\n## Installing\n\n### Python 3 (OS Agnostic)\n\nCheck that you have Python 3 installed and available on your shell. The following command should return something like `Python 3.12.5`. \n\n```bash\npython -V\n```\n\n> Windows users: Make sure to enable the \"Add to PATH\" option when installing Python.\n\nNow you can install using `pip` with the following command.\n\n```bash\npip install hathitrust-downloader\n```\n\nWhich allows you to interact with the downloader from the command line:\n\n```bash\nhathitrust-downloader --help\n```\n\n### Windows Executable\n\nThere are also Windows executables available. Download the `downloader.zip` from [releases](https://github.com/Addono/HathiTrust-downloader/releases/) and extract it. Then open a shell, e.g. `cmd` or `powershell`, to the directory where the ZIP is extracted. The easiest way to do this is by opening the folder in Explorer and right click while holding shift, now select the option \"Open PowerShell Window Here\".\n\nThe executable is bundled with Python and all other dependencies, hence you do not need to have anything installed. Now the tool can be used like:\n\n```powershell\n.\\downloader.exe --help \n```\n\n## Usage\n\nThe help should give some instructions on how to use the tool:\n\n```bash\nusage: hathitrust-downloader [-h] [--name NAME] id start_page end_page\n\nBook downloader for HathiTrust\n\npositional arguments:\n id The ID of the book, e.g 'mdp.39015027794331'.\n start_page The page number of the first page to be downloaded.\n end_page The last number of the last page to be downloaded (inclusive).\n\noptions:\n -h, --help show this help message and exit\n --name NAME The start of the filename. Defaults to using the id. This can also be used to change the path.\n```\n\nFor example, the following command will download page 1 until (and including) 10 of the book with id `mdp.39015073487137` and naming the files output files `my-book_page_<page_number>.pdf`:\n\n```bash\nhathitrust-downloader mdp.39015073487137 1 10 --name my-book\n```\n\n> [!IMPORTANT]\n> The ID of the file can be found as part of the URL when opening a book through your browser. Below is an example URL and where to find the ID:\n> ```\n> https://babel.hathitrust.org/cgi/pt?id=mdp.39015073487137&seq=13\n> ^^^^^^^^^^^^^^^^^^ This demarks the ID of this book\n> ```\n\n## Troubleshooting\n\n### No Progess / Progress Bar is Stuck\n\nMake sure that you can access books on HathiTrust. Try to open a book in your browser to see if everything is working fine. HathiTrust can require you to connect from an American IP. In addition, they limit the amount of pages you can download to 15 every 5 minutes. When you hit that limit you will need to wait, the tool will automatically wait and resume when the timeout is finished.\n\n[pypi]: https://pypi.org/project/hathitrust-downloader/\n[github-releases]: https://github.com/Addono/HathiTrust-downloader/releases/latest\n\n## Developing\n\nClone the repository:\n\n```bash\ngit clone https://github.com/Addono/HathiTrust-downloader.git\ncd ./HathiTrust-downloader\n```\n\n(Optional) Create a virtual Python environment, recommended but not required.\n\nInstall the package with dependencies:\n```\npip install .\n```\n\nNow you can run the tool with:\n\n```bash\npython -m hathitrustdownloader.cli --help\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Downloads multiple pages from Hathitrust from the CLI.",
"version": "1.2.1",
"project_urls": {
"Homepage": "http://github.com/addono/hathitrust-downloader"
},
"split_keywords": [
"hathitrust",
"download",
"downloader",
"cli"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "aad1ac85117aee3eee17bf285dca3d545fe6ffaf4deac303469030b76572200e",
"md5": "98b308a3caa81635578dce0071902cbf",
"sha256": "14bf19393ad5cb06284b94beccd675700a3e812d3ead4814786507525b21476c"
},
"downloads": -1,
"filename": "hathitrust_downloader-1.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "98b308a3caa81635578dce0071902cbf",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 5554,
"upload_time": "2024-08-21T17:24:57",
"upload_time_iso_8601": "2024-08-21T17:24:57.535298Z",
"url": "https://files.pythonhosted.org/packages/aa/d1/ac85117aee3eee17bf285dca3d545fe6ffaf4deac303469030b76572200e/hathitrust_downloader-1.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a7334549b7e7a6f28342e0660de5faa321fe212bb6b9a0710b625fe7f38d463b",
"md5": "9d1becd1394ab0807e14ac168ceb052e",
"sha256": "fa8919aa23336a473fed94b220fd4ccf217f141a5f0c36c40007ee5a54feff93"
},
"downloads": -1,
"filename": "hathitrust-downloader-1.2.1.tar.gz",
"has_sig": false,
"md5_digest": "9d1becd1394ab0807e14ac168ceb052e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 4876,
"upload_time": "2024-08-21T17:24:58",
"upload_time_iso_8601": "2024-08-21T17:24:58.565531Z",
"url": "https://files.pythonhosted.org/packages/a7/33/4549b7e7a6f28342e0660de5faa321fe212bb6b9a0710b625fe7f38d463b/hathitrust-downloader-1.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-21 17:24:58",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "addono",
"github_project": "hathitrust-downloader",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "hathitrust-downloader"
}