VOSpace command line and FUSE clients
Python Shell
Latest commit 4d3963d Oct 11, 2016 @ijiraq ijiraq committed on GitHub Merge pull request #65 from canfar/s1904
Failed to load latest commit information.
test Changed unit testing to use virtualenv Apr 29, 2016
.gitignore Remove .DS_Store mac file and add to .gitignore Mar 30, 2015
.travis.yml Merge with master Oct 6, 2016
PKG-INFO Initial checkin to git from svn. May 2, 2013
README.md Changes after code review Oct 5, 2016
gms.py An example script for pulling authentication/authorization from CADC GMS Jul 23, 2013



vos is a set of python modules and scripts that ease access to VOSpace.

The default installation of vos is tuned for accessing the VOSpace provided by the Canadian Advanced Network For Astronomical Research (CANFAR)

VOSpace is a Distributed Cloud storage service for use in Astronomy.

There are three ways to use vos:

  1. access VOSpace using the command-line script: eg. vcp
  2. make VOSpace appear as mounted filesystem: mountvofs
  3. use the vos module inside a Python script: import vos

Authentication to the CANFAR VOSpace service is performed using X509 security certificates, header tokens or username/password pairs. The authentication system is managed by the CADC Group Management Service (GMS).

To retrieve an X509 security certificate for use with the vos tools use the getCert script included with this package.

Additional information is available in the CANFAR documentation

System Requirments

  • A CANFAR VOSpace account (required for WRITE access, READ access can be anonymous)
  • fuse OR OSX-FUSE (see additional documentation, only required for filesystem based access, not for command line or programmatic)
  • python2.6 or later


vos is distributed via PyPI/vos and PyPI is the most direct way to get the latest stable release:

pip install vos --upgrade --user

Or, you can retrieve the github distribution and use

python setup.py install --user


  1. Get a CANFAR account
  2. Install the vos package.
  3. Retrieve a X509/SSL certificate using the built in getCert script.
  4. Example Usage.
    1. For filesystem usage: mountvofs mounts the CADC VOSpace root Container Node at /tmp/vospace and initiates a 5GB cache in the users home directory (${HOME}/vos_). fusermount -u /tmp/vospace (LINUX) or umount /tmp/vospace (OS-X) unmounts the file system. VOSpace does not have a mapping of your unix users IDs and thus files appear to be owned by the user who issued the 'mountvofs' command.
    2. Commandline usage:
      • vls -l vos: [List a vospace]
      • vcp vos:jkavelaars/test.txt ./ [copies test.txt to the local directory from vospace]
      • vmkdir --help [get a list of command line options and arguments]
      • vmkdir, vrm, vrmdir, vsync vcat, vchmod and vln
    3. In a Python script (the example below provides a listing of a vospace container)
import vos
client = vos.Client()


A virtual environment (venv) is recommended to set up external dependencies without installing them system-wide. Following these instructions, install virtualenv:

$ pip install virtualenv

Next, create, and activate a local venv (this example uses bash):

$ virtualenv venv
$ source venv/bin/activate

The test environment is built into the setup.py so that conducting unit-tests can be achieved like so:

python setup.py test

If you would like versbose output formated as a web page, for example, you can add options to the test call:

python setup.py test --addopts '--cov-report html:cov_html --cov=vos'

The same option attribute can be used to pass other arguments to py.test that is executing the test. To run specific only tests for example:

python setup.py test --addopts 'vos/test/Test_vos.py::TestClient::test_transfer_error'

Each time you resume work on the project and want to use the venv (e.g., from a new shell), simply re-activate it:

$ source venv/bin/activate

When done, just issue a

$ deactivate

command to deactivate the virtual environment.

Integration Tests

The integration tests are, at present, designed to run only at CADC. Tests assume that scripts have been installed (e.g., into the venv). Note: the integration tests run only on tcsh.

Start the tcsh and activate the venv

$ source venv/bin/activate.csh

Set the python binary for testing. Before using virtualenv this was used to test on multiple version of python. With venv, just set it to the default version of python on that venv:


Set the path to the vos script locatio

$ setenv CACD_ROOT <vos directory>

Finally, add the development vos to the PYTHONPATH:



Now, it's time to run the test:

$ cd test/scripts
$ ./vospace-all.tcsh