repox package¶
Submodules¶
repox.repox module¶
-
class
repox.repox.
Repox
(repox_url: str, username: str, password: str)[source]¶ Bases:
object
An object to connect to and perform actions in a Repox instance.
-
swagger_endpoint
¶ A string that represents the base URL of the Repox Swagger API.
-
username
¶ The username used to connect to the Swagger API.
-
password
¶ The password used to connect to the Swagger API.
-
headers
¶ A dict to act as the default HTTP header of a request.
-
add_a_record
(dataset_id: str, record_id: str, xml_record: str) → int[source]¶ Add a record to a set.
Todo
(markpbaggett) Although this follows the API docs, this doesn’t seem to do anything.
-
add_mapping
(metadata: dict) → int[source]¶ Add a mapping.
Todo
(markpbaggett) This still needs to be implemented. See note from Simon: https://github.com/europeana/REPOX/issues/40
{ ‘id’: ‘UTKMODSrepaired’, ‘description’: ‘UTK MODS modified for DLTN MODS’, ‘sourceSchemaId’: ‘oai_mods’, ‘destinationSchemaId’: ‘MODS’, ‘stylesheet’: ‘utkmodstomods.xsl’, ‘sourceSchemaVersion’: ‘3.5’, ‘versionTwo’: True}
- Returns
-
assign_provider_to_new_aggregator
(provider_id: str, aggregator_id: str) → int[source]¶ Assign and existing provider to another aggregator.
Requires a provider_id and an aggegator_id and moves the specified provider to the aggregator with the specified aggregator_id.
- Parameters
provider_id (str) – Required. The provider_id of the provider you want to move.
aggregator_id (str) – Required. The aggregator_id of the aggregator you want to assign your provider to.
- Returns
The HTTP status code of your request.
- Return type
int
Examples
>>> Repox("http://localhost:8080", "username", "password").assign_provider_to_new_aggregator("abcd123", ... "NewDLTNr0") 200
-
cancel_running_harvest
(dataset_id: str) → int[source]¶ Cancel a running harvest.
Requires the dataset_id and cancels the associated harvest if it is running. Returns a 404 if its not running.
- Parameters
dataset_id (str) – The dataset_id of the associated dataset.
- Returns
The HTTP status code of the request.
- Return type
int
Examples
>>> Repox("http://localhost:8080", "username", "password").cancel_running_harvest("nr") 200 >>> Repox("http://localhost:8080", "username", "password").cancel_running_harvest("nr") 404
-
copy_dataset
(dataset_id: str, new_dataset_id: str) → int[source]¶ Make a copy of an existing dataset with a new id.
Requires the dataset_id of an existing dataset and creates a new dataset in the same provider based on existing metadata and the value of new_dataset_id.
- Parameters
dataset_id (str) – The dataset_id of the dataset you want to copy.
new_dataset_id (str) – A dataset_id for your new copy of the dataset.
- Returns
The HTTP status code of your request.
- Return type
int
Examples
>>> Repox("http://localhost:8080", "username", "password").copy_dataset("nashville_test2", ... "nashville_test3") 201
-
count_records_from_provider
(provider_id: str) → int[source]¶ Counts records from provider.
Returns the total number of records from a dataset as a string.
- Parameters
provider_id (str) – provider_id of the provider you want details about.
- Returns
The number of records from a provider.
- Return type
int
Examples
>>> Repox("http://localhost:8080", "username", "password").count_records_from_provider("utc") 15652
-
count_records_in_dataset
(data_set_id: str) → int[source]¶ Get the total number of records in a dataset.
Returns the total number of records from a dataset as a string.
- Parameters
data_set_id (str) – The data_set_id of the dataset you’re querying.
- Returns
The total number of records in a dataset as a str.
- Return type
str
Examples
>>> Repox("http://localhost:8080", "username", "password").count_records_in_dataset("cmhf_musicaudio") 7927
-
create_aggregator
(aggregator_id: str, aggregator_name: str, name_code: str = '', homepage: str = '') → int[source]¶ Creates an aggregator.
Requires an identifier and a name for the aggregator. Optionally takes a name_code and a homepage for the new aggregator. If a name_code is not specified, it uses the same string as the aggregator_id. By default, the value of homepage is blank.
- Parameters
aggregator_id (str) – Required. Specify an identifier for the new aggregator.
aggregator_name (str) – Required. Specify a name for the new aggregator.
name_code (str) – Optionally include a name_code for the new aggregator.
homepage (str) – Optionally include a homepage for the new aggregator.
- Returns
The HTTP status code based on your request.
- Return type
int
Examples
>>> Repox('http://localhost:8080', 'username', 'password').create_aggregator("new_dltn", "New DLTN") 201
-
create_dataset
(provider_id: str, metadata: dict) → int[source]¶ Create a dataset.
Takes a provider_id and creates a new dataset in it based on the contents of a metadata dict.
- Parameters
provider_id (str) – The provider_id of the provider that you want to add your new dataset to.
metadata (dict) – Metadata about the new dataset you want to create.
- Returns
The HTTP status code of your request.
- Return type
int
Todo
(markpbaggett) Determine which keys are required and which are not and write something to help with unpacking this.
(markpbaggett) This is all about OAI. What about other things? File sets?
Examples
>>> details = { ... "containerType": "DEFAULT", "dataSource": { "exportDir": "/home/vagrant", "metadataFormat": "oai_dc", ... "marcFormat": "", "recordIdPolicy": { "IdProvided": {} }, "isSample": False, "schema": ... "http://www.openarchives.org/OAI/2.0/oai_dc.xsd", "namespace": "http://purl.org/dc/elements/1.1/", ... "description": "nashville_test", "id": "nashville_test", "dataSetType": "OAI", "oaiSourceURL": ... "https://dpla.lib.utk.edu/repox/OAIHandler", "oaiSet": "p15769coll18" }, "name": "nashville_test", ... "nameCode": "nashville_test" } >>> Repox("http://localhost:8080", "username", "password").create_dataset("nashville", details) 201
-
create_provider
(aggregator_id: str, metadata: dict) → int[source]¶ Create a provider in a specific aggregator.
Requires an aggregator_id and adds a new provider based on the contents of a metadata dict.
- Parameters
aggregator_id (str) – Required. The aggregator_id of the aggregator you are adding your provider to.
metadata (dict) – Required. Key value pairs that describe the provider you are creating.
- Returns
The HTTP status code of the request.
- Return type
int
Todo
(markpbaggett) Describe the required parts of a metadata dict.
(markpbaggett) Add a static method to check the contents of metadata to avoid 400 / 406 status codes.
Examples
>>> Repox('http://localhost:8080', 'username', 'password').create_provider("dltn", {"id": "utc", "name": ... "UT Chattanooga", "country": "United States", "countryCode": "", "description": ... "OAI Sets from the University of Tennessee, Chattanooga", "nameCode": "utc", "homepage": ... "http://cdm16877.contentdm.oclc.org", "providerType": "LIBRARY", "email": "carolyn-runyon@utc.edu"}) 201
-
delete_aggregator
(aggregator_id: str) → int[source]¶ Delete an aggregator.
Delete an aggregator by specifying its aggregator_id.
- Parameters
aggregator_id (str) – Required. The aggregator_id of the aggregator you want to delete.
- Returns
The HTTP status code of your request.
- Return type
int
Examples
>>> Repox('http://localhost:8080', 'username', 'password').delete_aggregator("new_dltn") 200
-
delete_automatic_harvesting_task
(dataset_id: str, task_id: str) → int[source]¶ Delete an automatic harvesting task.
Requires the dataset_id of the set and the task_id related to the scheduled task and deletes it.
- Parameters
dataset_id (str) – The dataset_id of the associated dataset.
task_id (str) – The task_id of the associated task.
- Returns
The HTTP status code of a request.
- Return type
int
Examples
>>> Repox("http://localhost:8080", "username", "password").delete_automatic_harvesting_task("nr", "nr_3") 200
-
delete_dataset
(dataset_id: str) → int[source]¶ Delete a dataset.
Requires the dataset_id and deletes the corresponding dataset.
- Parameters
dataset_id (str) – The dataset_id of the dataset you want to delete.
- Returns
The HTTP status code of your request.
- Return type
int
Examples
>>> Repox("http://localhost:8080", "username", "password").delete_dataset("nashville_test") 200
-
delete_provider
(provider_id: str) → int[source]¶ Delete a provider.
Requires a provider_id and deletes the corresponding provider in Repox.
- Parameters
provider_id (str) – The provider_id of the provider you want to delete.
- Returns
The HTTP status code of your request.
- Return type
int
Examples
>>> Repox("http://localhost:8080", "username", "password").delete_provider("abcd123") 200
-
delete_record
(record_id: str) → int[source]¶ Accepts a record id and deletes the corresponding record.
- Parameters
record_id (*) – a record_id of a record based on OAI_PMH.
- Returns
The HTTP status code of the request.
- Return type
int
Todo
(markpbaggett) While this returns a 200, it does not seem to do anything. Post an issue in Repox GitHub repo about this.
Examples
>>> Repox("http://localhost:8080", "username", "password").delete_record( ... "urn:dpla.lib.utk.edu.p16877coll1:oai:cdm16877.contentdm.oclc.org:p16877coll1/17") 200
-
export_dataset
(dataset_id: str) → int[source]¶ Exports a metadata records from a dataset to disk.
Requires a dataset_id and exports the records associated with it to disk based on the value of its exportDir. Use update_dataset to modify the value of exportDir.
- Parameters
dataset_id (str) – The dataset_id of the dataset you want to export.
- Returns
The HTTP status code of your request.
- Return type
int
Todo
(markpbaggett) This returns a 200 even if permissions are wrong. Can we do something about this.
Examples
>>> Repox("http://localhost:8080", "username", "password").export_dataset("nr") 200
-
get_aggregator
(aggregator_id: str) → dict[source]¶ Takes an aggregator id and returns metadata about the aggregator as a dict.
- Parameters
aggregator_id (str) – Specify the aggregator you wish to return.
- Returns
A dict of metadata about the specified aggregator.
- Return type
dict
Examples
>>> Repox('http://localhost:8080', 'username', 'password').get_aggregator("dltn") {'id': 'dltn', 'name': 'DLTN Test', 'nameCode': 'dltn', 'homepage': 'http://localhost:8080/repox'}
-
get_aggregator_options
() → dict[source]¶ Get details from Repox Swagger about all the Aggregator APIs.
This is a direct implementation of an API from Repox.
- Returns
Details about the Aggregator Options.
- Return type
dict
Examples
>>> Repox("http://localhost:8080", "username", "password").get_aggregator_options() {'option': [{'description': '[OPTIONS]Get options over Aggregators.', 'syntax': 'http://localhost:8080/repox/rest/aggregators'}, {'description': '[GET]Get options over Aggregators.', 'syntax': 'http://localhost:8080/repox/rest/aggregators/options'}, {'description': '[GET]Gets an Aggregator by Id.', 'syntax': 'http://localhost:8080/repox/rest/aggregators/{aggregatorId}'}, {'description': '[POST]Create an aggregator provided in the body of the post call.', 'syntax': 'http://localhost:8080/repox/rest/aggregators'}, {'description': '[DELETE]Delete an aggregator by specifying the Id.', 'syntax': 'http://localhost:8080/repox/rest/aggregators/{aggregatorId}'}, {'description': '[PUT]Update an aggregator by specifying the Id on the context path.', 'syntax': 'http://localhost:8080/repox/rest/aggregators/{aggregatorId}'}, {'description': '[GET]Get a list of aggregators by specifying a range.', 'syntax': 'http://localhost:8080/repox/rest/aggregators', 'queryParameter': ['offset', 'number']}]}
-
get_dataset_details
(data_set_id: str) → dict[source]¶ Get details about a specific dataset.
Requires a data_set_id and returns metadata about it as a dict.
- Parameters
data_set_id (str) – data_set_id of the dataset you want details about.
- Returns
Details about the dataset as a dict.
- Return type
dict
Examples
>>> Repox("http://localhost:8080", "username", "password").get_dataset_details("nr") {'containerType': 'DEFAULT', 'dataSource': {'dataSetType': 'OAI', 'id': 'nr', 'schema': 'http://www.openarchives.org/OAI/2.0/oai_dc.xsd', 'namespace': 'http://www.openarchives.org/OAI/2.0/', 'description': "Nashville Public Library's Digital Collections", 'metadataFormat': 'oai_dc', 'isSample': False, 'exportDir': '/vhosts/repoxdata/export/nr', 'oaiSourceURL': 'http://nashville.contentdm.oclc.org/oai/oai.php', 'oaiSet': 'nr', 'recordIdPolicy': {'IdProvided': {}}}, 'nameCode': 'nashvillepublic_nr', 'name': 'Nashville Public Library nr'}" >>> Repox("http://localhost:8080", "username", "password").get_dataset_details("cmhf_musicaudio") {'containerType': 'DEFAULT', 'dataSource': {'dataSetType': 'DIR', 'id': 'cmhf_musicaudio', 'schema': 'http://worldcat.org/xmlschemas/qdc/1.0/qdc-1.0.xsd', 'namespace': 'http://worldcat.org/xmlschemas/qdc-1.0', 'description': 'cmhf_musicaudio', 'metadataFormat': 'oai_qdc', 'isSample': False, 'exportDir': '/vhosts/repoxdata/export/cmhf_musicaudio', 'marcFormat': '', 'sourcesDirPath': '/vhosts/repoxdata/cmhf_qdc', 'recordXPath': 'oai_qdc:qualifieddc', 'isoVariant': 'STANDARD', 'recordIdPolicy': {'IdGenerated': {}}, 'retrieveStrategy': {'FOLDER': {}}}, 'nameCode': 'cmhf_musicaudio', 'name': 'cmhf_musicaudio'}
-
get_last_ingest_date_of_set
(data_set_id: str) → str[source]¶ Get the last time a datset was ingested or updated.
Returns the last ingestion date of a dataset as a string.
- Parameters
data_set_id (str) – The data_set_id of the dataset you’re querying.
- Returns
The last ingestion date as a str.
- Return type
str
Examples
>>> Repox("http://localhost:8080", "username", "password").get_last_ingest_date_of_set("cmhf_musicaudio") "12/14/2018 08:56:32"
-
get_list_of_providers
(aggregator_id: str, verbose: bool = False) → list[source]¶ Get a list of providers and its metadata for a specific aggregator.
Requires an aggregator id and returns the providers that belong to it as a list. Optionally, you can also return metadata about each provider.
- Parameters
aggregator_id (str) – Required. The aggregator_id of the providers you want to return.
verbose (bool) – Optional. If True, return metadata about each provider.
- Returns
The list of providers that match your request.
- Return type
list
Examples
>>> Repox('http://localhost:8080', 'username', 'password').get_list_of_providers("TNDPLAr0") ['CountryMusicHallofFamer0', 'CrossroadstoFreedomr0', 'KnoxPLr0', 'memphispublicr0', 'MTSUr0', 'nashvillepublicr0', 'tslar0', 'utcr0', 'UTKr0']
>>> Repox('http://localhost:8080', 'username', 'password').get_list_of_providers("TNDPLAr0", True) [{'id': 'CountryMusicHallofFamer0', 'name': 'Country Music Hall of Fame', 'countryCode': 'al', 'description': '', 'nameCode': '', 'homepage': 'http://digi.countrymusichalloffame.org/oai/oai.php', 'providerType': 'MUSEUM', 'email': ''}, {'id': 'CrossroadstoFreedomr0', 'name': 'CrossroadstoFreedom', 'countryCode': 'de', 'description': '', 'nameCode': '', 'homepage': '', 'providerType': 'ARCHIVE', 'email': ''}, {'id': 'KnoxPLr0', 'name': 'Knoxville Public Library', 'countryCode': 'al', 'description': '', 'nameCode': 'KnoxPublicLibrary', 'homepage': '', 'providerType': 'LIBRARY', 'email': ''}, {'id': 'memphispublicr0', 'name': 'Memphis Public Library', 'countryCode': 'al', 'description': '', 'nameCode': 'memphispublic', 'homepage': '', 'providerType': 'LIBRARY', 'email': ''}, {'id': 'MTSUr0', 'name': 'Middle Tennessee State University', 'countryCode': 'al', 'description': '', 'nameCode': 'mtsu', 'homepage': '', 'providerType': 'LIBRARY', 'email': ''}, {'id': 'nashvillepublicr0', 'name': 'Nashville Public Library', 'countryCode': 'al', 'description': '', 'nameCode': 'nashvillepublic', 'homepage': '', 'providerType': 'LIBRARY', 'email': ''}, {'id': 'tslar0', 'name': 'Tennessee State Library', 'countryCode': 'al', 'description': '', 'nameCode': 'tsla', 'homepage': '', 'providerType': 'LIBRARY', 'email': ''}, {'id': 'utcr0', 'name': 'UT Chattanooga', 'countryCode': 'al', 'description': '', 'nameCode': 'utc', 'homepage': '', 'providerType': 'MUSEUM', 'email': ''}, {'id': 'UTKr0', 'name': 'UTK', 'countryCode': 'al', 'description': 'University of Tennessee Knoxville', 'nameCode': '', 'homepage': '', 'providerType': 'LIBRARY', 'email': ''}]
-
get_list_of_running_harvests
() → str[source]¶ Returns a message about currently running harvests.
Todo
(markpbaggett) This seems to always return a 405 status code: method not allowed for the requested resource. Find out why.
-
get_list_of_scheduled_harvests_by_provider
(provider_id: str) → list[source]¶ Get a list of scheduled harvests by provider.
Requires a provider_id. Iterates through all datasets and appends its list of schedued harvests if not empty.
- Parameters
provider_id (str) – The provider_id of the provider you are querying.
- Returns
A list of lists of scheduled harvests for each set is harvests are scheduled for any sets.
- Return type
list
Examples
>>> Repox("http://localhost:8080", "username", "password").get_list_of_scheduled_harvests_by_provider( ... 'utcr0') []
-
get_list_of_sets_from_provider
(provider_id: str, verbose: bool = False) → list[source]¶ Get list of datasets associated with a provider.
Requires a provider id and returns the data sets associated with it. If verbose is true, metadata about each set is also included in the response.
- Parameters
provider_id (str) – Required. The provider_id of the provider from which you want sets returned.
verbose (bool) – Optional. Set to True if you want metadata in your response. Defaults to False.
- Returns
A list of datasets and optionally each’s metadata.
- Return type
list
Examples
>>> Repox("http://localhost:8080", "username", "password").get_list_of_sets_from_provider("utcr0") ['p16877coll1', 'p16877coll2', 'p16877coll3', 'p16877coll4', 'p16877coll5', 'p16877coll6', 'p16877coll7', 'p16877coll8', 'p16877coll9', 'utc_p16877coll10', 'utc_p16877coll11', 'utc_p16877coll12', 'utc_p16877coll13', 'utc_p16877coll14', 'utc_p16877coll15', 'utc_p16877coll16', 'utc_p16877coll17', 'utc_p16877coll18', 'utc_p16877coll19', 'utc_p16877coll20', 'utc_p16877coll21', 'utc_p16877coll22', 'utc_p16877coll23', 'utc_p16877coll24', 'utc_p16877coll25', 'utc_p16877coll26', 'utc_p16877coll27', 'utc_p16877coll28'] >>> Repox("http://localhost:8080", "username", "password").get_list_of_sets_from_provider("nashviller0", ... True) [{'containerType': 'DEFAULT', 'dataSource': {'dataSetType': 'OAI', 'id': 'nr', 'schema': 'http://www.openarchives.org/OAI/2.0/oai_dc.xsd', 'namespace': 'http://www.openarchives.org/OAI/2.0/', 'description': "Nashville Public Library's Digital Collections", 'metadataFormat': 'oai_dc', 'isSample': False, 'exportDir': '/vhosts/repoxdata/export/nr', 'oaiSourceURL': 'http://nashville.contentdm.oclc.org/oai/oai.php', 'oaiSet': 'nr', 'recordIdPolicy': {'IdProvided': {}}}, 'nameCode': 'nashvillepublic_nr', 'name': 'Nashville Public Library nr'}, {'containerType': 'DEFAULT', 'dataSource': {'dataSetType': 'OAI', 'id': 'p15769coll18', 'schema': 'http://www.openarchives.org/OAI/2.0/oai_dc.xsd', 'namespace': 'http://www.openarchives.org/OAI/2.0/', 'description': "Nashville's New Faces", 'metadataFormat': 'oai_dc', 'isSample': False, 'exportDir': '/vhosts/repoxdata/export/p15769coll18', 'oaiSourceURL': 'http://nashville.contentdm.oclc.org/oai/oai.php', 'oaiSet': 'p15769coll18', 'recordIdPolicy': {'IdProvided': {}}}, 'nameCode': 'nashvillepublic_p15769coll18', 'name': 'Nashville Public Library p15769coll18'}, {'containerType': 'DEFAULT', 'dataSource': {'dataSetType': 'DIR', 'id': 'nash_p15769coll19', 'schema': 'http://worldcat.org/xmlschemas/qdc/1.0/qdc-1.0.xsd', 'namespace': 'http://worldcat.org/xmlschemas/qdc-1.0', 'description': 'Picturing Nashville in Rotogravure, 1926-1933', 'metadataFormat': 'oai_qdc', 'isSample': False, 'exportDir': '/vhosts/repoxdata/export/nash_p15769coll19', 'marcFormat': '', 'sourcesDirPath': '/vhosts/repoxdata/nash_p15769coll19', 'recordXPath': 'oai_qdc:qualifieddc', 'isoVariant': 'STANDARD', 'recordIdPolicy': {'IdGenerated': {}}, 'retrieveStrategy': {'FOLDER': {}}}, 'nameCode': 'nash_p15769coll19', 'name': 'nash_p15769coll19'}]
-
get_list_of_sets_from_provider_by_format
(provider_id: str) → list[source]¶ Gets a list of sets with the metadata format.
Requires a provider_id and returns dicts with the id of the set and its format.
- Parameters
provider_id (str) – The provider_id of a provider.
- Returns
A list of provider_ids and formats as dicts.
- Return type
list
Example
>>> Repox("http://localhost:8080", "username", "password").get_list_of_sets_from_provider_by_format( ... "KnoxPLr0") [{'name': 'p15136coll1', 'format': 'oai_dc'}, {'name': 'p15136coll2', 'format': 'oai_dc'}, {'name': 'p16311coll1', 'format': 'oai_dc'}, {'name': 'p16311coll2', 'format': 'oai_dc'}, {'name': 'p265301coll005', 'format': 'oai_dc'}, {'name': 'p265301coll7', 'format': 'oai_dc'}, {'name': 'p265301coll9', 'format': 'oai_dc'}]
-
get_log_of_last_harvest
(dataset_id: str) → str[source]¶ Get the log of the last harvest.
Requires a dataset_id and returns the log of the last ingest as a string of XML.
- Parameters
dataset_id (str) – The dataset_id of the associated dataset.
- Returns
The log of the last harvest as a str of XML.
- Return type
str
Examples
>>> Repox("http://localhost:8080", "username", "password").get_log_of_last_harvest("new_bcpl") '\n<report> \n <status>OK</status> \n <dataSetId>new_bcpl</dataSetId> \n <startTime>2018-12-28 05:00:50</startTime> \n <endTime>2018-12-28 05:00:52</endTime> \n <duration>00:00:01</duration> \n <records>93</records> \n <deleted>0</deleted> \n <summary> \n <info time="2018-12-28 05:00:50 UTC" class="pt.utl.ist.oai.OaiDataSource">Starting to import from Data Source with id new_bcpl</info> \n <info time="2018-12-28 05:00:51 UTC" class="pt.utl.ist.oai.OaiHarvester">Starting OAI Harvest URL: https://dpla.lib.utk.edu/repox/OAIHandler - Set:bcpl</info> \n <info time="2018-12-28 05:00:51 UTC" class="pt.utl.ist.oai.OaiHarvester">sourceUrl: https://dpla.lib.utk.edu/repox/OAIHandler, sourceSet: bcpl, outputBaseDir: /data/repoxData/[temp]OAI-PMH_Requests/-bcpl, fromDateString: null, untilDateString: null, metadataFormat: mods</info> \n <info time="2018-12-28 05:00:51 UTC" class="pt.utl.ist.oai.OaiHarvester"> Harvest finished - number of requests: 1</info> \n <info time="2018-12-28 05:00:51 UTC" class="pt.utl.ist.oai.OaiHarvester">Response was an empty list in operation ListRecords (may be invalid set or does not exist new records from the last ingest)</info> \n <info time="2018-12-28 05:00:51 UTC" class="pt.utl.ist.oai.OaiHarvester">Finished OAI Harvest URL: https://dpla.lib.utk.edu/repox/OAIHandler - Set:bcpl</info> \n <info time="2018-12-28 05:00:52 UTC" class="pt.utl.ist.oai.ResponseTransformer"> Starting to split OAI-PMH request to Record Files</info> \n <info time="2018-12-28 05:00:52 UTC" class="pt.utl.ist.oai.ResponseTransformer">Finished splitting OAI-PMH request to List</info> \n <info time="2018-12-28 05:00:52 UTC" class="pt.utl.ist.oai.OaiDataSource">Ingest Process ended. Exiting. </info> \n <info time="2018-12-28 05:00:52 UTC" class="pt.utl.ist.oai.OaiDataSource">Finished importing from Data Source with id new_bcpl. Exit status: OK</info> \n </summary> \n</report>'
-
get_mapping_details
(mapping_id: str) → dict[source]¶ Returns metadata about a mapping as a dict.
Requires the mapping_id of a mapping and returns metadata about it as a dict.
- Parameters
mapping_id (str) – The mapping_id of a mapping.
- Returns
Metadata about the mapping.
- Return type
dict
Examples
>>> Repox("http://localhost:8080", "username", "password").get_mapping_details("UTKMODSrepaired") {'id': 'UTKMODSrepaired', 'description': 'UTK MODS modified for DLTN MODS', 'sourceSchemaId': 'oai_mods', 'destinationSchemaId': 'MODS', 'stylesheet': 'utkmodstomods.xsl', 'sourceSchemaVersion': '3.5', 'versionTwo': True}
-
get_options_for_harvests
() → dict[source]¶ Get details from Repox Swagger about all the Harvest APIs.
This is a direct implementation of an API from Repox.
- Returns
Details about Harvest APIs.
- Return type
dict
Examples
>>> Repox("http://localhost:8080", "username", "password").get_options_for_harvests() {'option': [{'description': '[OPTIONS]Get options over dataset.', 'syntax': 'http://localhost:8080/repox/rest/datasets/harvest'}, {'description': '[GET]Get options over dataset.', 'syntax': 'http://localhost:8080/repox/rest/datasets/harvest/options'}, {'description': '[POST]Initiates a new harvest of the dataset with id.', 'syntax': 'http://localhost:8080/repox/rest/datasets/{datasetId}/harvest/start', 'queryParameter': ['type']}, {'description': '[DELETE]Cancels a harvesting ingest.', 'syntax': 'http://localhost:8080/repox/rest/datasets/{datasetId}/harvest/cancel'}, {'description': '[POST]Schedules an automatic harvesting.', 'syntax': 'http://localhost:8080/repox/rest/datasets/{datasetId}/harvest/schedule', 'queryParameter': ['incremental']}, {'description': '[GET]Retrieves the list of schedules.', 'syntax': 'http://localhost:8080/repox/rest/datasets/{datasetId}/harvest/schedules'}, {'description': '[DELETE]Deletes an automatic harvesting.', 'syntax': 'http://localhost:8080/repox/rest/datasets/{datasetId}/harvest/schedules/{taskId}'}, {'description': '[GET]Gets the status of a specific dataset harvesting.', 'syntax': 'http://localhost:8080/repox/rest/datasets/{datasetId}/harvest/status'}, {'description': '[GET]Gets the logs of the last ingest.', 'syntax': 'http://localhost:8080/repox/rest/datasets/{datasetId}/harvest/log'}, {'description': '[GET]Gets a list of currently executing dataset harvests.', 'syntax': 'http://localhost:8080/repox/rest/datasets/harvests'}]}
-
get_options_for_mappings
() → dict[source]¶ Get details from Repox Swagger about all the Mappings APIs.
This is a direct implementation of an API from Repox.
- Returns
Details about Mappings APIs.
- Return type
dict
Examples
>>> Repox("http://localhost:8080", "username", "password").get_options_for_mappings() {'option': [{'description': '[OPTIONS]Get options over mappings.', 'syntax': 'http://localhost:8080/repox/rest/mappings'}, {'description': '[GET]Get options over mappings.', 'syntax': 'http://localhost:8080/repox/rest/mappings/options'}, {'description': '[POST]Create a new mapping - XSL file through HTTP POST.', 'syntax': 'http://localhost:8080/repox/rest/mappings'}, {'description': '[GET]Retrieve a mapping.', 'syntax': 'http://localhost:8080/repox/rest/mappings/mappingId'}, {'description': '[PUT]Update a mapping.', 'syntax': 'http://localhost:8080/repox/rest/mappings/mappingId'}, {'description': '[DELETE]Delete a mapping.', 'syntax': 'http://localhost:8080/repox/rest/mappings/mappingId'}]}
-
get_options_for_records
() → dict[source]¶ Get details from Repox Swagger about all the Records APIs.
This is a direct implementation of an API from Repox.
- Returns
Details about Records APIs.
- Return type
dict
Examples
>>> Repox("http://localhost:8080", "username", "password").get_options_for_records() {'option': [{'description': '[OPTIONS]Get options over Records.', 'syntax': 'http://localhost:8080/repox/rest/records'}, {'description': '[GET]Get options over Records.', 'syntax': 'http://localhost:8080/repox/rest/records/options'}, {'description': '[GET]Retrieve the record with the provided id.', 'syntax': 'http://localhost:8080/repox/rest/records', 'queryParameter': ['recordId']}, {'description': '[DELETE]Deletes (mark) or permanently erase a record.', 'syntax': 'http://localhost:8080/repox/rest/records', 'queryParameter': ['recordId', 'type']}, {'description': '[POST]Create a new record.', 'syntax': 'http://localhost:8080/repox/rest/records', 'queryParameter': ['datasetId', 'recordId']}]}
-
get_provider
(provider_id: str) → dict[source]¶ Get metadata about a provider.
Requires a provider id and returns metadata about it.
- Parameters
provider_id (str) – The provider_id of the provider you want to return.
- Returns
The metadata about your specified provider.
- Return type
dict
Examples
>>> Repox('http://localhost:8080', 'username', 'password').get_provider("UTKr0") {'id': 'UTKr0', 'name': 'UTK', 'countryCode': 'al', 'description': 'University of Tennessee Knoxville', 'nameCode': '', 'homepage': '', 'providerType': 'LIBRARY', 'email': ''}
-
get_recently_ingested_sets_by_aggregator
(aggregator_id: str, since: str = 'YYYY-MM-DD')[source]¶ Returns a list of tuples ordered by date of last ingest with dataset_id
Requires an aggregator_id and optionally takes a date as the since parameter. Returns a list of datasets as tuples with date of last ingest based on the since parameter.
- Args:
aggregator_id (str): Requrired. The aggregator_id to search providers for. since (str): Optional. A date in YYYY-MM-DD format to limit results by.
- Returns
A list of datasets and last ingest dates as tuples ordered by date of last ingest.
- Return type
list
Examples
>>> Repox("http://localhost:8080", "username", "password").get_recently_ingested_sets_by_aggregator( ... 'TNDPLAr0', '2019-03-01') [('utk_volvoices', '03/18/2019 10:53:05'), ('utc_p16877coll30', '03/18/2019 10:25:49'), ('utc_p16877coll29', '03/18/2019 10:25:19'), ('utk_cdf', '03/18/2019 09:54:49'), ('utk_agrtfhs', '03/18/2019 08:55:49'), ('p16877coll9', '03/13/2019 12:08:51'), ('utc_p16877coll28', '03/13/2019 11:49:51'), ('utc_p16877coll27', '03/13/2019 11:47:51'), ('utc_p16877coll26', '03/13/2019 11:46:06'), ('utc_p16877coll25', '03/13/2019 11:45:06'), ('utc_p16877coll24', '03/13/2019 11:38:06'), ('utc_p16877coll23', '03/13/2019 11:36:21'), ('utc_p16877coll15', '03/13/2019 11:30:21'), ('utc_p16877coll22', '03/13/2019 11:20:06'), ('utc_p16877coll21', '03/13/2019 11:17:36'), ('utc_p16877coll20', '03/13/2019 11:16:06'), ('utc_p16877coll19', '03/13/2019 11:13:06'), ('utc_p16877coll18', '03/13/2019 11:10:21'), ('utc_p16877coll17', '03/13/2019 11:09:21'), ('utc_p16877coll16', '03/13/2019 11:05:36'), ('utc_p16877coll14', '03/13/2019 10:59:21'), ('utc_p16877coll13', '03/13/2019 10:57:51'), ('utc_p16877coll12', '03/13/2019 10:56:51'), ('utc_p16877coll11', '03/13/2019 10:54:51'), ('utc_p16877coll10', '03/13/2019 10:53:21'), ('p16877coll8', '03/13/2019 10:51:06'), ('p16877coll7', '03/13/2019 10:49:51'), ('p16877coll6', '03/13/2019 10:44:51'), ('p16877coll5', '03/13/2019 10:43:36'), ('p16877coll4', '03/13/2019 10:31:06'), ('p16877coll3', '03/13/2019 10:28:36'), ('p16877coll2', '03/13/2019 10:25:36'), ('p16877coll1', '03/13/2019 10:20:51'), ('p15138coll33', '03/12/2019 11:49:30'), ('rhodes_farnsworth', '03/12/2019 11:43:45'), ('rhodes_sternberg', '03/12/2019 11:43:30'), ('utk_emancip', '03/07/2019 11:11:16'), ('utk_druid', '03/07/2019 10:17:31'), ('utk_indtruth', '03/07/2019 10:13:46'), ('utk_brehm', '03/07/2019 10:03:46'), ('utk_phoenix', '03/07/2019 09:18:31'), ('utk_3d', '03/07/2019 09:01:00'), ('utk_vanvactor', '03/07/2019 08:37:00'), ('utc_p16877coll31', '03/07/2019 08:19:45'), ('utk_wderfilms', '03/05/2019 09:21:24')]
-
get_recently_ingested_sets_by_provider
(provider_id: str, since: str = 'YYYY-MM-DD') → list[source]¶ Get an ordered list of recently updated sets as a list of tuples.
- Parameters
provider_id (str) – Required. The id of the aggregator you want
since (str) – Optional. Date of last ingest
- Returns
A list of tuples with dataset_id and date of last ingest.
- Return type
list
Examples
>>> Repox("http://localhost:8080", "username", "password").get_recently_ingested_sets_by_provider('utcr0') [('utc_p16877coll30', '03/18/2019 10:25:49'), ('utc_p16877coll29', '03/18/2019 10:25:19'), ('p16877coll9', '03/13/2019 12:08:51'), ('utc_p16877coll28', '03/13/2019 11:49:51'), ('utc_p16877coll27', '03/13/2019 11:47:51'), ('utc_p16877coll26', '03/13/2019 11:46:06'), ('utc_p16877coll25', '03/13/2019 11:45:06'), ('utc_p16877coll24', '03/13/2019 11:38:06'), ('utc_p16877coll23', '03/13/2019 11:36:21'), ('utc_p16877coll15', '03/13/2019 11:30:21'), ('utc_p16877coll22', '03/13/2019 11:20:06'), ('utc_p16877coll21', '03/13/2019 11:17:36'), ('utc_p16877coll20', '03/13/2019 11:16:06'), ('utc_p16877coll19', '03/13/2019 11:13:06'), ('utc_p16877coll18', '03/13/2019 11:10:21'), ('utc_p16877coll17', '03/13/2019 11:09:21'), ('utc_p16877coll16', '03/13/2019 11:05:36'), ('utc_p16877coll14', '03/13/2019 10:59:21'), ('utc_p16877coll13', '03/13/2019 10:57:51'), ('utc_p16877coll12', '03/13/2019 10:56:51'), ('utc_p16877coll11', '03/13/2019 10:54:51'), ('utc_p16877coll10', '03/13/2019 10:53:21'), ('p16877coll8', '03/13/2019 10:51:06'), ('p16877coll7', '03/13/2019 10:49:51'), ('p16877coll6', '03/13/2019 10:44:51'), ('p16877coll5', '03/13/2019 10:43:36'), ('p16877coll4', '03/13/2019 10:31:06'), ('p16877coll3', '03/13/2019 10:28:36'), ('p16877coll2', '03/13/2019 10:25:36'), ('p16877coll1', '03/13/2019 10:20:51'), ('utc_p16877coll31', '03/07/2019 08:19:45')] >>> Repox("http://localhost:8080", "username", "password").get_recently_ingested_sets_by_provider('utcr0', ... '2019-03-14') [('utc_p16877coll30', '03/18/2019 10:25:49'), ('utc_p16877coll29', '03/18/2019 10:25:19')]
-
get_record
(record_id: str) → str[source]¶ Get a specific record.
Requires an OAI id from //record/header/identifier and returns the value of //record/metadata as a string if it exists. If there is no metadata xpath, an exception is thrown and an error string is returned.
- Parameters
record_id (str) – The OAI identifier from //record/header/identifier
- Returns
The value of //record/metadata if it exists. If not, an error string.
- Return type
str
Examples
>>> Repox("http://localhost:8080", "username", "password").get_record( ... "oai:dltn.repox.test.new_bcpl:urn:dpla.lib.utk.edu.bcpl:bcpl_123") '\n<mods xmlns="http://www.loc.gov/mods/v3" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.5" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-5.xsd"> \n <identifier type="local">bcpl_00775</identifier> \n <titleInfo> \n <title>Macklin Kerr House (NR)</title> \n </titleInfo> \n <typeOfResource>still image</typeOfResource> \n <originInfo> \n <dateCreated>1847</dateCreated> \n <dateCreated encoding="edtf" keyDate="yes">1847</dateCreated> \n </originInfo> \n <physicalDescription> \n <form authority="aat" valueURI="http://vocab.getty.edu/aat/300046300">photographs</form> \n <digitalOrigin>reformatted digital</digitalOrigin> \n </physicalDescription> \n <abstract>Architectural -- two story brick with frame side and rear additions; built 1847</abstract> \n <abstract>Historical -- site of Gen. O. O. Howard's headquarters during the Federal Army's visit to Blount County, December 1863. </abstract> \n <language> \n <languageTerm authority="iso639-2b" type="code">zxx</languageTerm> \n </language> \n <note>This structure appears on the National Historical Registry.</note> \n <note>Ownership: Private; Current Use: Residence</note> \n <note>Address: Big Gully Rd., 0.3 mi. N. of Kyker Rd., Maryville, TN</note> \n <location> \n <physicalLocation>Blount County Public Library </physicalLocation> \n <url access="object in context" usage="primary display"> https://digital.lib.utk.edu/collections/islandora/object/bcpl%3A123</url> \n <url access="preview"> https://digital.lib.utk.edu/collections/islandora/object/bcpl%3A123/datastream/TN/view</url> \n </location> \n <subject authority="lcsh" valueURI="http://id.loc.gov/authorities/subjects/sh85061097"> \n <topic>Historic buildings</topic> \n </subject> \n <subject> \n <geographic authority="naf" valueURI="http://id.loc.gov/authorities/names/n81025935">Blount County (Tenn.)</geographic> \n <cartographics> \n <coordinates>35.68724, -83.92553</coordinates> \n </cartographics> \n </subject>\n <subject> \n <hierarchicalGeographic> \n <country>United States</country> \n <state>Tennessee</state> \n <city>Maryville</city> \n <citySection>Street: Big Gully Road, 0.3 mile North of Kyker Road</citySection> \n </hierarchicalGeographic> \n </subject> \n <relatedItem displayLabel="Project" type="host"> \n <titleInfo> \n <title>Blount County Historical and Architectural Inventory</title> \n </titleInfo> \n </relatedItem> \n <accessCondition type="local rights statement">Digital Image Copyright (c) 2004. Blount County Public Library, Maryville, TN. All Rights Reserved. For permission to use, contact: Reference Department, Blount County Public Library, 508 N. Cusick Street, Maryville, TN 37804 (865-982-0982).</accessCondition> \n <recordInfo> \n <recordIdentifier> record_bcpl_00775</recordIdentifier> \n <recordContentSource>University of Tennessee, Knoxville Libraries</recordContentSource> \n <languageOfCataloging> \n <languageTerm authority="iso639-2b" type="code">eng</languageTerm> \n </languageOfCataloging> \n <recordOrigin>Created and edited in general conformance to MODS Guidelines (Version 3.5).</recordOrigin> \n </recordInfo> \n</mods>' >>> Repox("http://localhost:8080", "username", "password").get_record( ... "urn:dpla.lib.utk.edu.p16877coll1:oai:cdm16877.contentdm.oclc.org:p16877coll1/17") "REPOX Error: This is a generic error and is thrown when Repox can't find a matching metadata. This can be caused by an OAI record with the status of deleted."
-
get_scheduled_harvests
(dataset_id: str) → list[source]¶ Get currently scheduled harvests for a give dataset.
Requires a dataset_id and returns a list of scheduled harvests for that dataset.
- Parameters
dataset_id (str) – The dataset_id of the dataset you are querying.
- Returns
A list of scheduled harvests as dicts.
- Return type
list
Todo
(markpbaggett): Implement a method to get a list of all scheduled harvests from a particular provider.
Examples
>>> Repox("http://localhost:8080", "username", "password").get_scheduled_harvests("nr") [{'taskType': 'SCHEDULED', 'id': 'nr_3', 'frequency': 'WEEKLY', 'xmonths': 1, 'time': '23:45', 'date': '27/12/2018'}]
-
get_statistics
() → dict[source]¶ Get statistics about an entire Repox instance.
- Returns
A dict of statistics.
- Return type
dict
Examples
>>> Repox("http://localhost:8080", "username", "password").get_statistics() '{"repox-statistics": {"@generationDate": "2018-12-27 16:08:02 EST", "dataSourcesIdExtracted": "0", "dataSourcesIdGenerated": "11", "dataSourcesIdProvided": "175", "aggregators": "1", "dataProviders": "9", "dataSourcesOai": "175", "dataSourcesZ3950": "0", "dataSourcesDirectoryImporter": "11", "dataSourcesMetadataFormats": {"dataSourcesMetadataFormat": [{"metadataFormat": "mods", "dataSources": "45", "records": "25636"}, {"metadataFormat": "oai_dc", "dataSources": "86", "records": "160203"}, { "metadataFormat": "oai_qdc", "dataSources": "55", "records": "30799"}]}, "recordsAvgDataSource": "1164.7205", "recordsAvgDataProvider": "24070.889", "countriesRecords": {"countryRecords": [{"@country": "al", "records": "100853"}, {"@country": "de", "records": "115785"}]}, "recordsTotal": "216638"}}'
-
get_status_of_harvest
(dataset_id: str) → dict[source]¶ Get status of most recent harvest of a dataset.
Requires a dataset_id and returns the status of its last harvest.
- Parameters
dataset_id (str) – The dataset_id of the dataset you are queryings.
- Returns
A dict with a key result with the status of the last harvest.
- Return type
dict
Examples
>>> Repox("http://localhost:8080", "username", "password").get_status_of_harvest("nr") {'result': 'CANCELED'} >>> Repox("http://localhost:8080", "username", "password").get_status_of_harvest("nr") {'result': 'RUNNING'} >>> Repox("http://localhost:8080", "username", "password").get_status_of_harvest("nr") {'result': 'OK'}
-
harvest_set
(dataset_id: str, is_sample: bool = False) → int[source]¶ Harvest a dataset.
Requires a dataset_id and optionally accepts an is_sample parameter and triggers a harvest of the specified dataset.
- Parameters
dataset_id (str) – Required. The dataset_id associated with a dataset.
is_sample (bool) – Optional. Specify whether to harvest the full set or just a sample.
- Returns
The HTTP status code of your request.
- Return type
int
Examples
>>> Repox("http://localhost:8080", "username", "password").get_status_of_harvest("new_bcpl") 200
-
list_all_aggregators
(verbose: bool = False) → list[source]¶ Returns all aggregators and optionally metadata about each.
This method returns all aggregators for this Repox install. Optionally, you can also retrieve metadata about each aggregator by passing True to the verbose parameter. By default, this value is False.
- Parameters
verbose (bool) – specify whether you want metadata returned. False by default.
- Returns
A list of aggregators. The list is strings if verbose is False and dicts if it is True.
- Return type
list
Examples
>>> Repox('http://localhost:8080', 'username', 'password').list_all_aggregators(True) [{'id': 'dltn', 'name': 'Digital Library of Tennessee', 'nameCode': 'dltn', 'homepage': 'http://localhost:8080/repox'}] >>> Repox('http://localhost:8080', 'username', 'password').list_all_aggregators(False) ['dltn']
-
schedule_harvest
(dataset_id: str, frequency: str = 'ONCE', time: str = 'NOT SET', date: str = 'NOT SET', xmonths: int = 0, incremental: bool = False) → int[source]¶ Schedule a future harvest.
Requires a dataset_id and schedules a future harvest. Optionally takes arguments for frequency of the harvest, the time of the harvest, and the date of the first harvest.
- Parameters
dataset_id (str) – Required. The dataset_id of the set to harvest
frequency (str) – Optional. The frequency of the harvest. Defaults to ONCE. Other options: DAILY, WEEKLY, XMONTHLY. Note, if XMONTHLY, also define xmonthly.
time (str) – Optional. Time of day of the harvest. If not set, schedules harvest for 15 minutes from now.
date (str) – Optional. Date of first harvest. If not set, schedules harvest for 15 minutes from now.
xmonths (int) – Optional. If frequency is XMONTHLY, how frequent to perform harvest. Defaults to 1.
incremental (bool) – Optional. Defaults to False.
- Returns
the HTTP status code as the request.
- Return type
int
Examples
>>> Repox("http://localhost:8080", "username", "password").schedule_harvest("bcpl") 201 >>> Repox("http://localhost:8080", "username", "password").schedule_harvest("bcpl", frequency="XMONTHLY", ... xmonths=2, time="01:00", date="01/12/2019") 201
-
schedule_weekly_harvest
(dataset_id: str, day_of_week: str, time: str = 'Not Set') → int[source]¶ Schedule a weekly harvest for a set on a specific day of the week.
Requires a dataset_id and a day_of_week and schedules a recurring harvest of a specific set each week.
- Parameters
dataset_id (str) – Required. The dataset_id of the associated dataset.
day_of_week (str) – Required. The day of the week of the week of the harvest.
time (str) – Optional. The time of day to schedule the harvest. Defaults to 15 minutes from now.
- Returns
The HTTP status code of the request
- Return type
int
Examples
>>> Repox("http://localhost:8080", "admin", "admin").schedule_weekly_harvest("nr", "Sunday") 201 >>> Repox("http://localhost:8080", "admin", "admin").schedule_weekly_harvest("nr", "Sunday", time="04:00") 201 >>> Repox("http://localhost:8080", "admin", "admin").schedule_weekly_harvest("nr", "Tomorrow") 500
-
update_aggregator
(aggregator_id: str, aggregator_name: str = '', name_code: str = '', homepage: str = '') → int[source]¶ Update an aggregator.
Update an aggregator by specifying its aggregator_id. Optionally, pass an aggregator_name, name_code, or homepage. If any of these are not present, the current data will be used.
- Parameters
aggregator_id (str) – Required. The aggregator_id for the aggregator you want to update.
aggregator_name (str) – Optionally update the aggregator_name.
name_code (str) – Optionally update the aggregator’s name_code.
homepage (str) – Optionally update the aggregator’s homepage.
- Returns
The HTTP status code from your request.
- Return type
int
Examples
>>> Repox('http://localhost:8080', 'username', 'password').update_aggregator("new_dltn", ... homepage="http://www.tenn-share.org/af_membercommittee.asp?committeeid=28") 200
-
update_oai_dataset
(dataset_id: str, export_dir: str = '', metadata_format: str = '', description: str = '', is_sample: bool = False, oai_url: str = '', set_name: str = '', name: str = '', name_code: str = '') → int[source]¶ Update an existing oai dataset.
Requires a dataset_id and optionally accepts most metadata elements for an OAI dataset as a str. If a metadata element is not passed, the value is taken from the previous data.
- Parameters
dataset_id (str) – Required. The dataset_id of the dataset being updated.
export_dir (str) – Optional. A new path to export files to on disk.
metadata_format (str) – Optional. A new metadata format for the set.
description (str) – Optional. A new description for the oai set.
is_sample (bool) – Optional. Specify whether the oai set is a sample (False) or all records (True).
oai_url (str) – Optional. A new url for the associated OAI provider.
set_name (str) – Optional. Change the set_name for the associated OAI provider.
name (str) – Optional. Change the name of the oai set.
name_code (str) – Optional. Change the name_code of the oai_set.
- Returns
The HTTP status Code of the request.
- Return type
int
Todo
(markpbaggett) Create similar update methods for other dataset types.
Examples
>>> Repox("http://localhost:8080", "username", "password").update_oai_dataset("bcpl", ... export_dir="/vagrant/export") 200
-
update_provider
(provider_id: str, name: str = '', country: str = '', country_code: str = '', description: str = '', name_code: str = '', homepage: str = '', provider_type: str = '', email: str = '') → int[source]¶ Update the metadata about a provider.
Requires a provider_id as a string and optionally any metadata value for any other field you want to modify. If a field value is not provided, the current field value is passed to the API along with new values.
- Parameters
provider_id (str) – Required. The provider_id of the provider you want to modify.
name (str) – Optional. A new name for the specified provider.
country (str) – Optional. A new country value for the specified provider.
country_code (str) – Optional. A new country_code to represent the provider.
description (str) – Optional. A new description for the provider.
name_code (str) – Optional. A new name_code to represent the provider.
homepage (str) – Optional. A new homepage that represents the provider.
provider_type (str) – Optional. A new provider_type that represents the provider.
email (str) – Optional. A new email address to associate with the provider.
- Returns
The HTTP status code response of the request.
- Return type
int
Todo
(markpbaggett) Determine if there is a list of allowed country codes.
Examples
>>> Repox('http://localhost:8080', 'username', 'password').update_provider("UTKr0", ... homepage="http://dloai.lib.utk.edu/cgi-bin/XMLFile/dlmodsoai/oai.pl", email="mbagget1@utk.edu") 200
-