-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Loading Production Book Data
The local developer environment comes with a small pre-loaded data set. Some developer tasks require importing more or specific records from production into their local environment. The bash script instructions below achieve this import. Before this is listed, please see the note regarding Docker Compose versions.
As of early 2023, following the installation instructions on Docker's website will install either Docker Desktop, which includes Docker Compose v2, or docker-ce
and docker-compose-plugin
(Linux only), both of which obviate the need to install docker-compose
v1 separately.
Further, Compose V1 will no longer be supported by the end of June 2023 and will be removed from Docker Desktop. These directions are written for Compose V2, hence the use of docker compose
rather than docker-compose
. docker compose
is meant to be a drop-in replacement for docker-compose
.
To see an updated document, please review Docker Instructions
docker compose exec -e PYTHONPATH=. web bash # Connect to the docker image
# Copy an author (JUST the author; no works)
./scripts/copydocs.py /authors/OL1385865A
# Outputs:
# fetching ['/authors/OL1385865A']
# saving ['/authors/OL1385865A']
# [{'key': '/authors/OL1385865A', 'revision': 1}]
# Copy a work and all its editions/authors
./scripts/copydocs.py /works/OL14906539W
# Outputs:
# fetching ['/works/OL14906539W']
# found references ['/authors/OL30714A', '/authors/OL68291A', '/authors/OL1385865A', '/authors/OL1058879A', '/authors/OL238025A']
# fetching ['/authors/OL30714A', '/authors/OL68291A', '/authors/OL1385865A', '/authors/OL1058879A', '/authors/OL238025A']
# saving ['/authors/OL30714A', '/authors/OL1058879A', '/authors/OL238025A', '/authors/OL68291A', '/authors/OL1385865A']
# [{'key': '/authors/OL30714A', 'revision': 1}, {'key': '/authors/OL1058879A', 'revision': 1}, {'key': '/authors/OL238025A', 'revision': 1}, {'key': '/authors/OL68291A', 'revision': 1}]
# saving ['/works/OL14906539W']
# [{'key': '/works/OL14906539W', 'revision': 1}]
# Copy an edition and its works/authors
./scripts/copydocs.py /books/OL24966433M
# Outputs:
# fetching ['/books/OL24966433M']
# found references ['/works/OL14906539W']
# fetching ['/works/OL14906539W']
# found references ['/authors/OL30714A', '/authors/OL68291A', '/authors/OL1385865A', '/authors/OL1058879A', '/authors/OL238025A']
# fetching ['/authors/OL30714A', '/authors/OL68291A', '/authors/OL1385865A', '/authors/OL1058879A', '/authors/OL238025A']
# saving ['/authors/OL30714A', '/authors/OL1058879A', '/authors/OL238025A', '/authors/OL68291A', '/authors/OL1385865A']
# []
# saving ['/works/OL14906539W']
# []
# saving ['/books/OL24966433M']
# [{'key': '/books/OL24966433M', 'revision': 1}]
Copydocs also supports queries:
./scripts/copydocs.py --search 'author_key:OL18053A' --search-limit 100
Covers don't quite work correctly on the local environment. To test something with covers, change coverstore_url
inside conf/openlibrary.yml
to point to the production covers (covers.openlibrary.org). Avoid uploading when this is set.
Getting Started & Contributing
- Setting up your developer environment
- Using
git
in Open Library - Finding good
First Issues
- Code Recipes
- Testing Your Code, Debugging & Performance Profiling
- Loading Production Site Data ↦ Dev Instance
- Submitting good Pull Requests
- Asking Questions on Gitter Chat
- Joining the Community Slack
- Attending Weekly Community Calls @ 9a PT
- Applying to Google Summer of Code & Fellowship Opportunities
Developer Resources
- FAQs: Frequently Asked Questions
- Front-end Guide: JS, CSS, HTML
- Internationalization
- Infogami & Data Model
- Solr Search Engine Manual
- Imports
- BookWorm / Affiliate Server
- Writing Bots
Developer Guides
- Developing the My Books & Reading Log
- Developing the Books page
- Understanding the "Read" Button
- Using cache
- Creating and Logging into New Users
- Feature Flagging
Other Portals
- Design
- Librarianship
- Communications
- Staff (internal)
Legacy
Old Getting Started
Orphaned Editions Planning
Canonical Books Page