Mercurial > hg > sworduploader
changeset 1:2ceacc9bb602
Added README and LICENSE.txt files
author | Marco Fabiani <marco.fabiani@eecs.qmul.ac.uk> |
---|---|
date | Wed, 28 Mar 2012 11:16:56 +0100 |
parents | 71b6185352a5 |
children | c72d6b5d58bc |
files | LICENSE.txt README sworduploader.py |
diffstat | 3 files changed, 101 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LICENSE.txt Wed Mar 28 11:16:56 2012 +0100 @@ -0,0 +1,26 @@ +Copyright (c) 2012, Marco Fabiani +Copyright (c) 2012, Queen Mary, University of London + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the <organization> nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README Wed Mar 28 11:16:56 2012 +0100 @@ -0,0 +1,56 @@ +SWORD2 DSpace bulk uploader +-------------------- + +A python script to submit large numbers of files to a SWORD2-compatible repository, specifically DSpace 1.8x. +Built on the SWORD2 python client library: https://bitbucket.org/beno/python-sword2/overview + +Dependencies: + +- python 2.X + +- sword2 library: https://bitbucket.org/beno/python-sword2/src + +Installation: + +- no installation required, simply copy the script sworduploader.py to a suitable location. The first time you run the script, it will create the sword2_logging.conf file. + +Usage: + +sworduploader.py [-h] [--username USER_NAME] [--title TITLE] + [--author AUTHOR [AUTHOR ...]] [--date DATE] + [--servicedoc DSPACEURL] + data + +Bulk upload to DSpace using SWORDv2. + +positional arguments: + data Accepts: METSDSpaceSIP packages, zip files, + directories, single files. NOTE: METSDSpaceSIP packages are + only accepted by Collections with a workflow! + +optional arguments: + -h, --help show this help message and exit + --username USER_NAME DSpace username. + --title TITLE Title (ignored for METS packages). + --author AUTHOR [AUTHOR ...] + Author(s) (ignored for METS packages). Accepts + multiple entries in the format "Surname, Name" + --date DATE Date of creation (string) (ignored for METS packages). + --servicedoc DSPACEURL + Url of the SWORDv2 service document (default: + http://c4dm.eecs.qmul.ac.uk/smdmrd- + test/swordv2/servicedocument + +If the submission is created successfully, it will remain open to be completed +with the necessary metadata and licenses, using the DSpace web interface. The +submission can be found in the "My Account -> Submissions" section of the +user's area. + +Source: + +https://code.soundsoftware.ac.uk/projects/sworduploader/repository + +----------------------------------------------- +Copyright 2012 Marco Fabiani +Copyright 2012 Queen Mary, University of London +------------------------------------------------ \ No newline at end of file
--- a/sworduploader.py Tue Mar 27 17:55:00 2012 +0100 +++ b/sworduploader.py Wed Mar 28 11:16:56 2012 +0100 @@ -1,7 +1,21 @@ #!usr/bin/env/ python -# dspaceuploader.py -# Copyright: Marco Fabiani, Centre for Digital Music, Queen Mary University of London -# License: XXXXXX + +""" SWORD2 DSpace bulk uploader + +A python script to submit large numbers of files to a SWORD2-compatible repository, specifically DSpace 1.8x. +Built on the SWORD2 python client library: https://bitbucket.org/beno/python-sword2/overview + +Dependencies: + +- python 2.X + +- sword2 library: https://bitbucket.org/beno/python-sword2/src + +----------------------------------- +Copyright 2012 Marco Fabiani +Copyright 2012 Queen Mary, University of London +----------------------------------- +""" import argparse, getpass, zipfile,os,sys from sword2 import * @@ -9,12 +23,12 @@ # Parse arguments parser = argparse.ArgumentParser(description="Bulk upload to DSpace using SWORDv2.",epilog="If the submission is created successfully, it will remain open to be completed with the necessary metadata and licenses, using the DSpace web interface. The submission can be found in the \"My Account -> Submissions\" section of the user's area.") parser.add_argument("data", type=str, nargs=1, - help="Accepts: METSDSpaceSIP packages, zip files, directories, single files") + help="Accepts: METSDSpaceSIP packages, zip files, directories, single files. NOTE: METSDSpaceSIP packages are only accepted by Collections with a workflow!") parser.add_argument("--username", dest="user_name", type=str,nargs=1, help="DSpace username.") parser.add_argument("--title", dest="title", type=str,nargs=1, help="Title (ignored for METS packages).") parser.add_argument("--author", dest="author", type=str,nargs="+", help="Author(s) (ignored for METS packages). Accepts multiple entries in the format \"Surname, Name\"") parser.add_argument("--date", dest="date", type=str,nargs=1, help="Date of creation (string) (ignored for METS packages).") -parser.add_argument("--servicedoc", dest="dspaceurl", type=str,nargs=1, help="Url of the SWORDv2 service document (default: c4dm).") +parser.add_argument("--servicedoc", dest="dspaceurl", type=str,nargs=1, help="Url of the SWORDv2 service document (default: http://c4dm.eecs.qmul.ac.uk/smdmrd-test/swordv2/servicedocument") args = parser.parse_args() data = args.data[0]