|
| 1 | +Python bindings and commandline client to the GenomeSpace API |
| 2 | +============================================================= |
| 3 | + |
| 4 | +.. image:: https://img.shields.io/pypi/v/python-genomespaceclient.svg |
| 5 | + :target: https://pypi.python.org/pypi/python-genomespaceclient/ |
| 6 | + :alt: latest version available on PyPI |
| 7 | + |
| 8 | +.. image:: https://readthedocs.org/projects/python-genomespaceclient/badge/?version=latest |
| 9 | + :target: http://python-genomespaceclient.readthedocs.org/en/latest/?badge=latest |
| 10 | + :alt: Documentation Status |
| 11 | + |
| 12 | +This is a python client for the GenomeSpace API. There's a Python API (the |
| 13 | +``genomespaceclient`` module), and a command-line script (``genomespace``). |
| 14 | + |
| 15 | + |
| 16 | +Installation |
| 17 | +~~~~~~~~~~~~ |
| 18 | +Install the latest release from PyPi: |
| 19 | + |
| 20 | +.. code-block:: shell |
| 21 | +
|
| 22 | + pip install python-genomespaceclient |
| 23 | +
|
| 24 | +
|
| 25 | +Commandline usage example |
| 26 | +~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 27 | + |
| 28 | +.. code-block:: bash |
| 29 | +
|
| 30 | + # copy local file to remote location |
| 31 | + genomespace -u <username> -p <password> cp /tmp/local_file.txt https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/hello.txt |
| 32 | + |
| 33 | + # list remote files |
| 34 | + genomespace -u <username> -p <password> ls https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/ |
| 35 | + |
| 36 | + # move remote file to new location |
| 37 | + 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 |
| 38 | + |
| 39 | + # download remote file, with verbose output |
| 40 | + genomespace -vvv -u <username> -p <password> mv https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/world.txt /tmp/new_local_file.txt |
| 41 | + |
| 42 | + # delete remote file |
| 43 | + genomespace -vvv -u <username> -p <password> mv https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/world.txt |
| 44 | +
|
| 45 | +
|
| 46 | +Python usage example |
| 47 | +~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 48 | + |
| 49 | +.. code-block:: python |
| 50 | +
|
| 51 | + from genomespaceclient import GenomeSpaceClient |
| 52 | +
|
| 53 | + client = GenomeSpaceClient(username="<username>", password="<password>") |
| 54 | + client.copy("/tmp/local_file.txt", "https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/hello.txt") |
| 55 | + client.list("https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/") |
| 56 | + 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") |
| 57 | + client.copy("https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/world.txt", "/tmp/new_local_file.txt") |
| 58 | + client.delete("https://dm.genomespace.org/datamanager/v1.0/file/Home/MyBucket/world.txt") |
| 59 | +
|
| 60 | +
|
| 61 | +Documentation |
| 62 | +~~~~~~~~~~~~~ |
| 63 | +Documentation can be found at https://python-genomespaceclient.readthedocs.org. |
| 64 | + |
0 commit comments