Client for harvesting OAI interfaces.
Use it like this:
>>> sickle = Sickle('http://elis.da.ulcc.ac.uk/cgi/oai2')
>>> records = sickle.ListRecords(metadataPrefix='oai_dc')
>>> records.next()
<Record oai:eprints.rclis.org:3780>
Parameters: |
|
---|
Contains the last response that has been received.
Issue a ListSets request.
Return type: | sickle.models.Record |
---|
Issue an Identify request.
Return type: | sickle.models.Identify |
---|
Issue a ListIdentifiers request.
Parameters: | ignore_deleted – If set to True, the resulting sickle.app.OAIIterator will skip records flagged as deleted. |
---|---|
Return type: | sickle.app.OAIIterator |
Issue a ListMetadataFormats request.
Return type: | sickle.app.OAIIterator |
---|
Issue a ListRecords request.
Parameters: | ignore_deleted – If set to True, the resulting sickle.app.OAIIterator will skip records flagged as deleted. |
---|---|
Return type: | sickle.app.OAIIterator |
Issue a ListSets request.
Return type: | sickle.app.OAIIterator |
---|
Make HTTP requests to the OAI server.
Parameters: | kwargs – The OAI HTTP arguments. |
---|---|
Return type: | sickle.app.OAIResponse |
A response from an OAI server.
Provides access to the returned data on different abstraction levels.
Parameters: |
|
---|
The server’s response as unicode.
The server’s response as parsed XML.
Iterator over OAI records/identifiers/sets transparently aggregated via OAI-PMH.
Can be used to conveniently iterate through the records of a repository.
Parameters: |
|
---|
The sickle.app.Sickle instance used for making requests to the server.
The OAI verb used for making requests to the server.
The name of the OAI item to iterate on (record, header, set or metadataFormat).
The content of the XML element resumptionToken from the last request.
Flag for whether to skip records marked as deleted.
Return the next record/header/set.
The following classes represent OAI-specific items like records, headers, and sets. All items feature the attributes raw and xml which contain their original XML representation as unicode and as parsed XML objects.
The Identify object is generated from Identify responses and is returned by sickle.app.Sickle.Identify(). It contains general information about the repository.
Represents an Identify container.
This object differs from the other entities in that is has to be created from a sickle.app.OAIResponse instead of an XML element.
Parameters: | identify_response (sickle.app.OAIResponse) – The response for an Identify request. |
---|
Note
As the attributes of this class are auto-generated from the Identify XML elements, some of them may be missing for specific OAI interfaces.
The content of the element adminEmail. Normally the repository’s administrative contact.
The content of the element baseURL, which is the URL of the repository’s OAI endpoint.
The content of the element repositoryName, which contains the name of the repository.
The content of the element deletedRecord, which indicates whether and how the repository keeps track of deleted records.
The content of the element delimiter.
The content of the element description, which contains a description of the repository.
The content of the element earliestDatestamp, which indicates the datestamp of the oldest record in the repository.
The content of the element granularity, which indicates the granularity of the used dates.
The content of the element oai-identifier.
Note
oai-identifier is not a valid name in Python.
The content of the element protocolVersion, which indicates the version of the OAI protocol implemented by the repository.
The content of the element repositoryIdentifier.
The content of the element sampleIdentifier, which usually contains an example of an identifier used by this repository.
The content of the element scheme.
The original XML as unicode.
Record objects represent single OAI records.
Represents an OAI record.
Parameters: |
|
---|
Contains the record header represented as a sickle.models.Header object.
A boolean flag that indicates whether this record is deleted.
The original XML as unicode.
Header objects represent OAI headers.
Represents an OAI MetadataFormat.
Parameters: | mdf_element – The XML element ‘metadataFormat’. |
---|
The prefix used to identify this format.
The namespace URL for this format.
The URL to the schema file of this format.
The original XML as unicode.