Skip to main content

An OSF command-line library

Project description

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: https://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

# fetch an individual file from a project
$ osf fetch remote/path.txt local/file.txt

# get web view url for an individual file from a project
$ osf geturl remote/path.txt

# 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. You can provide either username & password credentials or a Personal Access Token (PAT). You can provide these by setting either the OSF_USERNAME and OSF_PASSWORD environment variables or by setting the OSF_TOKEN environment variable. 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 for the username and project 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

To avoid having to provide credentials on each use, you can provide either your password or a PAT in your config with the following keys:

# basic auth (username/password)
password = this-password-is-fake

# token auth
token = kej2R9IU6Gr2uThsswSNdP1cd0cu9eaCerVXjVf7zNwfXHyT0QzMZtX0PGTYmp9Fzaixwq

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 -c constraints.txt
$ pip install -e . -c constraints.txt

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)

  • Fitz Elliott (@felliott)

  • Longze Chen (@cslzchen)

For more details and instructions: CONTRIBUTING.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

osfclient-0.0.5.tar.gz (27.4 kB view details)

Uploaded Source

Built Distribution

osfclient-0.0.5-py2.py3-none-any.whl (39.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file osfclient-0.0.5.tar.gz.

File metadata

  • Download URL: osfclient-0.0.5.tar.gz
  • Upload date:
  • Size: 27.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.11

File hashes

Hashes for osfclient-0.0.5.tar.gz
Algorithm Hash digest
SHA256 47c92bbdce57ecc0ed87eabe459025cc549080c48b28ebc86bfc5d82545a75c8
MD5 ed3dc4ec2eb32ab10177fcb525a52904
BLAKE2b-256 ea519e3668e8f6871fdd6aaf9c32890faea38c5b7cbc47e0c8283b05171c3f4a

See more details on using hashes here.

File details

Details for the file osfclient-0.0.5-py2.py3-none-any.whl.

File metadata

  • Download URL: osfclient-0.0.5-py2.py3-none-any.whl
  • Upload date:
  • Size: 39.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.11

File hashes

Hashes for osfclient-0.0.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2351a61785f2ad662f1f4e7775d77dc4c185379473553f46fbfcfb65da819b80
MD5 6574953f9b15d11c8412b0f5c67be2fc
BLAKE2b-256 a87a8d6fe30d424329ced46a738faaea4150efb8eee656599b88a791cf7ad07e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page