A Python package for downloading metadata and images of old visualizations in oldvis/dataset.
pip install oldvis_dataset
Downloading metadata of visualizations:
from oldvis_dataset import visualizations
visualizations.download(path="./visualizations.json")
Downloading images:
from oldvis_dataset import visualizations, fetch_images
visualizations.download(path="./visualizations.json")
fetch_images(metadata_path="./visualizations.json", img_dir="./images/")
Downloading images with filtering condition:
import json
from oldvis_dataset import visualizations, fetch_images
metadata = visualizations.load()
# Download public domain images.
metadata = [d for d in metadata if d["rights"] == "public domain"]
path = "./visualizations.json"
with open(path, "w", encoding="utf-8") as f:
json.dump(metadata, ensure_ascii=False)
fetch_images(metadata_path=path, img_dir="./images/")
Request the metadata of visualizations and store at path
.
Each store metadata entry follows the data structure ProcessedMetadataEntry
(Source).
visualizations.download(path="./visualizations.json")
Request the metadata of visualizations without saving.
data = visualizations.load()
Request the metadata of authors and store at path
.
authors.download(path="./authors.json")
Request the metadata of authors without saving.
data = authors.load()
Fetch images and store at img_dir
according to the URLs in the downloaded metadata of visualizations stored at metadata_path
.
fetch_images(metadata_path="./visualizations.json", img_dir="./images/")
Save the fetched metadata at metadata_path
as a BibTeX file and store at bib_path
.
save_as_bib(metadata_path="./visualizations.json", bib_path="./visualizations.bib")