Rest Framework ---
} Access & Preservation Services
| def cleanerApp(content): | |
| rdict = {'\xc3\x80':'\u00c0', '\xc3\x81':'\u00c1', '\xc3\x82':'\u00c2', '\xc3\x83':'\u00c3', '\xc3\x84':'\u00c4', '\xc3\x85':'\u00c5', '\xc3\x86':'\u00c6', '\xc3\x87':'\u00c7', '\xc3\x88':'\u00c8', '\xc3\x89':'\u00c9', '\xc3\x8a':'\u00ca', '\xc3\x8b':'\u00cb', '\xc3\x8c':'\u00cc', '\xc3\x8d':'\u00cd', '\xc3\x8e':'\u00ce', '\xc3\x8f':'\u00cf', '\xc3\x90':'\u00d0', '\xc3\x91':'\u00d1', '\xc3\x92':'\u00d2', '\xc3\x93':'\u00d3', '\xc3\x94':'\u00d4', '\xc3\x95':'\u00d5', '\xc3\x96':'\u00d6', '\xc3\x97':'\u00d7', '\xc3\x98':'\u00d8', '\xc3\x99':'\u00d9', '\xc3\x9a':'\u00da', '\xc3\x9b':'\u00db', '\xc3\x9c':'\u00dc', '\xc3\x9d':'\u00dd', '\xc3\x9e':'\u00de', '\xc3\x9f':'\u00df', '\xc3\xa0':'\u00e0', '\xc3\xa1':'\u00e1', '\xc3\xa2':'\u00e2', '\xc3\xa3':'\u00e3', '\xc3\xa4':'\u00e4', '\xc3\xa5':'\u00e5', '\xc3\xa6':'\u00e6', '\xc3\xa7':'\u00e7', '\xc3\xa8':'\u00e8', '\xc3\xa9':'\u00e9', '\xc3\xaa':'\u00ea', '\xc3\xab':'\u00eb', '\xc3\xac':'\u00ec', '\xc3\xad':'\u00ed', '\xc3\xae':'\u00ee', |
To help me get through this faster in future.
Sheet Authors has various data about a person, including their Org code in Column C.
Sheet Orgs has Column A with the Org code (matching Column C's codes) and Column B with the Title of the Organization.
| CREATE TABLE books | |
| (`id` INT, `title` varchar(225), `location` varchar(12), `publisher` varchar(100), `publication_date` INT(4) ) | |
| ; | |
| INSERT INTO books | |
| (`id`, `title`, `location`, `publisher`, `publication_date`) | |
| VALUES | |
| (1, 'Semantic Web for the Working Ontologist: Effective Modeling in RDFS and OWL', 'ebook', 'Morgan Kaufmann Publishers', 2008 ), | |
| (2, 'The Fifth Season', 'new', 'Orbit', 2015 ), | |
| (3, 'Ancillary Justice', 'new', 'Orbit', 2013), |
| <fbm:modifyDatastream pid="\1" dsID="RELS-EXT" dsControlGroupType="X" dsLabel="colloquia_RELS-EXT_ds" logMessage="BatchModify - modifyDatastream"> | |
| <fbm:xmlData> | |
| <rdf:RDF xmlns:rel="info:fedora/fedora-system:def/relations-external#" xmlns:fedora-model="info:fedora/fedora-system:def/model#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> | |
| <rdf:Description rdf:about="\1"> | |
| <rel:isMemberOfCollection xmlns:rel="info:fedora/fedora-system:def/relations-external#" xmlns:rel="info:fedora/fedora-system:def/relations-external#" rdf:resource="info:fedora/collection:3"/> | |
| <rel:isMemberOf xmlns:rel="info:fedora/fedora-system:def/relations-external#" rdf:resource="\2"/> | |
| <fedora-model:hasModel xmlns:fedora-model="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/cmodel:2"/> | |
| <fedora-model:hasModel xmlns:fedora-model="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/cmodel:4"/> | |
| <rel:isPartOf xmlns:rel="info:fedora/fedora-system:def/relations-external#" rd |
| import glob | |
| import os | |
| """ | |
| Loops through all the .xml files in the directory where the script is located and removes the designated string: REMOVETHIS in each filename. | |
| If you want to replace, add your new text as the second argument in replace(). | |
| """ | |
| def do_rename_files(): |
| find C:/Path/To/Folders -type f -name "*.pdf" -exec cp {} C:/Path/To/New/Folder \; |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
| xmlns:xs="http://www.w3.org/2001/XMLSchema" | |
| xmlns:dc="http://purl.org/dc/elements/1.1/" | |
| xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" | |
| exclude-result-prefixes="xs" | |
| version="2.0"> | |
| <xsl:output method="text" indent="no" media-type="string"/> | |
| <xsl:strip-space elements="*"/> | |
| <xsl:choose> | |
| <xsl:when test="self::dc:date and text()[matches(.,'^\d{4}\-\d{2}-\d{2}')]"> | |
| <xsl:text>^^xsd:date</xsl:text> | |
| </xsl:when> | |
| <xsl:when test="self::dc:date and text()[matches(.,'^\d{4}\-\d{2}')]"> | |
| <xsl:text>^^xsd:gYearMonth</xsl:text> | |
| </xsl:when> | |
| <xsl:when test="self::dc:date and text()[matches(.,'^\d{4}')]"> | |
| <xsl:text>^^xsd:gYear</xsl:text> | |
| </xsl:when> |