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
- Clone this repository onto your local machine.
- 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.) - From local Git repo: Activate your virtual environment and run
pip install -e osfexportto install this repository as a modifiable package. Then install other requirements separately viapip install -r requirements.txt. - 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 tokensin the left side menu, and clickingCreate token. You should give the token a name that helps you remember why you made it, like "PDF export", and choose theosf.full_readscope - 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:
- Install and setup Docker and Docker Desktop on your local machine.
- Clone this repository onto your local machine.
- 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 tokensin the left side menu, and clickingCreate token. You should give the token a name that helps you remember why you made it, like "PDF export", and choose theosf.full_readscope - 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. - Create a
.envfile and add your personal access token to it (see.env.template.) - In the root of this repository, run
docker compose up --build -dto setup a container. - 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/activateon Linux<myenvname>\Scripts\activateon 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
osfgetto get a list of basic commands you can use. - To see what a command needs as input, type
--helpafter 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file osfexport-0.2.0.tar.gz.
File metadata
- Download URL: osfexport-0.2.0.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15c54f013885d41799753b8bcd495f0905f8875bf02125d5b944230c90d231ef
|
|
| MD5 |
08d0777c0d63051fe07020f1ab8f4280
|
|
| BLAKE2b-256 |
6697ecc25a33831a667cc852e7a83dae3706cbd700d2374dba1535f28ce017f6
|
File details
Details for the file osfexport-0.2.0-py3-none-any.whl.
File metadata
- Download URL: osfexport-0.2.0-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cbb34a2ae31783dfa0dce49afd89436860d6a76573a43e480f3829db01233511
|
|
| MD5 |
a3b0aefe04fa8b9f2bd162137d50ecc8
|
|
| BLAKE2b-256 |
28d4ed9ff4219b0c16f272f867b440077b3891c1960e5c0af1b378a653137dc0
|