Dockerized python app that fetches quotes from The Simpsons Quote API and saves them to CSV format. Also contains a Jupyter notebook used to set up and test the code to fetch the data from the API and save to file.
- Go to
maggie
folder.
$ cd maggie
- Build docker image.
$ docker build . -t maggie
- Run image.
$ docker run -it -d maggie
- Start bash terminal in the container.
$ docker exec -it {container_id} /bin/bash
- Open quotes files
$ cat lisa/quotes.csv
$ cat homer/quotes.csv
cat general/quotes.csv
Same as the previous, but it saves quotes from each character in a directory with the character's name. Besides the quotes, inside each folder there is a JSON file containing the word count for all the quotes collected for each character; and the character's image downloaded using the URL provided by the API.
- Go to
lisa
folder.
$ cd lisa
- Build docker image.
$ docker build . -t lisa
- Run image.
$ docker run -it -d lisa
- Start bash terminal in the container.
$ docker exec -it {container_id} /bin/bash
- Inspect characters folders
$ ls -la app
$ ls -la 'Homer Simpson'
$ cat 'Homer Simpson'/quotes.csv
$ cat 'Homer Simpson'/counter.json
Multi-container app, composed of the Lisa app from previous step and a jupyter notebook container to visualise folder contents and word counts.
- Go to
bart
folder.
$ cd bart
- Run containers.
$ docker compose up
- Go to notebook, using the URL that appears in the console.
http://127.0.0.1:8888/lab?token={your token}