Extending basic metadata

As mentioned above, initialising DLISFile object automatically constructs Storage Unit Label and File Header. However, the definition of each of these can be further tuned. The same applies to Origin, which is the container for key meta-data concerning the well, company, operation set-up etc.

from dlis_writer.file import DLISFile

# define DLISFile passing more information for creating Storage Unit Label and File Header
df = DLISFile(
  set_identifier="MY-SET",
  sul_sequence_number=5,
  max_record_length=4096,
  fh_id="MY-FILE-HEADER",
  fh_sequence_number=8
)

# add Origin with more details
# see more available keyword arguments in DLISFile.add_origin()
origin = df.add_origin(
  'MY-ORIGIN',
  file_id='MY-FILE-ID',
  file_set_name='MY-FILE-SET-NAME',
  file_set_number=11,
  file_number=22,
  well_id=55,
  well_name='MY-WELL'
)

The attributes can also be changed later by accessing the relevant objects’ attributes. Note: because most attributes are instances of Attribute class, you will need to use .value (or .unit) of the attribute you may want to change.

origin.company.value = "COMPANY X"