FileType#

class nominal.core.FileType(extension, mimetype)#

Bases: NamedTuple

Default upload extension and MIME type.

Existing filename extensions are preserved verbatim. If the filename has none, extension supplies the default: empty or a dot-prefixed suffix, such as .csv.gz. An applied default is validated, and unsafe storage characters are rejected in the final filename. Neither the filename nor the default extension converts or validates the file’s contents.

Create new instance of FileType(extension, mimetype)

extension: str#

Alias for field number 0

mimetype: str#

Alias for field number 1

classmethod from_avro_stream(path)#
Return type:

FileType

classmethod from_csv(path)#

Resolve a CSV path, rejecting other formats with the supported extensions.

Return type:

FileType

classmethod from_parquet(path)#

Resolve a Parquet file or archive path, rejecting other formats.

Return type:

FileType

classmethod from_path(path, default_mimetype='application/octet-stream')#
Return type:

FileType

classmethod from_path_dataset(path)#
Return type:

FileType

classmethod from_path_journal_json(path)#
Return type:

FileType

classmethod from_tabular(path)#
Return type:

FileType

classmethod from_video(path)#
Return type:

FileType

is_avro_stream()#
Return type:

bool

is_csv()#
Return type:

bool

is_journal()#
Return type:

bool

is_parquet()#
Return type:

bool

is_parquet_archive()#
Return type:

bool

is_parquet_file()#
Return type:

bool

is_video()#
Return type:

bool