Skip to content

Commit

Permalink
Update Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tmorrell committed Oct 5, 2018
1 parent 554a388 commit 29d1b07
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,35 @@ repositories.

- caltech_thesis - Transform CaltechTHESIS records to DataCite

#### Usage
## Setup

Requires:

- Python 3 (Recommended via [Anaconda](https://www.anaconda.com/download))
- xmltodict (pip install xmltodict)
- datacite (pip install datacite)

If you will be minting DOIs, you need to create a file called `pw` using a text
editor that contains your DataCite password. The username is hardcoded in the
script, since non-Caltech users will have to modify the script to work with
their Eprints installation.

You can also import the metadata transformation function into another python script by typing
`python setup.py install` in the epxml_to_datacite directory. Then include
`import caltech_thesis` at the top of your new script and you wil be able to
call `epxml_to_datacite(eprint)`, where eprint is the xml parsed by something
like:

```
infile = open('10271.xml',encoding="utf8")
eprint = xmltodict.parse(infile.read())['eprints']['eprint']
```

## Using caltech_thesis.py

Download .xml files from thesis.library.caltech.edu/rest/eprint/1234.xml and put
them in the folder with caltech_thesis.py. Type `python caltech_thesis` and
DataCite XML files will appear. If you want to mint DOIs add the `-mint`
option and if you want to make test DOIs add the `-test` option to the command
line.

Download .xml files and put them in this folder. Type `./run_thesis`. DataCite
XML files will appear

0 comments on commit 29d1b07

Please sign in to comment.