Skip to main content

Add HTTP read only dataset support to dtool

Project description

PyPi package Travis CI build status (Linux) Code Coverage

Features

  • Publish dtool datasets by making them accessible via HTTP(S)

  • Interact with dtool datasets over HTTP(S)

  • Copy a dataset over HTTP(S)

Installation

To install the dtool-http package.

cd dtool-http
python setup.py install

Usage

To publish a dataset hosted in Amazon S3 or Microsoft Azure Storage use the dtool_publish_dataset command line utility:

$ dtool_publish_dataset azure://jicinformatics/c58038a4-3a54-425e-9087-144d0733387f
Dataset accessible at: https://jicinformatics.blob.core.windows.net/c58038a4-3a54-425e-9087-144d0733387f

To show the descriptive metadata of the published dataset:

$ dtool readme show https://jicinformatics.blob.core.windows.net/c58038a4-3a54-425e-9087-144d0733387f
---
description: Enterobacteria phage lambda, complete genome
creation_date: 2018-02-06
accession: NC_001416.1
link: https://www.ncbi.nlm.nih.gov/nuccore/NC_001416.1
reference: |
  Nucleotide [Internet]. Bethesda (MD):
  National Library of Medicine (US),
  National Center for Biotechnology Information; [1988] - .
  Accession No. NC_001416.1, Enterobacteria phage lambda, complete genome
  [cited 2018 Feb 06]
  Available from: https://www.ncbi.nlm.nih.gov/nuccore/NC_001416.1

To copy the dataset to local disk:

$ dtool copy https://jicinformatics.blob.core.windows.net/c58038a4-3a54-425e-9087-144d0733387f ~/my_datasets
Dataset copied to:
file:///Users/olssont/my_datasets/lamda-phage-genome

Serving a directory of datasets over HTTP

There is a simple utility for serving datasets in a directory over HTTP called dtool_serve_direcotry. This is mainly useful for testing purposes.

Usage:

$ dtool_serve_directory ~/my_datasets

The default port used is 8081. To show the descriptive metadata in the README one can use dtool:

$ dtool readme show http://localhost:8081/lamda-phage-genome
---
description: Enterobacteria phage lambda, complete genome
creation_date: 2018-02-06
accession: NC_001416.1
link: https://www.ncbi.nlm.nih.gov/nuccore/NC_001416.1
reference: |
  Nucleotide [Internet]. Bethesda (MD):
  National Library of Medicine (US),
  National Center for Biotechnology Information; [1988] - .
  Accession No. NC_001416.1, Enterobacteria phage lambda, complete genome
  [cited 2018 Feb 06]
  Available from: https://www.ncbi.nlm.nih.gov/nuccore/NC_001416.1

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

dtool-http-0.5.0.tar.gz (5.7 kB view details)

Uploaded Source

File details

Details for the file dtool-http-0.5.0.tar.gz.

File metadata

  • Download URL: dtool-http-0.5.0.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.7

File hashes

Hashes for dtool-http-0.5.0.tar.gz
Algorithm Hash digest
SHA256 02f581435369252d53e8c283cd5d3726404c0bf1858a1ddebdf15cd8e9a58b8e
MD5 38151702220f2f1a463cf1b56f53e4d9
BLAKE2b-256 30a1c9d107cb46273c679389f6297d76b9b5e948bb34b5b599a5133d8686b366

See more details on using hashes here.

Supported by

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