biotite.File

class biotite.File[source]

Bases: biotite.copyable.Copyable

Base class for all file classes. The constructor creates an empty file, that can be filled with data using the class specific setter methods. Conversely, the class method read() reads a file from disk (or a file-like object from other sources). In order to write the instance content into a file the write() method is used.

copy()

Create a deep copy of this object.

Returns
copy

A copy of this object.

abstract classmethod read(file)

Parse a file (or file-like object).

Parameters
filefile-like object or str

The file to be read. Alternatively a file path can be supplied.

Returns
file_objectFile

An instance from the respective File subclass representing the parsed file.

abstract write(file)

Write the contents of this File object into a file.

Parameters
file_namefile-like object or str

The file to be written to. Alternatively a file path can be supplied.