Skip to main content

A package for maintaining a download mirror / cache and splicing URLs into file templates.

Project description

CI Coverage

aurl

A package for maintaining a download mirror / cache and splicing URLs into file templates.

This package provides two commands, get:

Usage: get [OPTIONS] URLS...

  Download a list of URLs.

Arguments:
  URLS...  urls to download  [required]

and subst:

Usage: subst [OPTIONS] TEMPLATES...

  Fetch and substitute URLs into a template.

Arguments:
  TEMPLATES...  File(s) to substitute.  [required]

Options:
  --results / --no-results        Don't substitute, but list required results.
                                  [default: no-results]

Template Format

Templates can include URLs inside ${{ }} splices. The [[tests/template.rc.tpl]] file demonstrates:

This is a test template

step1 = ${{ git://code.ornl.gov/DataTrails/1000water }}
root  = ${{ file:///usr/bin/last }}
github = ${{ git://github.com/frobnitzem/aiowire }}

Python API

Examining the source of subst reveals a TemplateFile and Mirror classes. The TemplateFile class parses and prints templates. Mirror provides the async functions fetch and fetch_all:

tf = TemplateFile(fname)
urls = set(tf.uris)

M = Mirror( Path() )
lookup = arun(M.fetch_all(urls))
tf.write(out, lookup)

The Mirror class also has encode, and decode, which translate URLs to/from fille paths inside the mirror's root path.

File server

This package includes a simple file server. To use it, follow certified's docs to launch aurl.serve:app.

certified init --host dtn.my.org --domain my.org 'My DTN Service'
certified serve aurl.serve:app https://0.0.0.0:4433

Your client can now access this file server using

# client configuration
pip install certified
certified init 'My client'
certified get-ident # ~> (send to certified introduce on server side to get intro.json)
certified add-intro intro.json
certified add-service https://dtn.my.org:4433 intro.json

# GET using certified's message util (serial)
message https://dtn.my.org:4433/file1.h5

# GET using aurl's get tool (parallel)
get https://dtn.my.org:4433/file1.h5 https://dtn.my.org:4433/file2.zarr

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

aurl_aurl-2.2.0.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

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

aurl_aurl-2.2.0-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file aurl_aurl-2.2.0.tar.gz.

File metadata

  • Download URL: aurl_aurl-2.2.0.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.10.12 Linux/6.8.0-57-generic

File hashes

Hashes for aurl_aurl-2.2.0.tar.gz
Algorithm Hash digest
SHA256 d8c399ca18c81f60f7d5d913e286f83b66119716030eb2ec38aac53c1f73a4e9
MD5 a0668943ff49533dc76dbbeffce2857c
BLAKE2b-256 0956410031f261898e5113fb6ba1ded7557a9506a9117c41713f6c253e64ee95

See more details on using hashes here.

File details

Details for the file aurl_aurl-2.2.0-py3-none-any.whl.

File metadata

  • Download URL: aurl_aurl-2.2.0-py3-none-any.whl
  • Upload date:
  • Size: 16.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.10.12 Linux/6.8.0-57-generic

File hashes

Hashes for aurl_aurl-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc44ebecd1d77f30ab8eaf3adcd5fe76389ca67f476060de53bb9d0cb561e807
MD5 e9cbaa87fb06c05adc0ed6f1d37251b0
BLAKE2b-256 387a9a9de65cf2d9a51e28338c71f16754cff0b57d81059e9f15d2cf29fc4e9a

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