Skip to content
This repository was archived by the owner on Oct 2, 2021. It is now read-only.

gvlproject/python-genomespaceclient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7972d72 · Oct 2, 2021

History

79 Commits
Apr 18, 2017
Apr 3, 2019
Dec 22, 2017
Feb 21, 2016
Dec 22, 2017
Apr 3, 2019
Feb 21, 2016
Oct 2, 2021
Feb 22, 2016
Feb 16, 2018
Apr 2, 2019
Dec 22, 2017

Repository files navigation

The GenomeSpace Project has been discontinued

Python bindings and commandline client to the GenomeSpace API

latest version available on PyPI Code Coverage Travis Build Status Documentation Status

This is a python client for the GenomeSpace API. There's a Python API (the genomespaceclient module), and a command-line script (genomespace).

Installation

Install the latest release from PyPi:

pip install python-genomespaceclient

Commandline usage example

# Create remote folder, including all intermediate paths
genomespace -u <username> -p <password> mkdir -p https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/f1/f2/

# copy local files recursively to remote location
genomespace -u <username> -p <password> cp -R /tmp/ https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/

# copy local files matching pattern to remote location - note that paths with wildcards must be enclosed in quotes
genomespace -u <username> -p <password> cp '/tmp/*.txt' https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/

# list remote files
genomespace -u <username> -p <password> ls https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/

# move remote file to new location
genomespace -u <username> -p <password> mv https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/hello.txt https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/world.txt

# download remote files matching pattern, with verbose output
genomespace -vvv -u <username> -p <password> mv https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/*.txt /tmp/

# delete remote file
genomespace -u <username> -p <password> rm https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/world.txt

Python usage example

from genomespaceclient import GenomeSpaceClient

client = GenomeSpaceClient(username="<username>", password="<password>")
client.mkdir("https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/f1/f2". create_path=True)
client.copy("/tmp/", "https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/", recurse=True)
client.list("https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/")
client.move("https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/hello.txt", "https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/world.txt")
client.copy("https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/*.txt", "/tmp/")
client.delete("https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/*.txt")

Documentation

Documentation can be found at https://python-genomespaceclient.readthedocs.org.

Packages

No packages published

Contributors 5

Languages