This project is an effort to convert the online version of Urban Operations Research book (first edition, Prentice-Hall © 1981) into a more readable ebook format (EPUB). This book is one of my favorites since I read it during my graduate school. Unfortunately, it's out of print and used copies are being sold at exorbitant prices. I thought it should be a nice exercise to scrape the online book and convert it into an EPUB that I can enjoy again.
To produce the EPUB book, install dependencies and then run the following:
git clone https://github.com/rmahfoud/UrbanOperationsResearchBook.git
cd UrbanOperationsResearchBook
bin/run.py
The EPUB book will appear in /tmp/uor/uor.epub
for you to enjoy on your favorite e-reader.
The settings (including file paths) are defined in UrbanOperationsResearchBook/settings.py
.
These scripts do not cleanup after themselves (yet). You need to manually delete output directory /tmp/uor
to cleanup.
The generated EPUB was validated using the online EPUB Validator (beta) tool.
It was also visually inspected with:
- calibre on the desktop (Ubuntu and Windows).
- Moon+ Reader Pro on an Android phone.
- Kinldle: after conversion using calibre to
.mobi
it loaded fine in Kindle. Sections are interrupted by blank pages that I'm not sure where they come from (possibly due to use of<table>
in layout). On my phone the quality of the text with inline images seems to suffer but on the tablet rendering looks fine.
Please report any additional issues in the EPUB on github.
The following are issues I found with the book as it's currently present online:
- The URL of Prof Odoni's home page leads nowhere. I linked to his new profile page
- The URL of Prof Larson's home page leads nowhere. I linked to his new profile page
- Section 4.8.1: Why Are M/G/m, G/G/1, and G/G/m Difficult? is missing
- Table 6-12 in section 6.5.7 is missing
- Its HTML in general is not of modern quality and does not translate directly to XHTML
While doing the conversion I ignored many of the warnings/errors due to non-canonical XHTML because it turns out most good readers do not require canonical XHTML and will work and render pages just fine. I ended up doing the bare-minimum required translations. Some things you might encounter (and might want to submit fixes for) if you use a reader that doesn't entirely like the current XHTML:
- The use of the
<center>
tag which is disallowed - The use of the
<font>
tag which is disallowed - The use of inline styles (e.g.
<table cellpadding="5">
, or<p align="center">
) instead of CSS
On Ubuntu/Debian, run the following:
sudo apt-get install libffi-dev libssl-dev build-essential \
g++-4.4 libboost-all-dev libsparsehash-dev \
git-core perl ipython
or equivalent on non-Debian systems.
Then install the following python dependencies:
sudo pip install cryptography
sudo pip install scrapy
- Add images to manifest in OPF file
- Remove use of
<font>
tag - Remove use of
<center>
tag - Remove inline style and replace with CSS
These scripts and resulting EPUB are for personal enjoyment only. Please respect the copyright owners of the original book and do not distribute the ebook that's produced by these scripts.
This software is released under the MIT license.