Skip to content

Commit 8edc09e

Browse files
authored
Merge pull request #18 from ResearchObject/prepare-release
Rename repository and prepare release
2 parents 782ed33 + 71e5d58 commit 8edc09e

File tree

5 files changed

+91
-76
lines changed

5 files changed

+91
-76
lines changed

README.md

+75-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,76 @@
1-
# ro-crate-uploader
2-
RO-Crate uploader for Zenodo
1+
# ro-crate-zenodo
32

4-
[User Guide](docs/user_guide.md)
5-
[Developer Guide](docs/developer_guide.md)
3+
Upload RO-Crates to Zenodo and automatically fill the Zenodo metadata.
4+
5+
This package uses the legacy Zenodo API and is not compatible with other InvenioRDM instances. For RO-Crate uploads using the InvenioRDM API, use the [rocrate-invenio](https://github.com/ResearchObject/ro-crates-deposit) package instead.
6+
7+
## Setup
8+
9+
### Install the package
10+
11+
Install from PyPI using `pip` or your preferred package manager:
12+
```
13+
pip install rocrate-zenodo
14+
```
15+
### Set up a Zenodo personal access token
16+
17+
Create a file called `~/.config/zenodo.ini` on your computer with the following contents:
18+
19+
```ini
20+
# if using the Zenodo sandbox
21+
[zenodo:sandbox]
22+
sandbox_api_token =
23+
24+
# if using the real Zenodo
25+
[zenodo]
26+
api_token =
27+
```
28+
29+
Now create a Zenodo access token:
30+
31+
1. Register for a Zenodo account if you don’t already have one.
32+
1. Go to your profile and select Applications.
33+
1. You should see a section called "Personal access tokens." Click the "New token" button.
34+
1. Give the token a name that reminds you of what you're using it for (e.g. _RO-Crate uploader token_)
35+
1. Select the scopes `deposit:write` and `deposit:actions`.
36+
1. Click "Create."
37+
1. Copy the access token into your `~/.config/zenodo.ini` file.
38+
39+
The resulting file should look like this:
40+
41+
```ini
42+
# if using the Zenodo sandbox
43+
[zenodo:sandbox]
44+
sandbox_api_token = your-sandbox-token-here
45+
46+
# if using the real Zenodo
47+
[zenodo]
48+
api_token = your-token-here
49+
```
50+
51+
The `rocrate-zenodo` package will read this token whenever it connects to Zenodo in order to perform actions under your account. It's recommended to use the Zenodo sandbox until you're confident using the package.
52+
53+
## Usage
54+
55+
To upload a crate to Zenodo sandbox:
56+
```
57+
rocrate_zenodo -s demo/demo_crate
58+
```
59+
Replace `demo/demo_crate` with the path to the RO-Crate directory you want to upload. The `-s` flag sets the destination to the Zenodo sandbox; you can omit `-s` to upload to real Zenodo.
60+
61+
Once complete, you should see the draft record in your Zenodo dashboard.
62+
63+
For further help and options, run:
64+
```
65+
rocrate_zenodo --help
66+
```
67+
68+
## Tips
69+
70+
1. Set `givenName` and `familyName` on authors of the RO-Crate. This ensures that author names are formatted correctly in Zenodo.
71+
2. Use the SPDX URI for the top-level license, e.g. `https://spdx.org/licenses/CC-BY-NC-SA-4.0.html`. Other URIs for licenses are not currently well supported.
72+
3. Check your upload carefully in the Zenodo web interface before publishing. Not all metadata will be carried across from the RO-Crate, and some may be transferred incorrectly. Please [raise an issue](https://github.com/ResearchObject/ro-crate-zenodo/issues/new) if you notice a discrepancy.
73+
74+
## For Developers
75+
76+
See the [Developer Guide](docs/developer_guide.md).

docs/developer_guide.md

+9
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ If you do not already have `poetry` installed, install it following the [Poetry
99
Then install dependencies from `poetry.lock`:
1010

1111
```bash
12+
cd ro-crate-zenodo
1213
poetry install
1314
```
1415

@@ -29,3 +30,11 @@ In the root directory:
2930
```bash
3031
pytest
3132
```
33+
34+
## Publish a release
35+
36+
1. Update the version in `pyproject.toml`
37+
2. Make a git tag for the release and push it to GitHub
38+
3. Run `poetry build`
39+
4. Run `poetry publish -u <username> -p <password_or_api_key>`
40+
5. Create a release on GitHub, including the build artifacts

docs/user_guide.md

-68
This file was deleted.

pyproject.toml

+6-3
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ build-backend = "poetry.core.masonry.api"
88
name = "rocrate-zenodo"
99
version = "0.1.0"
1010
description = "Upload RO-Crates to Zenodo and automatically fill the Zenodo metadata"
11-
authors = ["Eli Chadwick <eli.chadwick@manchester.ac.uk>"]
11+
authors = [
12+
"Eli Chadwick <eli.chadwick@manchester.ac.uk>",
13+
"Stian Soiland-Reyes <soiland-reyes@manchester.ac.uk>",
14+
]
1215
maintainers = ["Eli Chadwick <eli.chadwick@manchester.ac.uk>"]
1316
license = "Apache-2.0"
1417
readme = "README.md"
1518
homepage = "https://www.researchobject.org/ro-crate/"
16-
repository = "https://github.com/ResearchObject/ro-crate-uploader"
19+
repository = "https://github.com/ResearchObject/ro-crate-zenodo"
1720
keywords = ["rocrate", "RO-Crate"]
1821
classifiers = [
1922
"Development Status :: 3 - Alpha",
@@ -44,7 +47,7 @@ rocrate_zenodo = "rocrate_zenodo.main:cli_entry"
4447
my_package_cli = 'my_package.console:run'
4548

4649
[tool.poetry.urls]
47-
"Issues" = "https://github.com/ResearchObject/ro-crate-uploader/issues"
50+
"Issues" = "https://github.com/ResearchObject/ro-crate-zenodo/issues"
4851

4952
# Testing tools
5053

src/rocrate_zenodo/upload.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def upload_crate_to_zenodo(
114114
res = create_zenodo(
115115
# this is a unique key you pick that will be used to store
116116
# the numeric deposition ID on your local system's cache
117-
# key="ro-crate-uploader",
117+
# key="ro-crate-zenodo",
118118
data=metadata,
119119
paths=[
120120
crate_zip_path,

0 commit comments

Comments
 (0)