Skip to main content

Download data resources discovered via FAIR Signposting item links.

Project description

signfetch v0.1

Python package focused on downloading data discovered via FAIR Signposting.

Scope

Version 0.1.0 intentionally focuses on one public API:

  • download_data(target, output_dir=...)

The function 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

It then deduplicates discovered data URLs and downloads all unique resources.

Install

pip install .

For development:

pip install -e .[dev]

Example

from pathlib import Path
from signfetch import download_data

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

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

Design notes

Main components:

  • SignpostingHarvester discovers item and linkset links
  • LinkHeaderParser, HtmlLinkParser, LinksetParser parse representations
  • DataDownloader downloads discovered resources
  • download_data() is the small public façade

Docker

Build:

docker build -t signfetch:0.1.0 .

Run tests in the image:

docker run --rm signfetch:0.1.0 pytest

Release flow

Use prerelease first (for example 0.1.1a1) and tag the commit:

git tag v0.1.1a1
git push origin v0.1.1a1

Run CI first. At the end of CI (package-artifact job) you will get the artifact signfetch-package. Use that CI run ID in the publish workflow input ci_run_id.

Validate package and tag without publishing:

bash scripts/publish_testpypi.sh check

Publish to TestPyPI:

bash scripts/publish_testpypi.sh test

Publish to PyPI:

bash scripts/publish_testpypi.sh prod

Recommendation: one artifact build on Linux is enough here because the package is pure Python (py3-none-any). Cross-platform safety is still covered by build checks and unit tests on Linux/Windows/macOS in CI.

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.1.1a1.tar.gz (10.8 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.1.1a1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for signfetch-0.1.1a1.tar.gz
Algorithm Hash digest
SHA256 54912f4d10b640f6250703b13166601bf1dc3aeef6960b247a2ec4b3b8d502b3
MD5 c226fe87ae99f0f76ed86aacdae9545a
BLAKE2b-256 84b4c61b85d887c9fa63dd3c299551047266ae2d426d119ff56415ee0b555453

See more details on using hashes here.

File details

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

File metadata

  • Download URL: signfetch-0.1.1a1-py3-none-any.whl
  • Upload date:
  • Size: 10.2 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.1.1a1-py3-none-any.whl
Algorithm Hash digest
SHA256 16ed5c14eaee764574aedaf89b57dcfdff067bad4d7a6230a4cf849fa4c43b14
MD5 1dae2708678874e67a208cfe5ff79821
BLAKE2b-256 850031cb1d070aa9e627f649d7fe7f1887774f692d1788eb883f3be06ec3f830

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