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 this mets:file

  • pageId (string) – @ID of the physical mets:structMap entry corresponding to this mets:file

  • loctype (string) – @LOCTYPE of this mets:file

  • local_filename (string) – Local filename

  • url (string) – @xlink:href of this mets:file

  • ID (string) – @ID of this mets: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 the mets:file.

property pageId

Get the @ID of the physical mets:structMap entry corresponding to this mets:file (physical page manifestation).

property loctype

Get the @LOCTYPE of the mets:file.

property otherloctype
property mimetype

Get the @MIMETYPE of the mets:file.

property fileGrp

The @USE of the containing mets:fileGrp

property url

Get the @xlink:href of this mets:file.