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#

EntryMode.

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

Source code in python/opendal/types.pyi
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
@final
class EntryMode:
    """
    EntryMode.

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

    Dir: Final[EntryMode]
    """
    The entry is a directory and can be listed.
    """
    File: Final[EntryMode]
    """
    The entry is a file and has data to read.
    """
    Unknown: Final[EntryMode]
    """
    The mode of the entry is unknown.
    """
    def __eq__(self, /, other: object) -> bool: ...
    def __hash__(self, /) -> int: ...
    def __int__(self, /) -> int: ...
    def __ne__(self, /, other: object) -> bool: ...
    def is_dir(self, /) -> bool:
        """
        Check if the entry mode is `Dir`.

        Returns
        -------
        bool
            True if the entry is a directory.
        """
    def is_file(self, /) -> bool:
        """
        Check if the entry mode is `File`.

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

Dir instance-attribute #

The entry is a directory and can be listed.

File instance-attribute #

The entry is a file and has data to read.

Unknown instance-attribute #

The mode of the entry is unknown.

is_dir() #

Check if the entry mode is Dir.

Returns:

Type Description
bool

True if the entry is a directory.

Source code in python/opendal/types.pyi
68
69
70
71
72
73
74
75
76
def is_dir(self, /) -> bool:
    """
    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:

Type Description
bool

True if the entry is a file.

Source code in python/opendal/types.pyi
77
78
79
80
81
82
83
84
85
def is_file(self, /) -> bool:
    """
    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:

Type Description
dict

The HTTP headers of this request.

method property #

The HTTP method of this request.

url property #

The URL of this request.