Types#

This page documents all types in OpenDAL.

class opendal.types.Entry#

Bases: object

An entry representing a path and its associated metadata.

Notes

If this entry is a directory, path must end with /. Otherwise, path must not end with /.

metadata#

The metadata of this entry.

name#

The name of entry, representing the last segment of the path.

path#

The path of entry relative to the operator’s root.

class opendal.types.Metadata#

Bases: object

The metadata of an Entry.

The metadata is always tied to a specific context and is not a global state. For example, two versions of the same path might have different content lengths.

Notes

In systems that support versioning, such as AWS S3, the metadata may represent a specific version of a file. Use version to get the version of a file if it is available.

cache_control#

Return this entry’s Cache-Control value.

checksum#

Return the full-object checksum as (algorithm, raw digest bytes), or None.

content_disposition#

Return this entry’s Content-Disposition value.

content_encoding#

Return this entry’s Content-Encoding value.

content_language#

Return this entry’s Content-Language value, if available.

content_length#

Return the full content length of this entry.

content_md5#

Return this entry’s Content-MD5 value.

content_type#

Return this entry’s Content-Type value.

etag#

Return this entry’s service-provided ETag as-is.

is_current#

Return whether this metadata describes the current object version.

is_deleted#

Return whether this metadata describes a deleted object or delete marker.

is_dir#

Whether this entry is a directory.

is_file#

Whether this entry is a file.

last_modified#

Return this entry’s Last-Modified timestamp.

mode#

Return this entry’s mode.

user_metadata#

Return a copy of this entry’s user metadata as a dict.

version#

Return this entry’s service-specific version identifier.

class opendal.types.PresignedRequest#

Bases: object

A presigned request.

This contains the information required to make a request to the underlying service, including the URL, method, and headers.

headers#

The HTTP headers of this request.

Returns:
dict

The HTTP headers of this request.

method#

The HTTP method of this request.

url#

The URL of this request.

class opendal.types.EntryMode#

The mode of an entry, indicating if it is a file or a directory.

Dir#

The entry is a directory and can be listed.

File#

The entry is a file and has data to read.

Unknown#

The mode of the entry is unknown.

is_dir()#

Check if the entry mode is Dir.

Returns:
bool

True if the entry is a directory.

is_file()#

Check if the entry mode is File.

Returns:
bool

True if the entry is a file.

opendal.options.ChecksumAlgorithm#

Full-object checksum algorithms. Each service defines the algorithms it supports.

alias of Literal[‘crc32c’, ‘crc64nvme’, ‘crc64ecma’, ‘md5’, ‘sha1’, ‘sha256’]

class opendal.options.OpenKwargs#

Keyword arguments for Operator.open and AsyncOperator.open.

Accepted keys depend on mode: read modes (“r”, “rb”, “br”) accept reader options only, while write, append, and create modes (“w”, “wb”, “ab”, “xb”, etc.) accept writer options only.

The content_type, cache_control, and content_disposition options apply only when writing, appending, or creating and raise TypeError in read mode. Use the operator’s read() method to supply response header overrides.