granicus_archiver.types¶
- class granicus_archiver.types.FileMeta(content_length: int, content_type: str, last_modified: datetime | None, etag: str | None, sha1: SHA1Hash | None = None)[source]¶
Bases:
SerializableMetadata for a file
- Parameters:
- classmethod from_headers(headers: MultiMapping[str] | dict[str, str]) Self[source]¶
Create an instance from http headers
- classmethod create_zero_length() Self[source]¶
Create an instance to indicate that the file has a reported length of zero
This may be used to indicate that a file is malformed or no longer exists on the server.
Zero-length
FileMetainstances can be detected from theiris_zero_lengthattribute.- Return type:
- property is_zero_length: bool¶
Whether this instance represents a zero-length file (created by
create_zero_length())