A python library and command-line client for file storage on OSF
Switch branches/tags
Clone or download
ctb Merge pull request #146 from benlindsay/checkhash
[MRG] hash checking --update option for upload, fetch, and clone
Latest commit 44b9a87 Aug 16, 2018
Permalink
Failed to load latest commit information.
LOGO
build_tools
docs
osfclient Merge branch 'master' into checkhash Jul 24, 2018
.coveragerc
.gitignore
.travis.yml switched pypi user to osfclient Aug 8, 2018
CONDUCT.md Add contributing guidelines May 29, 2017
CONTRIBUTING.md these guidelines Oct 6, 2017
LICENSE Add a license. Apr 5, 2017
MANIFEST.in single source Oct 8, 2017
README.rst updated info about secrets Aug 8, 2018
VERSION
devRequirements.txt Switch to RTD theme Jul 6, 2017
requirements.txt
setup.cfg include LICENSE in distributions Sep 24, 2017
setup.py Add long_description; fix header styling; add py36 classifier Oct 13, 2017

README.rst

osfclient

osfclient

travisbadge

The osfclient is a python library and a command-line client for up- and downloading files to and from your Open Science Framework projects. The Open Science Framework (OSF) is an open source project which facilitates the open collaboration of researchers on the web, by sharing data and other research outputs.

As such the OSF hosts large data sets, associated with papers or scientific projects, that can be freely downloaded. The osfclient allows people to store and retrieve large datasets associated to their scientific projects and papers on the OSF via the command line interface. If you are completely new to the OSF you can read their introductory materials

This is a very new project, it has some rough edges.

Installing

To use osfclient install it via pip:

$ pip install osfclient

For details on participating in the development of osfclient check out the Contributing section.

Usage

This project provides two things: a python library and a command-line program for interacting with files stored in the OSF.

The python library forms the basis for the command-line program. If you want programmatic access to your files use the library, otherwise try out the command-line program.

Read the full documentation: http://osfclient.readthedocs.io/en/latest/

Below are some examples on how to use it:

# get help and see available commands, get help on a specific command
$ osf -h
$ osf <command> -h

# setup a local folder for an existing project
$ osf init

# list all files for the project
$ osf ls

# fetch all files for the project
$ osf clone

# add a new file
$ osf upload local/file.txt remote/path.txt

# add a new directory
$ osf upload -r local/directory/ remote/directory

If the project is private you will need to provide authentication details. The password will be retrieved from the OSF_PASSWORD environment variable or you will be asked directly by the tool when you run it.

You can set default values by using a configuration file in the current directory. This is what osf init does for you. To set the username and project ID create .osfcli.config:

[osf]
username = yourOSFaccount@example.com
project = 9zpcy

after which you can simply run osf ls to list the contents of the project.

Contributing

Contributions from everyone and anyone are welcome. Fork this repository, make your changes, add a test to cover them and create a Pull Request. Then one of the maintainers will review your changes. When all comments have been addressed and all tests pass your changes will be merged.

To setup a development version:

$ git clone https://github.com/YOURNAMEHERE/osfclient
$ git remote add upstream https://github.com/osfclient/osfclient
$ cd osfclient
$ pip install -r devRequirements.txt
$ pip install -e.

There are a few secret keys relevant to this project, like passwords to pypi.org, test.pypi.org, and the osfclient email account. We store these in an encrypted git repo on Keybase. If you need access to this repo, contact any of the following maintainters on Keybase:

  • Tim Head (@betatim)
  • Ben Lindsay (@benlindsay)

For more details and instructions: CONTRIBUTING.md