Skip to content

Commit e2bbc46

Browse files
authored
add readme (#21)
* add readme * Update cli.py Walking back inadvertent changes from a rebase * Update README.md
1 parent 5c2b2f6 commit e2bbc46

File tree

2 files changed

+72
-1
lines changed

2 files changed

+72
-1
lines changed

README.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,72 @@
11
# dsaps
2+
3+
This command line application provides several ways of interacting with the [DSpace](https://github.com/DSpace/DSpace) API. This application was written for DSpace 6.3, it has not been tested against other DSpace versions.
4+
5+
## Installation
6+
Clone the repository and install using [pipenv](https://github.com/pypa/pipenv):
7+
```
8+
pipenv install
9+
```
10+
After installation, run the application with:
11+
```
12+
pipenv run dsaps
13+
```
14+
15+
## Authentication
16+
17+
To authenticate, use the following parameters
18+
19+
Option (short) | Option (long)     | Description
20+
------ | ------ | -----------
21+
N/A | --url | The DSpace API URL (e.g. https://dspace.mit.edu/rest), defaults to the DSPACE_URL environmental variable if nothing is specified
22+
-e | --email | The email of the user for authentication.
23+
-p | --password | The password for authentication.
24+
25+
## Commands
26+
27+
### additems
28+
Adds items to a specified collection from a metadata CSV, a field mapping file, and a directory of files. May be run in conjunction with the newcollection CLI command.
29+
30+
Option (short) | Option (long)             | Description
31+
------ | ------ | -------
32+
-m | --metadata-csv | The path to the CSV file of metadata for the items.
33+
-f | --field-map | The path to JSON field mapping file.
34+
-d | --content-directory | The full path to the content, either a directory of files or a URL for the storage location.
35+
-t | --file-type | The file type to be uploaded, if limited to one file type.
36+
-r | --ingest-report| Create ingest report for updating other systems.
37+
-c | --collection-handle | The handle of the collection to which items are being added.
38+
39+
40+
#### Example Usage
41+
```
42+
pipenv run dsaps --url https://dspace.com/rest -e [email protected] -p ******** additems -m coll_metadata.csv -f config/aspace_mapping.json -d /files/pdfs -t pdf -r -c 111.1/111111
43+
```
44+
45+
### newcollection
46+
Posts a new collection to a specified community. Used in conjunction with the additems CLI command to populate the new collection with items.
47+
48+
Option (short) | Option (long)            | Description
49+
------ | ------ | -------
50+
-c | --community-handle | The handle of the community in which to create the collection.
51+
-n | --collection-name | The name of the collection to be created.
52+
53+
#### Example Usage
54+
```
55+
pipenv run dsaps --url https://dspace.com/rest -e [email protected] -p ******** newcollection -c 222.2/222222 -n Test\ Collection additems -m coll_metadata.csv -f config/aspace_mapping.json -d /files/pdfs -t pdf -r
56+
```
57+
58+
### reconcile
59+
Runs a reconciliation of the specified files and metadata that produces reports of files with no metadata, metadata with no files, metadata matched to files, and an updated version of the metadata CSV with only the records that have matching files.
60+
61+
62+
Option (short) | Option (long)             | Description
63+
------ | ------ | -------
64+
-m | --metadata-csv | The path of the CSV file of metadata.
65+
-o | --output-directory | The path of the output files, include / at the end of the path.
66+
-d | --content-directory | The full path to the content, either a directory of files or a URL for the storage location.
67+
-t | --file-type | The file type to be uploaded.
68+
69+
#### Example Usage
70+
```
71+
pipenv run dsaps --url https://dspace.com/rest -e [email protected] -p ******** reconcile -m coll_metadata.csv -o /output -d /files/pdfs -t pdf
72+
```

dsaps/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def main(ctx, url, email, password):
6161
@click.option('-m', '--metadata-csv', required=True,
6262
type=click.Path(exists=True, file_okay=True, dir_okay=False),
6363
help='The path to the CSV file of metadata for the items.')
64-
@click.option('--field-map', required=True,
64+
@click.option('-f', '--field-map', required=True,
6565
type=click.Path(exists=True, file_okay=True, dir_okay=False),
6666
help='The path to JSON field mapping file.')
6767
@click.option('-d', '--content-directory', required=True,

0 commit comments

Comments
 (0)