Skip to main content

A package for exporting projects from the Open Science Framework web app. Comes with a Command-line interface for exporting projects.

Project description

OSF Project Exporter

This is a CLI tool for exporting research project data and files from the OSF website. This is to prototype tool to export projects from the OSF website to a PDF, allowing users to back up, share or document their OSF projects in an offline medium.

Development Setup

Virtual Environment

  1. Clone this repository onto your local machine.
  2. Create a virtual environment to install dependencies. For virtualenv this is done with virtualenv <myenvname>. Make sure your virtual environment is setup to use Python 3.12 or above (e.g., virtualenv <myenvname> --python="/usr/bin/python3.12" on Linux.)
  3. From local Git repo: Activate your virtual environment and run pip install -e osfexport to install this repository as a modifiable package. Then install other requirements separately via pip install -r requirements.txt.
  4. On the OSF website, create or log in to your account. Set up a personal access token (PAT) by going into your account settings, select Personal access tokens in the left side menu, and clicking Create token. You should give the token a name that helps you remember why you made it, like "PDF export", and choose the osf.full_read scope - this allows this token to read all public and private projects on your account. You can delete this token once you have finished exporting your projects.

Docker

You can setup a Docker container with this tool installed as a Python package:

  1. Install and setup Docker and Docker Desktop on your local machine.
  2. Clone this repository onto your local machine.
  3. On the OSF website, create or log in to your account. Set up a personal access token (PAT) by going into your account settings, select Personal access tokens in the left side menu, and clicking Create token. You should give the token a name that helps you remember why you made it, like "PDF export", and choose the osf.full_read scope - this allows this token to read all public and private projects on your account. You can delete this token once you have finished exporting your projects.
  4. Create a .env file and add your personal access token to it (see .env.template.)
  5. In the root of this repository, run docker compose up --build -d to setup a container.
  6. Use docker compose exec -it cli <commands> to run CLI tool commands (e.g. export-projects) or run unit tests (i.e. python -m unittest.)

Installation

From PyPI: releases 0.1.4 and onwards

Activate your virtual environment, for virtualenv this is done by:

  • source <myenvname>/bin/activate on Linux
  • <myenvname>\Scripts\activate on Windows/Mac

Next, run python -m pip install osfexport. This will download and install this package and other dependencies from the PyPI index.

From TestPyPi: releases before 0.1.4

Activate your virtual environment and run python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple osfexport. This will download the packages needed from the PyPI index and the packaged version of this CLI tool on the TestPyPI index.

Usage

  • Run osfget to get a list of basic commands you can use.
  • To see what a command needs as input, type --help after the command name (e.g. osfget show-welcome --help; osfget --help)
  • To export all your projects from the OSF into a PDF, run osfget export-projects.

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

osfexport-0.2.3.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

osfexport-0.2.3-py3-none-any.whl (1.4 MB view details)

Uploaded Python 3

File details

Details for the file osfexport-0.2.3.tar.gz.

File metadata

  • Download URL: osfexport-0.2.3.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for osfexport-0.2.3.tar.gz
Algorithm Hash digest
SHA256 568eada4b39a98856e9032e30a0d94d03e303c0a08e9041e770f7cd059ae9d07
MD5 9d7e5194fdeffe577112c78467fa68f0
BLAKE2b-256 8b0e81d945826a7035f1bfb413472db8aa73844293321ab0d601ced74f1f0e7a

See more details on using hashes here.

File details

Details for the file osfexport-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: osfexport-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for osfexport-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b0bdc694561be15723c829d63c9d1dcb4cdce91d52f5fe54ae924bf3dccc38c8
MD5 074acb91466399b168f4325b91caa40d
BLAKE2b-256 75b8761f23fa10b4cf9ceb6015b738034344366e009dd0f7b64c5739e74ca89d

See more details on using hashes here.

Supported by

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