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:
object
Represents a single
mets:file/mets:FLocat
(METS file entry).- Parameters
el (LxmlElement) – etree Element of the
mets:file
this represents. Create new if not provided- Keyword Arguments
mets (OcrdMets) – Containing
ocrd_models.ocrd_mets.OcrdMets
.mimetype (string) –
@MIMETYPE
of thismets:file
pageId (string) –
@ID
of the physicalmets:structMap
entry corresponding to thismets:file
loctype (string) –
@LOCTYPE
of thismets:file
local_filename (string) – Local filename
url (string) –
@xlink:href
of thismets:file
ID (string) –
@ID
of thismets:file
-
property
basename
¶ Get the
os.path.basename
of the local file, if any.
-
property
extension
¶
-
property
basename_without_extension
¶ Get the
os.path.basename
of the local file, if any, with extension removed.
-
property
ID
¶ Get the
@ID
of themets:file
.
-
property
pageId
¶ Get the
@ID
of the physicalmets:structMap
entry corresponding to thismets:file
(physical page manifestation).
-
property
loctype
¶ Get the
@LOCTYPE
of themets:file
.
-
property
otherloctype
¶
-
property
mimetype
¶ Get the
@MIMETYPE
of themets:file
.
-
property
fileGrp
¶ The
@USE
of the containingmets:fileGrp
-
property
url
¶ Get the
@xlink:href
of thismets:file
.