FileType#
- class nominal.core.FileType(extension: str, mimetype: str)#
Bases:
NamedTupleDefault upload extension and MIME type.
Existing filename extensions are preserved verbatim. If the filename has none,
extensionsupplies 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)
- classmethod from_csv(path: Path | str) FileType#
Resolve a CSV path, rejecting other formats with the supported extensions.
- classmethod from_parquet(path: Path | str) FileType#
Resolve a Parquet file or archive path, rejecting other formats.