Skip to main content

No project description provided

Project description

Newest PyPI version Code style: black Commitizen friendly

oldvis_dataset

A Python package for downloading metadata and images of old visualizations in oldvis/dataset.

Installation

pip install oldvis_dataset

Usage Example

Downloading metadata of visualizations:

from oldvis_dataset import visualizations
visualizations.download(path="./visualizations.json")

Downloading images:

from oldvis_dataset import visualizations, fetch_image
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_image
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_image(metadata_path=path, img_dir="./images/")

API

oldvis_dataset.visualizations

oldvis_dataset.visualizations.download(path: str) -> None

Request the metadata of visualizations and store at path. Each store metadata entry follows the data structure ProcessedMetadataEntry (Source).

visualizations.download(path="./visualizations.json")

oldvis_dataset.visualizations.load() -> List

Request the metadata of visualizations without saving.

data = visualizations.load()

oldvis_dataset.authors

oldvis_dataset.authors.download(path: str) -> None

Request the metadata of authors and store at path.

authors.download(path="./authors.json")

oldvis_dataset.authors.load() -> List

Request the metadata of authors without saving.

data = authors.load()

oldvis_dataset.fetch_images(metadata_path: str, img_dir: str) -> None

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/")

⚠️The image fetching can be slow.

oldvis_dataset.save_as_bib(metadata_path: str, bib_path: str) -> None

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")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oldvis_dataset-0.1.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oldvis_dataset-0.1.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file oldvis_dataset-0.1.1.tar.gz.

File metadata

  • Download URL: oldvis_dataset-0.1.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.0 Linux/5.15.0-1041-azure

File hashes

Hashes for oldvis_dataset-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ebb98b0832f3d73ba03fceef3a7cf227cfc1a36273d939b0788dd4833f097644
MD5 bea440ca5de8680872d04b04c8187e81
BLAKE2b-256 09ff807da1f45975641bc0d0a4eef6e31b4bdd0f9ef9c42a89be08531f06d8a2

See more details on using hashes here.

File details

Details for the file oldvis_dataset-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: oldvis_dataset-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.0 Linux/5.15.0-1041-azure

File hashes

Hashes for oldvis_dataset-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 28280ac115d65d2629dc3b46ae390c3de62bf40887e692008d9321d35225ffec
MD5 359d062f1d6600a54c3703ae7f9a8094
BLAKE2b-256 116b6ca29004f7e8ccb53dee0f6ba76e4b0de9be85341eea1311664466c3804b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page