JSON Data from tools.kausalflow.com
import pandas as pd
import requests
Get the Data
url = "https://tools.kausalflow.com/algolia.json"
header = {
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36",
"X-Requested-With": "XMLHttpRequest"
}
r = requests.get(url, headers=header)
data = r.json()
data[0]
Images of the tools
def get_images(tool_data, base_url=None):
"""Constructs the full path to the images of the tools.
"""
if base_url is None:
base_url = "https://tools.kausalflow.com/"
tool_images = [
i.get("path") for i in
tool_data.get("images")
]
tool_file_id = tool_data["file"]
tool_images = [
f"{base_url}images/tools/{tool_file_id}/{i}"
for i in tool_images
if i
]
return tool_images
get_images(data[0])
DataFrame
df = pd.DataFrame(r.json())
df.head()
df.author.value_counts()