Skip to content

Types#

This page documents all types in OpenDAL.

Entry#

Entry.

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 property #

The metadata of this entry.

name property #

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

path property #

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

EntryMode#

Bases: Enum

EntryMode.

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

Source code in python/opendal/types.pyi
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
@typing.final
class EntryMode(enum.Enum):
    r"""
    EntryMode.

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

    File = ...
    r"""
    The entry is a file and has data to read.
    """
    Dir = ...
    r"""
    The entry is a directory and can be listed.
    """
    Unknown = ...
    r"""
    The mode of the entry is unknown.
    """

    def is_file(self) -> builtins.bool:
        r"""
        Check if the entry mode is `File`.

        Returns
        -------
        bool
            True if the entry is a file.
        """
    def is_dir(self) -> builtins.bool:
        r"""
        Check if the entry mode is `Dir`.

        Returns
        -------
        bool
            True if the entry is a directory.
        """

Dir = ... class-attribute instance-attribute #

The entry is a directory and can be listed.

File = ... class-attribute instance-attribute #

The entry is a file and has data to read.

Unknown = ... class-attribute instance-attribute #

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.

Source code in python/opendal/types.pyi
158
159
160
161
162
163
164
165
166
def is_dir(self) -> builtins.bool:
    r"""
    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.

Source code in python/opendal/types.pyi
149
150
151
152
153
154
155
156
157
def is_file(self) -> builtins.bool:
    r"""
    Check if the entry mode is `File`.

    Returns
    -------
    bool
        True if the entry is a file.
    """

Metadata#

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 :attr:version to get the version of a file if it is available.

content_disposition property #

The content disposition of this entry.

content_encoding property #

The content encoding of this entry.

content_length property #

The content length of this entry.

content_md5 property #

The content MD5 of this entry.

content_type property #

The content type of this entry.

etag property #

The ETag of this entry.

is_dir property #

Whether this entry is a directory.

is_file property #

Whether this entry is a file.

last_modified property #

The last modified timestamp of this entry.

mode property #

The mode of this entry.

user_metadata property #

The user-defined metadata of this entry.

version property #

The version of this entry.

PresignedRequest#

A presigned request.

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

headers property #

The HTTP headers of this request.

Returns#

dict The HTTP headers of this request.

method property #

The HTTP method of this request.

url property #

The URL of this request.