ocrd_models.ocrd_file module¶
API to mets:file
-
class
ocrd_models.ocrd_file.OcrdFile(el, mimetype=None, pageId=None, loctype='OTHER', local_filename=None, mets=None, url=None, ID=None)[source]¶ Bases:
objectRepresents a single
mets:file/mets:FLocat(METS file entry).- Parameters
el (LxmlElement) – etree Element of the
mets:filethis represents. Create new if not provided- Keyword Arguments
mets (OcrdMets) – Containing
ocrd_models.ocrd_mets.OcrdMets.mimetype (string) –
@MIMETYPEof thismets:filepageId (string) –
@IDof the physicalmets:structMapentry corresponding to thismets:fileloctype (string) –
@LOCTYPEof thismets:filelocal_filename (string) – Local filename
url (string) –
@xlink:hrefof thismets:fileID (string) –
@IDof thismets:file
-
property
basename¶ Get the
os.path.basenameof the local file, if any.
-
property
extension¶
-
property
basename_without_extension¶ Get the
os.path.basenameof the local file, if any, with extension removed.
-
property
ID¶ Get the
@IDof themets:file.
-
property
pageId¶ Get the
@IDof the physicalmets:structMapentry corresponding to thismets:file(physical page manifestation).
-
property
loctype¶ Get the
@LOCTYPEof themets:file.
-
property
otherloctype¶
-
property
mimetype¶ Get the
@MIMETYPEof themets:file.
-
property
fileGrp¶ The
@USEof the containingmets:fileGrp
-
property
url¶ Get the
@xlink:hrefof thismets:file.