Open library publishes dumps of their database at https://openlibrary.org/developers/dumps
This python package provides tools to parse these dumps and store them into a database you can then query.
Postgresql and sqlite databases are supported.
It can load data from a compressed dump file.
Example usage:
ol-populate-pg ../db/ol_dump_latest.txt.gz sqlite:////tmp/oldata.db