This is a small Jupyter notebook that shows how to use the Library of Congress's JSON API using Python. It demonstrates the following:
- Doing a basic API search
- Paginating through results
- Downloading, processing, and displaying images
If using locally, you will need to install the required Python libraries to use these notebooks: pip install -r requirements.txt
View the notebook online here: https://beefoo.github.io/loc-json-api-demo/
This repository is also an example of how to build and deploy a notebook on GitHub Pages using GitHub Actions. It roughly follows the recommended workflow for automatically host your book with GitHub Actions.
The key file to have is the workflow file which can be found in .github/workflows/main.yml. So when you push to the main branch on Github, it should automatically build your Jupyter notebook to the gh-pages
branch that you can associated with Github Pages.
- Ensure you update your Personal Access Token with the
workflow
scope enabled in GitHub, or create a new one, and configure your git client to use that. - Also on your Github project settings page, go to
Settings -> Actions -> General -> Action permissions
and selectAllow all actions and reusable workflows
. And underWorkflow permissions
selectRead and write permissions
- Under
Settings -> Pages
, make sureSource -> Deploy from branch
and the branch isgh-pages / (root)