Page contents: Made Possible by • Data Fetch • Initial Data Table • Next
The Data Story pages will illustrate how the data was gathered, handled, and delivered to generate the content of this site
This website was created with Python using data from TheCatAPI. The following Python packages (not all dependencies listed) and resources were used:
In addition to the documentation pages linked above, various guides, tutorials, and StackOverflow questions / answers helped me along the journey of making the website. The following list is not exhaustive:
TheCatAPI was queried and returned data as a JSON. When read into Python, it resulted in a list of dictionaries. Pandas converted the result into a DataFrame, which can be conveniently represented as a table.
import requests as re
import pandas as pd
cat = pd.DataFrame(re.get("https://api.thecatapi.com/v1/breeds").json())
A sample of the resulting table, cat, is presented below. Notice the various data types in the columns: dictionaries, strings, floats, and integers. Long strings are cut down for viewing purposes.
| weight | id | name | cfa_url | vetstreet_url | vcahospitals_url | temperament | origin | country_codes | country_code | description | life_span | indoor | lap | alt_names | adaptability | affection_level | child_friendly | dog_friendly | energy_level | grooming | health_issues | intelligence | shedding_level | social_needs | stranger_friendly | vocalisation | experimental | hairless | natural | rare | rex | suppressed_tail | short_legs | wikipedia_url | hypoallergenic | reference_image_id | image | cat_friendly | bidability | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | {\'imperial\': \'7 - 10\', \'metric\': \'3 - 5\'} | abys | Abyssinian | http://c... | http://w... | https://... | Active, ... | Egypt | EG | EG | The Abys... | 14 - 15 | 0 | 1.0 | 5 | 5 | 3 | 4 | 5 | 1 | 2 | 5 | 2 | 5 | 5 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | https://... | 0 | 0XYvRd7oD | {\'id\': \'0XYvRd7oD\', \'width\': 1204, \'height\': 1445, \'url\': \'https://cdn2.thecatapi.com/images/0XYvRd7oD.jpg\'} | NaN | NaN | |
| 1 | {\'imperial\': \'7 - 10\', \'metric\': \'3 - 5\'} | aege | Aegean | NaN | http://w... | NaN | Affectio... | Greece | GR | GR | Native t... | 9 - 12 | 0 | NaN | 5 | 4 | 4 | 4 | 3 | 3 | 1 | 3 | 3 | 4 | 4 | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | https://... | 0 | ozEvzdVM- | {\'id\': \'ozEvzdVM-\', \'width\': 1200, \'height\': 800, \'url\': \'https://cdn2.thecatapi.com/images/ozEvzdVM-.jpg\'} | NaN | NaN |
Continue to the next page to see how the data was processed. Compare the table above to the data table after processing.
> next Processing
>> after Data Table
>>> finally Graphing Examples