From 29d1b07caa258c65416a6d8f1194e6f90dc90dfe Mon Sep 17 00:00:00 2001 From: Tom Morrell Date: Fri, 5 Oct 2018 09:29:16 -0700 Subject: [PATCH] Update Docs --- README.md | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fa8c201..bb74898 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ repositories. - caltech_thesis - Transform CaltechTHESIS records to DataCite -#### Usage +## Setup Requires: @@ -17,6 +17,27 @@ Requires: - 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