Giter Site home page Giter Site logo

thedonalddon / hathitrustpdf Goto Github PK

View Code? Open in Web Editor NEW

This project forked from luiseduardobr1/hathitrustpdf

0.0 0.0 0.0 20 KB

Download an entire book (or publication) in PDF file from Hathi Trust Digital Library without "partner login" requirement

License: MIT License

Python 100.00%

hathitrustpdf's Introduction

Hathi Trust Digital Library - Complete PDF Download

Download an entire book (or publication) in PDF from Hathi Trust Digital Library without "partner login" requirement.

Motivation

Hathi Trust Digital Library is a good site to find old publications digitized from different university libraries. However, it limits the download of full PDF files to only partner universities, which are mostly american. In this sense, this code attempts to democratize knowledge and permits to download complete public domain works in PDF from Hathi Trust website.

Requirements

How to use it

Copy Hathi Trust book URL and paste into "link" variable on code line:

...
link = "https://babel.hathitrust.org/cgi/pt?id=mdp.39015023320164"
r  = requests.get(link)
...

OBS: Keep the same pattern presented (numbers at the end)!

After that, all pages will be downloaded as PDF files and merged in a single file named BOOKNAME_output.pdf in the corresponding folder. The individual pages are not deleted after the end of the process!

Slice pages

The code also allows you to remove only a range of pages. For that purpose, just edit the start and end page on code line:

...
# Download pdf file
begin_page=1
last_page=pages_book+1

for actual_page in range(begin_page, last_page):
...

Screenshot

captura-hait

hathitrustpdf's People

Contributors

luiseduardobr1 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.