datalad_osf.annex_remote.OSFSpecialRemote
- class datalad_osf.annex_remote.OSFSpecialRemote(*args)[source]
git-annex special remote for the open science framework
Any OSF node can be used as a remote, but the recommended setup is to create a subcomponent of your project for archiving your data. Mark it with the Data category so you can find it quickly and take note of its URL. Each component (or project) has a URL like https://osf.io/6zbyf/ which is needed to connect to it.
Todo
Write doc section on how to do that, and what URL should be used to configure the special remote.
Initialize the special remote:
git annex initremote osf type=external externaltype=osf \ encryption=none node=<your-component-id>
To upload files you need to supply credentials.
Todo
Outline how this can be done
OSF_USERNAME, OSF_PASSWORD - credentials, OR OSF_TOKEN # TODO: untested, possibly currently broken in osfclient.
Because this is a special remote, the uploaded data do not retain the git folder structure.
The following parameters can be given to git-annex initremote, or git annex enableremote to (re-)configure a special remote.
- node
the OSF URL of the file store
- path
a subpath with (default: /)
See also
- https://git-annex.branchable.com/special_remotes
Documentation on git-annex special remotes
- https://osf.io
Open Science Framework, a science-focused filesharing and archiving site.
Methods
__init__
(*args)checkpresent
(key)Report whether the OSF node has a particular key
checkpresentexport
(key, remote_file)Return if the file remote_file is present in the remote
checkurl
(url)Asks the remote to check if the url's content can currently be downloaded (without downloading it).
claimurl
(url)Asks the remote if it wishes to claim responsibility for downloading an url.
error
(error_msg)Generic error. Can be sent at any time if things get too messed up to continue. If the program receives an error() from git-annex, it can exit with its own error(). Eg.: self.annex.error("Error received. Exiting.") raise SystemExit.
exportsupported
()getavailability
()Asks the remote if it is locally or globally available.
getcost
()Requests the remote to return a use cost.
initremote
()listconfigs
()prepare
()remove
(key)Remove a key from the remote
removeexport
(key, remote_file)Remove the file in remote_file from the remote
removeexportdirectory
(remote_directory)Remove the directory remote_directory from the remote
renameexport
(key, filename, new_filename)Move the remote file in name to new_name
setup
()transfer_retrieve
(key, filename)Get a key from OSF and store it to filename
transfer_store
(key, filename)transferexport_retrieve
(key, local_file, ...)Get the file located at remote_file from the remote
transferexport_store
(key, local_file, ...)Store the file located at local_file to remote_file on the remote
whereis
(key)Asks the remote to provide additional information about ways to access the content of a key stored in it, such as eg, public urls.
Attributes
files