Skip to content

Instantly share code, notes, and snippets.

View wettenhj's full-sized avatar

James Wettenhall wettenhj

  • Monash University
  • Melbourne
View GitHub Profile
@wettenhj
wettenhj / mytardis_download.py
Last active September 7, 2015 01:25
Downloading files from MyTardis using its RESTful API
#!/usr/bin/env python
"""
The following Python script demonstrates how to download files within a
private MyTardis dataset using API key authentication.
WARNING: This script does not check MD5 sums or verify file sizes etc. and
it only retrieves the first page of datafile records
(see datafiles['meta']['limit'] and datafiles['meta']['next']).
Replace "https://mytardis.example.com" with a real MyTardis URL.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Proof of concept that produces a virtual FUSE-mountable
# file/directory structure from a python dictionary
# By Steve Androulakis <http://github.com/steveandroulakis>
# Requires FUSE (linux: use package manager to install)
# Requires python-fuse pip install fuse-python
# USE:
# Mount: ./dict-fuse.py mnt -f
# Unmount: fusermount -u -z mnt