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.4.0.tar.gz (14.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.4.0-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for aurl_aurl-2.4.0.tar.gz
Algorithm Hash digest
SHA256 158114a72add92fb75730b82234081df805925aa8ea387fa107ccf9390cdbb21
MD5 4bb39b7ced866490b14f7d4cd7015386
BLAKE2b-256 7bbf61e1d472cae6d7ece0e42e1a106dc3b2b9b1be5585d2cfd494bbe31ed799

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for aurl_aurl-2.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4856ac51d5364521a5b8487ebe7252975c11fc573c78df159ac84ddf81dac789
MD5 cc014a257c4cf317196039b0fc7fa3ab
BLAKE2b-256 052e1a107fcf34721a30498e947c4830284e980e8056276897527a4a05749908

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