Skip to main content

Download data resources discovered via FAIR Signposting item links.

Project description

signfetch v0.2.0a1

Python package focused on discovering and downloading data via FAIR Signposting.

Scope

Version 0.2.0a1 exposes two public APIs:

  • list_item_links(target) – discover item links without downloading
  • download_data(target, output_dir=...) – discover and download data resources

Both functions use FAIR Signposting discovery mechanisms.

The package discovers item links from the three main Signposting delivery mechanisms:

  1. HTTP Link headers
  2. HTML <link> elements
  3. Link Sets discoverable with the linkset relation

Link sets are automatically retrieved and parsed when present.


Example – discover data resources

You can inspect available data resources without downloading them.

from signfetch import list_item_links

links = list_item_links(
    "https://doi.org/10.5281/zenodo.12542566"
)

for link in links:
    print(link.url, link.source)

Example – download discovered data

download_data() performs discovery and downloads all discovered resources.

from pathlib import Path
from signfetch import download_data

result = download_data(
    "https://doi.org/10.5281/zenodo.12542566",
    output_dir=Path("downloads")
)

print(result.unique_item_count)

for item in result.items:
    print(item.url, item.saved_path)

Design notes

Main components:

Signposting discovery

  • SignpostingHarvester – orchestrates discovery
  • LinkHeaderParser – parses HTTP Link headers
  • HtmlLinkParser – parses HTML <link> elements
  • LinksetParser – parses linkset documents

Downloading

  • DataDownloader – downloads resources discovered via item links
  • downloads are executed concurrently

Public API

  • list_item_links() – discovery only
  • download_data() – discovery + download

Installation

pip install signfetch

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

signfetch-0.2.0a1.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

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

signfetch-0.2.0a1-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file signfetch-0.2.0a1.tar.gz.

File metadata

  • Download URL: signfetch-0.2.0a1.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for signfetch-0.2.0a1.tar.gz
Algorithm Hash digest
SHA256 588e1d32c274e652227c737dea1614d872743c28416fd50ba85f1a9cfa1998cd
MD5 4f604e3c43b9ec57c8b0be020e6cc591
BLAKE2b-256 fdf6122e22b87482b66393da985534f0429caeda1e291ad0c38e4ce27351b2b5

See more details on using hashes here.

File details

Details for the file signfetch-0.2.0a1-py3-none-any.whl.

File metadata

  • Download URL: signfetch-0.2.0a1-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for signfetch-0.2.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 78abb83c0e0670021cf5b3067c81158986f01e3fc0412052210ad9688dc2f834
MD5 98a06d1c8e787d21a8c68dbd2b628d18
BLAKE2b-256 a5f2e64a778a24adb1557ace72875f86d7b682cb996fd71aaf69c34163c79bc2

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