Config#

Use a typed configuration to construct an Operator or AsyncOperator. The service config’s scheme selects the storage service. Use context for per-operator HTTP settings and layers to apply declarative layers in order.

from datetime import timedelta

from opendal import Operator
from opendal.config import ContextConfig, HttpContextConfig, RetryLayerConfig, S3Config

op = Operator.from_config(
    S3Config(scheme="s3", bucket="my-bucket"),
    context=ContextConfig(http=HttpContextConfig(connect_timeout=timedelta(seconds=5))),
    layers=[RetryLayerConfig(name="retry", max_times=3)],
)

Typed operator configurations.

Each service configuration is a TypedDict with a Literal scheme key. A static type checker detects an incorrect scheme, missing required keys, unknown keys, and incorrect value types.

Build a config with the call form or an annotated variable, then pass it to Operator.from_config / AsyncOperator.from_config:

from opendal import Operator
from opendal.config import S3Config

op = Operator.from_config(S3Config(scheme="s3", bucket="b"))

config: S3Config = {"scheme": "s3", "bucket": "b"}
op = Operator.from_config(config)

ServiceConfig is the discriminated union of all service config dictionaries.

Use context=ContextConfig(http=HttpContextConfig(…)) for per-operator HTTP settings and layers= for a sequence of LayerConfig dictionaries applied in the given order.

class opendal.config.AkamaiConfig#

Bases: TypedDict

Configuration for the akamai service.

access_key_id: NotRequired[str]#

Access key ID. Set this field together with secret_access_key.

bucket: Required[str]#

Bucket name.

disable_config_load: NotRequired[bool]#

Disable loading credentials from AWS environment variables and shared profile files. Set both access_key_id and secret_access_key when enabled.

enable_virtual_host_style: NotRequired[bool]#

Use virtual-hosted-style bucket addressing.

endpoint: Required[str]#

HTTPS S3 base URL for the bucket’s region and endpoint type.

region: NotRequired[str]#

Signing region. Defaults to us-east-1.

root: NotRequired[str | os.PathLike[str]]#

Root within the bucket. The default is /.

scheme: Required[Literal['akamai']]#

The service scheme; fixed to “akamai”.

secret_access_key: NotRequired[str]#

Secret access key. Set this field together with access_key_id.

class opendal.config.AliyunDriveConfig#

Bases: TypedDict

Configuration for the aliyun-drive service.

access_token: NotRequired[str]#

The access_token of this backend. Solution for client-only purpose. #4733 Required if no client_id, client_secret and refresh_token are provided.

client_id: NotRequired[str]#

The client_id of this backend. Required if no access_token is provided.

client_secret: NotRequired[str]#

The client_secret of this backend. Required if no access_token is provided.

drive_type: Required[str]#

The drive_type of this backend. All operations will happen under this type of drive. Available values are default, backup and resource. Fallback to default if not set or no other drives can be found.

refresh_token: NotRequired[str]#

The refresh_token of this backend. Required if no access_token is provided.

root: NotRequired[str | os.PathLike[str]]#

The Root of this backend. All operations will happen under this root. Default to / if not set.

scheme: Required[Literal['aliyun-drive']]#

The service scheme; fixed to “aliyun-drive”.

class opendal.config.AlluxioConfig#

Bases: TypedDict

Configuration for the alluxio service.

endpoint: NotRequired[str]#

endpoint of this backend. Endpoint must be full uri, mostly like http://127.0.0.1:39999.

root: NotRequired[str | os.PathLike[str]]#

root of this backend. All operations will happen under this root. default to / if not set.

scheme: Required[Literal['alluxio']]#

The service scheme; fixed to “alluxio”.

class opendal.config.AzblobConfig#

Bases: TypedDict

Configuration for the azblob service.

account_key: NotRequired[str]#

The account key of Azblob service backend.

account_name: NotRequired[str]#

The account name of Azblob service backend.

authority_host: NotRequired[str]#

The authority host of the service principal for Microsoft Entra ID authentication. Defaults to https://login.microsoftonline.com.

batch_max_operations: NotRequired[int]#

Deprecated: Azblob delete batch capability is enabled by default with Azure Blob’s 256-operation batch limit. [Deprecated since 0.57.0] Azblob delete batch capability is enabled by default with Azure Blob’s 256-operation batch limit. Use CapabilityOverrideLayer to override delete_max_size for specific endpoints.

client_id: NotRequired[str]#

The client id of the service principal for Microsoft Entra ID authentication.

client_secret: NotRequired[str]#

The client secret of the service principal for Microsoft Entra ID authentication.

container: Required[str]#

The container name of Azblob service backend.

encryption_algorithm: NotRequired[str]#

The encryption algorithm of Azblob service backend.

encryption_key: NotRequired[str]#

The Base64-encoded AES-256 customer-provided encryption key. The key must decode to exactly 32 bytes. Building an operator returns ConfigInvalid for invalid Base64 or a different decoded length.

encryption_key_sha256: NotRequired[str]#

The encryption key sha256 of Azblob service backend.

endpoint: NotRequired[str]#

The endpoint of Azblob service backend. Endpoint must be full uri, e.g. - Azblob: https://accountname.blob.core.windows.net - Azurite: http://127.0.0.1:10000/devstoreaccount1

root: NotRequired[str | os.PathLike[str]]#

The root of Azblob service backend. All operations will happen under this root.

sas_token: NotRequired[str]#

The sas token of Azblob service backend.

scheme: Required[Literal['azblob']]#

The service scheme; fixed to “azblob”.

skip_signature: NotRequired[bool]#

Skip signature will skip loading credentials and signing requests.

tenant_id: NotRequired[str]#

The tenant id of the service principal for Microsoft Entra ID authentication.

class opendal.config.AzdlsConfig#

Bases: TypedDict

Configuration for the azdls service.

account_key: NotRequired[str]#

Account key of this backend. - required for shared_key authentication

account_name: NotRequired[str]#

Account name of this backend.

authority_host: NotRequired[str]#

authority_host The authority host of the service principal. - required for client_credentials authentication - default value: https://login.microsoftonline.com

client_id: NotRequired[str]#

client_id The client id of the service principal. - required for client_credentials authentication

client_secret: NotRequired[str]#

client_secret The client secret of the service principal. - required for client_credentials authentication

enable_hns: NotRequired[bool]#

Whether hierarchical namespace (HNS) is enabled for the storage account. When enabled, recursive deletion can use pagination to avoid timeouts on large directories. - default value: false

endpoint: NotRequired[str]#

Endpoint of this backend.

filesystem: Required[str]#

Filesystem name of this backend.

root: NotRequired[str | os.PathLike[str]]#

Root of this backend.

sas_token: NotRequired[str]#

sas_token The shared access signature token. - required for sas authentication

scheme: Required[Literal['azdls']]#

The service scheme; fixed to “azdls”.

tenant_id: NotRequired[str]#

tenant_id The tenant id of the service principal. - required for client_credentials authentication

class opendal.config.AzfileConfig#

Bases: TypedDict

Configuration for the azfile service.

account_key: NotRequired[str]#

The account key for azfile.

account_name: NotRequired[str]#

The account name for azfile.

authority_host: NotRequired[str]#

The authority host of the service principal for Microsoft Entra ID authentication. Defaults to https://login.microsoftonline.com.

client_id: NotRequired[str]#

The client id of the service principal for Microsoft Entra ID authentication.

client_secret: NotRequired[str]#

The client secret of the service principal for Microsoft Entra ID authentication.

endpoint: NotRequired[str]#

The endpoint for azfile.

root: NotRequired[str | os.PathLike[str]]#

The root path for azfile.

sas_token: NotRequired[str]#

The sas token for azfile.

scheme: Required[Literal['azfile']]#

The service scheme; fixed to “azfile”.

share_name: Required[str]#

The share name for azfile.

skip_signature: NotRequired[bool]#

Skip signature will skip loading credentials and signing requests.

tenant_id: NotRequired[str]#

The tenant id of the service principal for Microsoft Entra ID authentication.

class opendal.config.B2Config#

Bases: TypedDict

Configuration for the b2 service.

application_key: NotRequired[str]#

applicationKey of this backend. - If application_key is set, we will take user’s input first. - If not, we will try to load it from environment.

application_key_id: NotRequired[str]#

keyID of this backend. - If application_key_id is set, we will take user’s input first. - If not, we will try to load it from environment.

bucket: Required[str]#

bucket of this backend. required.

bucket_id: Required[str]#

bucket id of this backend. required.

root: NotRequired[str | os.PathLike[str]]#

root of this backend. All operations will happen under this root.

scheme: Required[Literal['b2']]#

The service scheme; fixed to “b2”.

class opendal.config.B2S3Config#

Bases: TypedDict

Configuration for the b2-s3 service.

access_key_id: NotRequired[str]#

Backblaze application key ID (keyID).

bucket: Required[str]#

Bucket name.

disable_config_load: NotRequired[bool]#

Disable loading credentials from AWS environment variables and shared profile files. Set both access_key_id and secret_access_key when enabled.

enable_virtual_host_style: NotRequired[bool]#

Use virtual-hosted-style addressing.

endpoint: NotRequired[str]#

HTTP(S) base endpoint override.

region: Required[str]#

Bucket region from the S3 endpoint. Also used to sign requests.

root: NotRequired[str | os.PathLike[str]]#

Root within the bucket. The default is /.

scheme: Required[Literal['b2-s3']]#

The service scheme; fixed to “b2-s3”.

secret_access_key: NotRequired[str]#

Backblaze application key (applicationKey).

class opendal.config.CacacheConfig#

Bases: TypedDict

Configuration for the cacache service.

datadir: NotRequired[str]#

That path to the cacache data directory.

scheme: Required[Literal['cacache']]#

The service scheme; fixed to “cacache”.

class opendal.config.CephRgwConfig#

Bases: TypedDict

Configuration for the ceph-rgw service.

access_key_id: NotRequired[str]#

Access key ID. Set this field together with secret_access_key.

bucket: Required[str]#

Bucket name.

disable_config_load: NotRequired[bool]#

Disable loading credentials from AWS environment variables and shared profile files. Set both access_key_id and secret_access_key when enabled.

enable_virtual_host_style: NotRequired[bool]#

Use virtual-hosted-style addressing when the gateway has a matching rgw_dns_name or zonegroup hostname.

endpoint: Required[str]#

HTTP(S) base URL of the RADOS Gateway S3 API.

region: NotRequired[str]#

Signing region. Defaults to us-east-1.

root: NotRequired[str | os.PathLike[str]]#

Root within the bucket. The default is /.

scheme: Required[Literal['ceph-rgw']]#

The service scheme; fixed to “ceph-rgw”.

secret_access_key: NotRequired[str]#

Secret access key. Set this field together with access_key_id.

class opendal.config.ConcurrentLimitLayerConfig#

Bases: TypedDict

Configuration for the concurrent_limit layer.

http_permits: NotRequired[int]#

Dedicated concurrency limit for HTTP requests.

list_permits: NotRequired[int]#

Dedicated concurrency limit for listing.

name: Required[Literal['concurrent_limit']]#

The layer name, fixed to concurrent_limit.

permits: Required[int]#

Default number of permits. All configured limits must be positive.

read_permits: NotRequired[int]#

Dedicated concurrency limit for reads.

write_permits: NotRequired[int]#

Dedicated concurrency limit for writes.

class opendal.config.ContextConfig#

Bases: TypedDict

Runtime settings for an operator.

http: HttpContextConfig#

Settings for this operator’s HTTP transport.

class opendal.config.CosConfig#

Bases: TypedDict

Configuration for the cos service.

bucket: NotRequired[str]#

Bucket of this backend.

disable_config_load: NotRequired[bool]#

Disable config load so that opendal will not load config from

enable_versioning: NotRequired[bool]#

Deprecated: COS versioning capability is enabled by default. [Deprecated since 0.57.0] COS versioning capability is enabled by default and this option is no longer needed.

endpoint: NotRequired[str]#

Endpoint of this backend.

root: NotRequired[str | os.PathLike[str]]#

Root of this backend.

scheme: Required[Literal['cos']]#

The service scheme; fixed to “cos”.

secret_id: NotRequired[str]#

Secret ID of this backend.

secret_key: NotRequired[str]#

Secret key of this backend.

security_token: NotRequired[str]#

Security token (a.k.a. session token) of this backend. This is used for temporary credentials issued by Tencent Cloud STS (e.g. GetFederationToken / AssumeRole). When security_token is provided, it will be used together with secret_id and secret_key to sign requests, and the x-cos-security-token header will be attached automatically by the signer. If this field is not set, OpenDAL will also fall back to reading the token from environment variables TENCENTCLOUD_TOKEN, TENCENTCLOUD_SECURITY_TOKEN or QCLOUD_SECRET_TOKEN (unless disable_config_load is enabled).

class opendal.config.CosS3Config#

Bases: TypedDict

Configuration for the cos-s3 service.

access_key_id: NotRequired[str]#

Tencent Cloud SecretId.

bucket: Required[str]#

Full COS bucket name including the numeric APPID suffix.

disable_config_load: NotRequired[bool]#

Disable loading credentials from AWS environment variables and shared profile files. Set both access_key_id and secret_access_key when enabled.

endpoint: NotRequired[str]#

HTTP(S) base endpoint override.

region: Required[str]#

COS bucket region. Also used to sign requests.

root: NotRequired[str | os.PathLike[str]]#

Root within the bucket. The default is /.

scheme: Required[Literal['cos-s3']]#

The service scheme; fixed to “cos-s3”.

secret_access_key: NotRequired[str]#

Tencent Cloud SecretKey.

session_token: NotRequired[str]#

Session token for temporary credentials. Requires both keys.

class opendal.config.DashmapConfig#

Bases: TypedDict

Configuration for the dashmap service.

root: NotRequired[str | os.PathLike[str]]#

root path of this backend

scheme: Required[Literal['dashmap']]#

The service scheme; fixed to “dashmap”.

class opendal.config.DropboxConfig#

Bases: TypedDict

Configuration for the dropbox service.

access_token: NotRequired[str]#

access token for dropbox.

client_id: NotRequired[str]#

client_id for dropbox.

client_secret: NotRequired[str]#

client_secret for dropbox.

refresh_token: NotRequired[str]#

refresh_token for dropbox.

root: NotRequired[str | os.PathLike[str]]#

root path for dropbox.

scheme: Required[Literal['dropbox']]#

The service scheme; fixed to “dropbox”.

class opendal.config.ExoscaleConfig#

Bases: TypedDict

Configuration for the exoscale service.

access_key_id: NotRequired[str]#

Access key ID. Set this field together with secret_access_key.

bucket: Required[str]#

Bucket name.

disable_config_load: NotRequired[bool]#

Disable loading credentials from AWS environment variables and shared profile files. Set both access_key_id and secret_access_key when enabled.

enable_virtual_host_style: NotRequired[bool]#

Use virtual-hosted-style bucket addressing.

endpoint: NotRequired[str]#

Explicit HTTP(S) base endpoint. The default is https://sos-<zone>.exo.io.

root: NotRequired[str | os.PathLike[str]]#

Root within the bucket. The default is /.

scheme: Required[Literal['exoscale']]#

The service scheme; fixed to “exoscale”.

secret_access_key: NotRequired[str]#

Secret access key. Set this field together with access_key_id.

zone: Required[str]#

Bucket zone, used as the signing region.

class opendal.config.FoyerConfig#

Bases: TypedDict

Configuration for the foyer service.

disk_capacity: NotRequired[int]#

Disk cache total capacity in bytes. Only used when disk_path is set.

disk_file_size: NotRequired[int]#

Individual cache file size in bytes. Default is 1 MiB. Only used when disk_path is set.

disk_path: NotRequired[str]#

Disk cache directory path. If set, enables hybrid cache with disk storage. Data will be persisted to this directory when memory cache is full.

memory: NotRequired[int]#

Memory capacity in bytes for the cache.

name: NotRequired[str]#

Name for this cache instance.

recover_mode: NotRequired[str]#

Recovery mode when starting the cache. Valid values: “none” (default), “quiet”, “strict”. - “none”: Don’t recover from disk - “quiet”: Recover and skip errors - “strict”: Recover and panic on errors

root: NotRequired[str | os.PathLike[str]]#

Root path of this backend.

scheme: Required[Literal['foyer']]#

The service scheme; fixed to “foyer”.

shards: NotRequired[int]#

Number of shards for concurrent access. Default is 1. Higher values improve concurrency but increase overhead.

class opendal.config.FsConfig#

Bases: TypedDict

Configuration for the fs service.

atomic_write_dir: NotRequired[str | os.PathLike[str]]#

tmp dir for atomic write

direct_io: NotRequired[bool]#

Bypass the page cache for file reads and writes on Linux. Defaults to false.

root: NotRequired[str | os.PathLike[str]]#

root dir for backend

scheme: Required[Literal['fs']]#

The service scheme; fixed to “fs”.

class opendal.config.FtpConfig#

Bases: TypedDict

Configuration for the ftp service.

endpoint: NotRequired[str]#

endpoint of this backend

password: NotRequired[str]#

password of this backend

root: NotRequired[str | os.PathLike[str]]#

root of this backend

scheme: Required[Literal['ftp']]#

The service scheme; fixed to “ftp”.

user: NotRequired[str]#

user of this backend

class opendal.config.GarageConfig#

Bases: TypedDict

Configuration for the garage service.

access_key_id: NotRequired[str]#

Access key ID. Set this field together with secret_access_key.

bucket: Required[str]#

Bucket name.

disable_config_load: NotRequired[bool]#

Disable loading credentials from AWS environment variables and shared profile files. Set both access_key_id and secret_access_key when enabled.

enable_virtual_host_style: NotRequired[bool]#

Use virtual-hosted-style addressing when the cluster has a matching root_domain.

endpoint: Required[str]#

HTTP(S) base URL of the cluster’s S3 API.

region: Required[str]#

Signing region from s3_region in the cluster’s [s3_api] configuration.

root: NotRequired[str | os.PathLike[str]]#

Root within the bucket. The default is /.

scheme: Required[Literal['garage']]#

The service scheme; fixed to “garage”.

secret_access_key: NotRequired[str]#

Secret access key. Set this field together with access_key_id.

class opendal.config.GcsConfig#

Bases: TypedDict

Configuration for the gcs service.

allow_anonymous: NotRequired[bool]#

Allow opendal to send requests without signing when credentials are not loaded. [Deprecated since 0.57.0] Please use skip_signature instead of allow_anonymous

bucket: Required[str]#

bucket name

credential: NotRequired[str]#

Credentials string for GCS service OAuth2 authentication.

credential_path: NotRequired[str]#

Local path to credentials file for GCS service OAuth2 authentication.

default_storage_class: NotRequired[str]#

The default storage class used by gcs.

disable_config_load: NotRequired[bool]#

Disable loading configuration from the environment.

disable_vm_metadata: NotRequired[bool]#

Disable attempting to load credentials from the GCE metadata server when running within Google Cloud.

endpoint: NotRequired[str]#

endpoint URI of GCS service, default is https://storage.googleapis.com

predefined_acl: NotRequired[str]#

The predefined acl for GCS.

root: NotRequired[str | os.PathLike[str]]#

root URI, all operations happens under root

scheme: Required[Literal['gcs']]#

The service scheme; fixed to “gcs”.

scope: NotRequired[str]#

Scope for gcs.

service_account: NotRequired[str]#

Service Account for gcs.

skip_signature: NotRequired[bool]#

Skip signature will skip loading credentials and signing requests.

token: NotRequired[str]#

A Google Cloud OAuth2 token. Takes precedence over credential and credential_path.

class opendal.config.GcsGrpcConfig#

Bases: TypedDict

Configuration for the gcs-grpc service.

bucket: Required[str]#

Bucket name.

credential: NotRequired[str]#

Base64-encoded service account credential.

credential_path: NotRequired[str]#

Path to a service account credential file.

disable_config_load: NotRequired[bool]#

Disable environment and well-known credential loading.

disable_vm_metadata: NotRequired[bool]#

Disable the GCE metadata credential provider.

endpoint: NotRequired[str]#

gRPC endpoint.

root: NotRequired[str | os.PathLike[str]]#

Root path for all operations.

scheme: Required[Literal['gcs-grpc']]#

The service scheme; fixed to “gcs-grpc”.

scope: NotRequired[str]#

OAuth 2.0 scope.

service_account: NotRequired[str]#

Service account used by the GCE metadata server.

skip_signature: NotRequired[bool]#

Send requests without authentication.

token: NotRequired[str]#

OAuth 2.0 access token.

class opendal.config.GcsS3Config#

Bases: TypedDict

Configuration for the gcs-s3 service.

access_key_id: NotRequired[str]#

Cloud Storage HMAC access ID.

bucket: Required[str]#

Bucket name.

disable_config_load: NotRequired[bool]#

Disable loading credentials from AWS environment variables and shared profile files. Set both access_key_id and secret_access_key when enabled.

enable_virtual_host_style: NotRequired[bool]#

Use virtual-hosted-style addressing for DNS-compatible buckets without dots.

endpoint: NotRequired[str]#

HTTP(S) XML API base endpoint. Defaults to https://storage.googleapis.com.

region: NotRequired[str]#

Signing region. Defaults to auto.

root: NotRequired[str | os.PathLike[str]]#

Root within the bucket. The default is /.

scheme: Required[Literal['gcs-s3']]#

The service scheme; fixed to “gcs-s3”.

secret_access_key: NotRequired[str]#

Cloud Storage HMAC secret.

class opendal.config.GdriveConfig#

Bases: TypedDict

Configuration for the gdrive service.

access_token: NotRequired[str]#

Access token for gdrive.

client_id: NotRequired[str]#

Client id for gdrive.

client_secret: NotRequired[str]#

Client secret for gdrive.

drive_id: NotRequired[str]#

Shared drive (formerly Team Drive) id for gdrive. When set, gdrive resolves root inside this shared drive instead of the user’s My Drive.

refresh_token: NotRequired[str]#

Refresh token for gdrive.

root: NotRequired[str | os.PathLike[str]]#

The root for gdrive

scheme: Required[Literal['gdrive']]#

The service scheme; fixed to “gdrive”.

class opendal.config.GhacConfig#

Bases: TypedDict

Configuration for the ghac service.

endpoint: NotRequired[str]#

The endpoint for ghac service.

root: NotRequired[str | os.PathLike[str]]#

The root path for ghac.

runtime_token: NotRequired[str]#

The runtime token for ghac service.

scheme: Required[Literal['ghac']]#

The service scheme; fixed to “ghac”.

version: NotRequired[str]#

The version that used by cache.

class opendal.config.GithubConfig#

Bases: TypedDict

Configuration for the github service.

owner: Required[str]#

GitHub repo owner. required.

repo: Required[str]#

GitHub repo name. required.

root: NotRequired[str | os.PathLike[str]]#

root of this backend. All operations will happen under this root.

scheme: Required[Literal['github']]#

The service scheme; fixed to “github”.

token: NotRequired[str]#

GitHub access_token. optional. If not provided, the backend will only support read operations for public repositories. And rate limit will be limited to 60 requests per hour.

class opendal.config.GridfsConfig#

Bases: TypedDict

Configuration for the gridfs service.

bucket: NotRequired[str]#

The bucket name of the MongoDB GridFs service to read/write.

chunk_size: NotRequired[int]#

The chunk size of the MongoDB GridFs service used to break the user file into chunks.

connection_string: NotRequired[str]#

The connection string of the MongoDB service.

database: NotRequired[str]#

The database name of the MongoDB GridFs service to read/write.

root: NotRequired[str | os.PathLike[str]]#

The working directory, all operations will be performed under it.

scheme: Required[Literal['gridfs']]#

The service scheme; fixed to “gridfs”.

class opendal.config.HdfsNativeConfig#

Bases: TypedDict

Configuration for the hdfs-native service.

enable_append: NotRequired[bool]#

Deprecated: HDFS Native append capability is enabled by default. [Deprecated since 0.57.0] HDFS Native append capability is enabled by default and this option is no longer needed.

name_node: NotRequired[str]#

name_node of this backend

options: NotRequired[dict[str, str]]#

other options for hdfs client

root: NotRequired[str | os.PathLike[str]]#

work dir of this backend

scheme: Required[Literal['hdfs-native']]#

The service scheme; fixed to “hdfs-native”.

class opendal.config.HetznerConfig#

Bases: TypedDict

Configuration for the hetzner service.

access_key_id: NotRequired[str]#

Access key ID. Set this field together with secret_access_key.

bucket: Required[str]#

Bucket name.

disable_config_load: NotRequired[bool]#

Disable loading credentials from AWS environment variables and shared profile files. Set both access_key_id and secret_access_key when enabled.

enable_virtual_host_style: NotRequired[bool]#

Use virtual-hosted-style bucket addressing.

endpoint: NotRequired[str]#

Explicit HTTP(S) base endpoint. The default is https://<location>.your-objectstorage.com.

location: NotRequired[str]#

Bucket location. Required unless endpoint is set.

region: NotRequired[str]#

Signing region. Defaults to location.

root: NotRequired[str | os.PathLike[str]]#

Root within the bucket. The default is /.

scheme: Required[Literal['hetzner']]#

The service scheme; fixed to “hetzner”.

secret_access_key: NotRequired[str]#

Secret access key. Set this field together with access_key_id.

class opendal.config.HfConfig#

Bases: TypedDict

Configuration for the hf service.

disable_config_load: NotRequired[bool]#

Disable loading config from the environment. When set, the service ignores HF_ENDPOINT, HF_HUB_DISABLE_XET, HF_TOKEN, HF_TOKEN_PATH, and the token file under HF_HOME, $XDG_CACHE_HOME/huggingface or ~/.cache/huggingface.

download_mode: NotRequired[str]#

Download mode. Either xet (default) or http. When unset, the mode is resolved from the HF_HUB_DISABLE_XET environment variable: a non-empty value forces http, otherwise it defaults to xet. An explicit value here takes precedence. See <https://huggingface.co/docs/huggingface_hub/package_reference/environment_variables#hfhubdisablexet>.

enable_resolve_cache: NotRequired[bool]#

Enable caching of resolved HTTP download addresses and XET file metadata. Defaults to false. Set to true to share resolve results across readers on the same backend. Changed files may remain invisible while cached results are reused. A reader retains XET metadata from its first read for its lifetime. Create a new reader to resolve the path again when this option is disabled. See [HfBuilder::enable_resolve_cache] for freshness semantics.

endpoint: NotRequired[str]#

Endpoint of the Hugging Face Hub. The default is https://huggingface.co.

repo_id: NotRequired[str]#

Repo id of this backend. This is required.

repo_type: NotRequired[str]#

Repo type of this backend. Required.

revision: NotRequired[str]#

Revision of this backend. Default is main.

root: NotRequired[str | os.PathLike[str]]#

Root of this backend. Can be “/path/to/dir”. Default is “/”.

scheme: Required[Literal['hf']]#

The service scheme; fixed to “hf”.

token: NotRequired[str]#

Token of this backend. This is optional.

class opendal.config.HttpConfig#

Bases: TypedDict

Configuration for the http service.

endpoint: NotRequired[str]#

endpoint of this backend

password: NotRequired[str]#

password of this backend

root: NotRequired[str | os.PathLike[str]]#

root of this backend

scheme: Required[Literal['http']]#

The service scheme; fixed to “http”.

token: NotRequired[str]#

token of this backend

username: NotRequired[str]#

username of this backend

class opendal.config.HttpContextConfig#

Bases: TypedDict

Per-operator settings for requests using the HTTP transport.

Supply positive durations for the timeouts.

connect_timeout: timedelta#

Time limit for establishing a connection.

no_proxy: list[str]#

A non-empty list of hosts, domains, or CIDRs that bypass the proxy. Requires proxy.

proxy: str#

The HTTP or HTTPS proxy URL.

read_timeout: timedelta#

Time limit for each read from the connection.

timeout: timedelta#

Time limit for the entire request, including reading the response body.

user_agent: str#

User-Agent header value for outgoing requests.

class opendal.config.IbmCosConfig#

Bases: TypedDict

Configuration for the ibm-cos service.

access_key_id: NotRequired[str]#

Access key ID. Set this field together with secret_access_key.

bucket: Required[str]#

Bucket name.

disable_config_load: NotRequired[bool]#

Disable loading credentials from AWS environment variables and shared profile files. Set both access_key_id and secret_access_key when enabled.

enable_virtual_host_style: NotRequired[bool]#

Use virtual-hosted-style bucket addressing.

endpoint: Required[str]#

HTTPS S3 base URL for the bucket’s storage location and network access type.

region: NotRequired[str]#

Signing region. Defaults to us-standard.

root: NotRequired[str | os.PathLike[str]]#

Root within the bucket. The default is /.

scheme: Required[Literal['ibm-cos']]#

The service scheme; fixed to “ibm-cos”.

secret_access_key: NotRequired[str]#

Secret access key. Set this field together with access_key_id.

class opendal.config.IdriveE2Config#

Bases: TypedDict

Configuration for the idrive-e2 service.

access_key_id: NotRequired[str]#

Access key ID. Set this field together with secret_access_key.

bucket: Required[str]#

Bucket name.

disable_config_load: NotRequired[bool]#

Disable loading credentials from AWS environment variables and shared profile files. Set both access_key_id and secret_access_key when enabled.

endpoint: Required[str]#

Endpoint Access URL associated with the IDrive e2 access key.

region: NotRequired[str]#

Signing region. Defaults to us-east-1.

root: NotRequired[str | os.PathLike[str]]#

Root within the bucket. The default is /.

scheme: Required[Literal['idrive-e2']]#

The service scheme; fixed to “idrive-e2”.

secret_access_key: NotRequired[str]#

Secret access key. Set this field together with access_key_id.

class opendal.config.IonosConfig#

Bases: TypedDict

Configuration for the ionos service.

access_key_id: NotRequired[str]#

Access key ID. Set this field together with secret_access_key.

bucket: Required[str]#

Bucket name.

disable_config_load: NotRequired[bool]#

Disable loading credentials from AWS environment variables and shared profile files. Set both access_key_id and secret_access_key when enabled.

endpoint: NotRequired[str]#

Explicit HTTP(S) S3 base endpoint. By default, OpenDAL selects the endpoint from the bucket’s region.

region: Required[str]#

Bucket region from the IONOS endpoint table, also used for signing.

root: NotRequired[str | os.PathLike[str]]#

Root within the bucket. The default is /.

scheme: Required[Literal['ionos']]#

The service scheme; fixed to “ionos”.

secret_access_key: NotRequired[str]#

Secret access key. Set this field together with access_key_id.

class opendal.config.IpfsConfig#

Bases: TypedDict

Configuration for the ipfs service.

endpoint: NotRequired[str]#

IPFS gateway endpoint.

root: NotRequired[str | os.PathLike[str]]#

IPFS root.

scheme: Required[Literal['ipfs']]#

The service scheme; fixed to “ipfs”.

class opendal.config.IpmfsConfig#

Bases: TypedDict

Configuration for the ipmfs service.

endpoint: NotRequired[str]#

Endpoint for ipfs.

root: NotRequired[str | os.PathLike[str]]#

Root for ipfs.

scheme: Required[Literal['ipmfs']]#

The service scheme; fixed to “ipmfs”.

class opendal.config.KoofrConfig#

Bases: TypedDict

Configuration for the koofr service.

email: Required[str]#

Koofr email.

endpoint: Required[str]#

Koofr endpoint.

password: NotRequired[str]#

password of this backend. (Must be the application password)

root: NotRequired[str | os.PathLike[str]]#

root of this backend. All operations will happen under this root.

scheme: Required[Literal['koofr']]#

The service scheme; fixed to “koofr”.

class opendal.config.LakefsS3Config#

Bases: TypedDict

Configuration for the lakefs-s3 service.

access_key_id: NotRequired[str]#

lakeFS access key ID.

bucket: Required[str]#

lakeFS repository name as exposed by the S3 Gateway.

disable_config_load: NotRequired[bool]#

Disable loading credentials from AWS environment variables and shared profile files. Set both access_key_id and secret_access_key when enabled.

enable_virtual_host_style: NotRequired[bool]#

Use virtual-hosted-style addressing when the gateway is configured for it.

endpoint: Required[str]#

HTTP(S) base URL of the lakeFS S3 Gateway.

region: NotRequired[str]#

Signing region. Defaults to us-east-1.

root: Required[str | os.PathLike[str]]#

S3 key prefix starting with a branch or other lakeFS reference.

scheme: Required[Literal['lakefs-s3']]#

The service scheme; fixed to “lakefs-s3”.

secret_access_key: NotRequired[str]#

lakeFS secret access key.

session_token: NotRequired[str]#

Session token from issued lakeFS Enterprise temporary credentials. Requires both keys.

opendal.config.LayerConfig = opendal.config.ConcurrentLimitLayerConfig | opendal.config.LoggingLayerConfig | opendal.config.MimeGuessLayerConfig | opendal.config.RetryLayerConfig | opendal.config.TimeoutLayerConfig#

Discriminated union of supported declarative layer configs, keyed on name.

class opendal.config.LoggingLayerConfig#

Bases: TypedDict

Configuration for the logging layer.

name: Required[Literal['logging']]#

The layer name, fixed to logging.

class opendal.config.MemcachedConfig#

Bases: TypedDict

Configuration for the memcached service.

connection_pool_max_size: NotRequired[int]#

The maximum number of connections allowed. default is 10

default_ttl: NotRequired[str | timedelta]#

The default ttl for put operations. A datetime.timedelta or human readable duration string, e.g. “5s” (see https://docs.rs/humantime/latest/humantime/fn.parse_duration.html).

enable_tls: NotRequired[bool]#

Enable TLS for TCP connections. Defaults to false. The server certificate must match the endpoint host and a native trust root.

endpoint: NotRequired[str]#

network address of the memcached service. For example: “tcp://localhost:11211”

password: NotRequired[str]#

Memcached password, optional.

root: NotRequired[str | os.PathLike[str]]#

the working directory of the service. Can be “/path/to/dir” default is “/”

scheme: Required[Literal['memcached']]#

The service scheme; fixed to “memcached”.

username: NotRequired[str]#

Memcached username, optional.

class opendal.config.MemoryConfig#

Bases: TypedDict

Configuration for the memory service.

root: NotRequired[str | os.PathLike[str]]#

root of the backend.

scheme: Required[Literal['memory']]#

The service scheme; fixed to “memory”.

class opendal.config.MimeGuessLayerConfig#

Bases: TypedDict

Configuration for the mime_guess layer.

name: Required[Literal['mime_guess']]#

The layer name, fixed to mime_guess.

class opendal.config.MiniMokaConfig#

Bases: TypedDict

Configuration for the mini-moka service.

max_capacity: NotRequired[int]#

Sets the max capacity of the cache. Refer to [mini-moka::sync::CacheBuilder::max_capacity](https://docs.rs/mini-moka/latest/mini_moka/sync/struct.CacheBuilder.html#method.max_capacity)

root: NotRequired[str | os.PathLike[str]]#

root path of this backend

scheme: Required[Literal['mini-moka']]#

The service scheme; fixed to “mini-moka”.

time_to_idle: NotRequired[str | timedelta]#

Sets the time to idle of the cache. Refer to [mini-moka::sync::CacheBuilder::time_to_idle](https://docs.rs/mini-moka/latest/mini_moka/sync/struct.CacheBuilder.html#method.time_to_idle) A datetime.timedelta or human readable duration string, e.g. “5s” (see https://docs.rs/humantime/latest/humantime/fn.parse_duration.html).

time_to_live: NotRequired[str | timedelta]#

Sets the time to live of the cache. Refer to [mini-moka::sync::CacheBuilder::time_to_live](https://docs.rs/mini-moka/latest/mini_moka/sync/struct.CacheBuilder.html#method.time_to_live) A datetime.timedelta or human readable duration string, e.g. “5s” (see https://docs.rs/humantime/latest/humantime/fn.parse_duration.html).

class opendal.config.MinioConfig#

Bases: TypedDict

Configuration for the minio service.

access_key_id: NotRequired[str]#

Access key ID. Set this field together with secret_access_key.

bucket: Required[str]#

Bucket name. This field is required.

disable_config_load: NotRequired[bool]#

Disable loading credentials from AWS environment variables and shared profile files. When enabled, signing requires both access_key_id and secret_access_key.

endpoint: Required[str]#

MinIO endpoint. This field is required because MinIO deployments do not share a universal endpoint.

region: NotRequired[str]#

Signing region. The default is auto. Set this field when the deployment requires a configured region.

root: NotRequired[str | os.PathLike[str]]#

Root within the bucket. All operations happen under this root. The default is /.

scheme: Required[Literal['minio']]#

The service scheme; fixed to “minio”.

secret_access_key: NotRequired[str]#

Secret access key. Set this field together with access_key_id.

session_token: NotRequired[str]#

Session token for temporary credentials. This field requires access_key_id and secret_access_key.

skip_signature: NotRequired[bool]#

Send requests without signing them. This option cannot be combined with direct credentials.

class opendal.config.MokaConfig#

Bases: TypedDict

Configuration for the moka service.

max_capacity: NotRequired[int]#

Sets the max capacity of the cache. Refer to [moka::future::CacheBuilder::max_capacity](https://docs.rs/moka/latest/moka/future/struct.CacheBuilder.html#method.max_capacity)

name: NotRequired[str]#

Name for this cache instance.

root: NotRequired[str | os.PathLike[str]]#

root path of this backend

scheme: Required[Literal['moka']]#

The service scheme; fixed to “moka”.

time_to_idle: NotRequired[str | timedelta]#

Sets the time to idle of the cache. Refer to [moka::future::CacheBuilder::time_to_idle](https://docs.rs/moka/latest/moka/future/struct.CacheBuilder.html#method.time_to_idle) A datetime.timedelta or human readable duration string, e.g. “5s” (see https://docs.rs/humantime/latest/humantime/fn.parse_duration.html).

time_to_live: NotRequired[str | timedelta]#

Sets the time to live of the cache. Refer to [moka::future::CacheBuilder::time_to_live](https://docs.rs/moka/latest/moka/future/struct.CacheBuilder.html#method.time_to_live) A datetime.timedelta or human readable duration string, e.g. “5s” (see https://docs.rs/humantime/latest/humantime/fn.parse_duration.html).

class opendal.config.MongodbConfig#

Bases: TypedDict

Configuration for the mongodb service.

collection: NotRequired[str]#

collection of this backend

connection_string: NotRequired[str]#

connection string of this backend

database: NotRequired[str]#

database of this backend

key_field: NotRequired[str]#

key field of this backend

root: NotRequired[str | os.PathLike[str]]#

root of this backend

scheme: Required[Literal['mongodb']]#

The service scheme; fixed to “mongodb”.

value_field: NotRequired[str]#

value field of this backend

class opendal.config.MysqlConfig#

Bases: TypedDict

Configuration for the mysql service.

connection_string: NotRequired[str]#

This connection string is used to connect to the mysql service. There are url based formats. The format of connect string resembles the url format of the mysql client. The format is: [scheme://][user[:[password]]@]host[:port][/schema][?attribute1=value1&attribute2=value2… - mysql://user@localhost - mysql://user:password@localhost - mysql://user:password@localhost:3306 - mysql://user:password@localhost:3306/db For more information, please refer to <https://docs.rs/sqlx/latest/sqlx/mysql/struct.MySqlConnectOptions.html>.

key_field: NotRequired[str]#

The key field name for mysql.

root: NotRequired[str | os.PathLike[str]]#

The root for mysql.

scheme: Required[Literal['mysql']]#

The service scheme; fixed to “mysql”.

table: NotRequired[str]#

The table name for mysql.

value_field: NotRequired[str]#

The value field name for mysql.

class opendal.config.NeonConfig#

Bases: TypedDict

Configuration for the neon service.

access_key_id: NotRequired[str]#

Access key ID. Set this field together with secret_access_key.

bucket: Required[str]#

Bucket name.

disable_config_load: NotRequired[bool]#

Disable loading credentials from AWS environment variables and shared profile files. Set both access_key_id and secret_access_key when enabled.

endpoint: Required[str]#

HTTPS S3 endpoint of the Neon branch, or an HTTP(S) custom endpoint.

region: NotRequired[str]#

Signing region. Defaults to the project region in a standard Neon branch URL. Required with a custom endpoint.

root: NotRequired[str | os.PathLike[str]]#

Root within the bucket. The default is /.

scheme: Required[Literal['neon']]#

The service scheme; fixed to “neon”.

secret_access_key: NotRequired[str]#

Secret access key. Set this field together with access_key_id.

class opendal.config.ObsConfig#

Bases: TypedDict

Configuration for the obs service.

access_key_id: NotRequired[str]#

Access key id for obs.

bucket: NotRequired[str]#

Bucket for obs.

disable_config_load: NotRequired[bool]#

Disable config load so that opendal will not load config from environment. For examples: - envs like HUAWEI_CLOUD_ACCESS_KEY_ID

enable_versioning: NotRequired[bool]#

Deprecated: OBS versioning capability is not controlled by service config. [Deprecated since 0.57.0] OBS versioning capability is not controlled by this option and this option is no longer needed.

endpoint: NotRequired[str]#

Endpoint for obs.

root: NotRequired[str | os.PathLike[str]]#

Root for obs.

scheme: Required[Literal['obs']]#

The service scheme; fixed to “obs”.

secret_access_key: NotRequired[str]#

Secret access key for obs.

security_token: NotRequired[str]#

Security token (a.k.a. session token) for obs. Temporary credentials sign with access_key_id, secret_access_key and this token, and the signer attaches the token as the x-obs-security-token header. If this field is not set, OpenDAL reads the token from the environment variable HUAWEI_CLOUD_SECURITY_TOKEN (unless disable_config_load is enabled).

skip_signature: NotRequired[bool]#

Skip signature will skip loading credentials and signing requests.

class opendal.config.ObsS3Config#

Bases: TypedDict

Configuration for the obs-s3 service.

access_key_id: NotRequired[str]#

Huawei Cloud access key ID (AK).

bucket: Required[str]#

OBS bucket name as a single lowercase DNS label.

disable_config_load: NotRequired[bool]#

Disable loading credentials from AWS environment variables and shared profile files. Set both access_key_id and secret_access_key when enabled.

endpoint: NotRequired[str]#

HTTP(S) base endpoint override. OpenDAL prepends the bucket to the host.

region: Required[str]#

OBS bucket region. Also used to sign requests.

root: NotRequired[str | os.PathLike[str]]#

Root within the bucket. The default is /.

scheme: Required[Literal['obs-s3']]#

The service scheme; fixed to “obs-s3”.

secret_access_key: NotRequired[str]#

Huawei Cloud secret access key (SK).

session_token: NotRequired[str]#

Session token for temporary Huawei Cloud credentials. Requires both keys.

class opendal.config.OciConfig#

Bases: TypedDict

Configuration for the oci service.

access_key_id: NotRequired[str]#

Access key ID. Set this field together with secret_access_key.

bucket: Required[str]#

Bucket name.

disable_config_load: NotRequired[bool]#

Disable loading credentials from AWS environment variables and shared profile files. Set both access_key_id and secret_access_key when enabled.

endpoint: NotRequired[str]#

Explicit HTTP(S) base endpoint. The default is https://<namespace>.compat.objectstorage.<region>.oci.customer-oci.com.

namespace: NotRequired[str]#

Object Storage namespace. Required unless endpoint is set.

region: Required[str]#

Bucket region, used as the signing region.

root: NotRequired[str | os.PathLike[str]]#

Root within the bucket. The default is /.

scheme: Required[Literal['oci']]#

The service scheme; fixed to “oci”.

secret_access_key: NotRequired[str]#

Secret access key. Set this field together with access_key_id.

class opendal.config.OnedriveConfig#

Bases: TypedDict

Configuration for the onedrive service.

access_token: NotRequired[str]#

Microsoft Graph API (also OneDrive API) access token

client_id: NotRequired[str]#

Microsoft Graph API Application (client) ID that is in the Azure’s app registration portal

client_secret: NotRequired[str]#

Microsoft Graph API Application client secret that is in the Azure’s app registration portal

enable_versioning: NotRequired[bool]#

Deprecated: OneDrive supports version listing without this option. [Deprecated since 0.57.0] OneDrive supports version listing without this option.

refresh_token: NotRequired[str]#

Microsoft Graph API (also OneDrive API) refresh token

root: NotRequired[str | os.PathLike[str]]#

The root path for the OneDrive service for the file access

scheme: Required[Literal['onedrive']]#

The service scheme; fixed to “onedrive”.

class opendal.config.OssConfig#

Bases: TypedDict

Configuration for the oss service.

access_key_id: NotRequired[str]#

Access key id for oss. - this field if it’s is_some - env value: ALIBABA_CLOUD_ACCESS_KEY_ID

access_key_secret: NotRequired[str]#

Access key secret for oss. - this field if it’s is_some - env value: ALIBABA_CLOUD_ACCESS_KEY_SECRET

addressing_style: NotRequired[str]#

Addressing style for oss.

allow_anonymous: NotRequired[bool]#

Allow anonymous for oss. [Deprecated since 0.57.0] Please use skip_signature instead of allow_anonymous

batch_max_operations: NotRequired[int]#

Deprecated: OSS delete batch capability is enabled by default. [Deprecated since 0.57.0] OSS delete batch capability is enabled by default. Use CapabilityOverrideLayer to override delete_max_size for specific endpoints.

bucket: Required[str]#

Bucket for oss.

delete_max_size: NotRequired[int]#

Deprecated: OSS delete batch capability is enabled by default. [Deprecated since 0.57.0] OSS delete batch capability is enabled by default. Use CapabilityOverrideLayer to override delete_max_size for specific endpoints.

disable_config_load: NotRequired[bool]#

Disable loading credentials from ambient sources. This removes the environment provider and the OSS profile, Alibaba Cloud shared credentials, Alibaba Cloud CLI config, and ALIBABA_CLOUD_CREDENTIALS_URI sources. Explicit access keys, OIDC options that are all set on the builder, and the role_arn AssumeRole flow remain enabled, and ECS instance RAM role credentials keep loading from instance metadata.

enable_versioning: NotRequired[bool]#

Deprecated: OSS versioning capability is enabled by default. [Deprecated since 0.57.0] OSS versioning capability is enabled by default and this option is no longer needed.

endpoint: NotRequired[str]#

Endpoint for oss.

external_id: NotRequired[str]#

external_id for this backend.

oidc_provider_arn: NotRequired[str]#

oidc_provider_arn will be loaded from - this field if it’s is_some - env value: ALIBABA_CLOUD_OIDC_PROVIDER_ARN

oidc_token_file: NotRequired[str]#

oidc_token_file will be loaded from - this field if it’s is_some - env value: ALIBABA_CLOUD_OIDC_TOKEN_FILE

presign_addressing_style: NotRequired[str]#

Pre sign addressing style for oss.

presign_endpoint: NotRequired[str]#

Presign endpoint for oss.

role_arn: NotRequired[str]#

If role_arn is set, we will use already known config as source credential to assume role with role_arn. - this field if it’s is_some - env value: ALIBABA_CLOUD_ROLE_ARN

role_session_name: NotRequired[str]#

role_session_name for this backend.

root: NotRequired[str | os.PathLike[str]]#

Root for oss.

scheme: Required[Literal['oss']]#

The service scheme; fixed to “oss”.

security_token: NotRequired[str]#

security_token will be loaded from - this field if it’s is_some - env value: ALIBABA_CLOUD_SECURITY_TOKEN

server_side_encryption: NotRequired[str]#

Server side encryption for oss.

server_side_encryption_key_id: NotRequired[str]#

Server side encryption key id for oss.

skip_signature: NotRequired[bool]#

Skip signature will skip loading credentials and signing requests.

sts_endpoint: NotRequired[str]#

sts_endpoint will be loaded from - this field if it’s is_some - env value: ALIBABA_CLOUD_STS_ENDPOINT

class opendal.config.OssS3Config#

Bases: TypedDict

Configuration for the oss-s3 service.

access_key_id: NotRequired[str]#

Alibaba Cloud RAM AccessKey ID.

bucket: Required[str]#

Bucket name.

disable_config_load: NotRequired[bool]#

Disable loading credentials from AWS environment variables and shared profile files. Set both access_key_id and secret_access_key when enabled.

endpoint: NotRequired[str]#

HTTP(S) base endpoint override.

region: Required[str]#

OSS bucket region. Also used to sign requests.

root: NotRequired[str | os.PathLike[str]]#

Root within the bucket. The default is /.

scheme: Required[Literal['oss-s3']]#

The service scheme; fixed to “oss-s3”.

secret_access_key: NotRequired[str]#

Alibaba Cloud RAM AccessKey secret.

session_token: NotRequired[str]#

Session token for temporary credentials. Requires both keys.

class opendal.config.OvhcloudConfig#

Bases: TypedDict

Configuration for the ovhcloud service.

access_key_id: NotRequired[str]#

Access key ID. Set this field together with secret_access_key.

bucket: Required[str]#

Bucket name.

disable_config_load: NotRequired[bool]#

Disable loading credentials from AWS environment variables and shared profile files. Set both access_key_id and secret_access_key when enabled.

enable_virtual_host_style: NotRequired[bool]#

Use virtual-hosted-style bucket addressing.

endpoint: NotRequired[str]#

Explicit HTTP(S) base endpoint. The default is https://s3.<region>.io.cloud.ovh.net.

region: Required[str]#

Bucket region, used as the signing region.

root: NotRequired[str | os.PathLike[str]]#

Root within the bucket. The default is /.

scheme: Required[Literal['ovhcloud']]#

The service scheme; fixed to “ovhcloud”.

secret_access_key: NotRequired[str]#

Secret access key. Set this field together with access_key_id.

class opendal.config.PersyConfig#

Bases: TypedDict

Configuration for the persy service.

datafile: NotRequired[str]#

That path to the persy data file. The directory in the path must already exist.

index: NotRequired[str]#

That name of the persy index.

scheme: Required[Literal['persy']]#

The service scheme; fixed to “persy”.

segment: NotRequired[str]#

That name of the persy segment.

class opendal.config.PostgresqlConfig#

Bases: TypedDict

Configuration for the postgresql service.

connection_string: NotRequired[str]#

The URL should be with a scheme of either postgres:// or postgresql://. - postgresql://user@localhost - postgresql://user:password@%2Fvar%2Flib%2Fpostgresql/mydb?connect_timeout=10 - postgresql://user@host1:1234,host2,host3:5678?target_session_attrs=read-write - postgresql:///mydb?user=user&host=/var/lib/postgresql For more information, please visit <https://docs.rs/sqlx/latest/sqlx/postgres/struct.PgConnectOptions.html>.

key_field: NotRequired[str]#

the key field of postgresql

root: NotRequired[str | os.PathLike[str]]#

Root of this backend. All operations will happen under this root. Default to / if not set.

scheme: Required[Literal['postgresql']]#

The service scheme; fixed to “postgresql”.

table: NotRequired[str]#

the table of postgresql

value_field: NotRequired[str]#

the value field of postgresql

class opendal.config.QingstorConfig#

Bases: TypedDict

Configuration for the qingstor service.

access_key_id: NotRequired[str]#

Access key ID. Set this field together with secret_access_key.

bucket: Required[str]#

Bucket name.

disable_config_load: NotRequired[bool]#

Disable loading credentials from AWS environment variables and shared profile files. Set both access_key_id and secret_access_key when enabled.

enable_virtual_host_style: NotRequired[bool]#

Use virtual-hosted-style bucket addressing.

endpoint: NotRequired[str]#

Explicit HTTP(S) base endpoint. The default is https://s3.<zone>.qsstor.com.

root: NotRequired[str | os.PathLike[str]]#

Root within the bucket. The default is /.

scheme: Required[Literal['qingstor']]#

The service scheme; fixed to “qingstor”.

secret_access_key: NotRequired[str]#

Secret access key. Set this field together with access_key_id.

zone: Required[str]#

Bucket zone, used as the signing region.

class opendal.config.R2Config#

Bases: TypedDict

Configuration for the r2 service.

access_key_id: NotRequired[str]#

Access key ID. Set this field together with secret_access_key.

account_id: NotRequired[str]#

Cloudflare account ID used to derive the R2 endpoint. Set exactly one of account_id and endpoint.

bucket: Required[str]#

Bucket name. This field is required.

disable_config_load: NotRequired[bool]#

Disable loading credentials from AWS environment variables and shared profile files. Set both access_key_id and secret_access_key when enabled.

endpoint: NotRequired[str]#

Explicit R2-compatible endpoint. Use this field for a proxy, gateway, or test server. Set exactly one of endpoint and account_id.

jurisdiction: NotRequired[str]#

R2 jurisdiction. Supported values are eu, fedramp, and us. This field requires account_id and cannot be used with endpoint.

root: NotRequired[str | os.PathLike[str]]#

Root within the bucket. All operations happen under this root. The default is /.

scheme: Required[Literal['r2']]#

The service scheme; fixed to “r2”.

secret_access_key: NotRequired[str]#

Secret access key. Set this field together with access_key_id.

session_token: NotRequired[str]#

Session token for temporary credentials. This field requires access_key_id and secret_access_key.

class opendal.config.RedbConfig#

Bases: TypedDict

Configuration for the redb service.

datadir: NotRequired[str]#

path to the redb data directory.

root: NotRequired[str | os.PathLike[str]]#

The root for redb.

scheme: Required[Literal['redb']]#

The service scheme; fixed to “redb”.

table: NotRequired[str]#

The table name for redb.

class opendal.config.RedisConfig#

Bases: TypedDict

Configuration for the redis service.

cluster_endpoints: NotRequired[str]#

network address of the Redis cluster service. Can be “tcp://127.0.0.1:6379,tcp://127.0.0.1:6380,tcp://127.0.0.1:6381”, e.g. default is None

connection_pool_max_size: NotRequired[int]#

The maximum number of connections allowed. default is 10

db: Required[int]#

the number of DBs redis can take is unlimited default is db 0

default_ttl: NotRequired[str | timedelta]#

The default ttl for put operations. A datetime.timedelta or human readable duration string, e.g. “5s” (see https://docs.rs/humantime/latest/humantime/fn.parse_duration.html).

endpoint: NotRequired[str]#

network address of the Redis service. Can be “tcp://127.0.0.1:6379”, e.g. default is “tcp://127.0.0.1:6379”

password: NotRequired[str]#

the password for authentication default is None

read_from_replicas: NotRequired[bool]#

Route read-only commands for read and stat to Redis Cluster replicas when available. Defaults to false. Enabling this option requires cluster_endpoints. Replication lag can cause stale results. For example, read or stat can briefly return ErrorKind::NotFound for a just-written key. OpenDAL returns a replica miss without retrying on the primary.

root: NotRequired[str | os.PathLike[str]]#

the working directory of the Redis service. Can be “/path/to/dir” default is “/”

scheme: Required[Literal['redis']]#

The service scheme; fixed to “redis”.

username: NotRequired[str]#

the username to connect redis service. default is None

class opendal.config.RetryLayerConfig#

Bases: TypedDict

Configuration for the retry layer.

factor: NotRequired[float]#

Backoff multiplier. Must be finite and at least 1.

jitter: NotRequired[bool]#

Add randomness to retry delays.

max_delay: NotRequired[timedelta]#

Positive upper bound for retry delays before jitter.

max_times: NotRequired[int]#

Maximum retries after the initial attempt. Zero disables retries.

min_delay: NotRequired[timedelta]#

Positive initial delay before a retry.

name: Required[Literal['retry']]#

The layer name, fixed to retry.

class opendal.config.RustfsConfig#

Bases: TypedDict

Configuration for the rustfs service.

access_key_id: NotRequired[str]#

Access key ID. Set this field together with secret_access_key.

bucket: Required[str]#

Bucket name.

disable_config_load: NotRequired[bool]#

Disable loading credentials from AWS environment variables and shared profile files. Set both access_key_id and secret_access_key when enabled.

enable_virtual_host_style: NotRequired[bool]#

Use virtual-hosted-style addressing when the deployment has a matching RUSTFS_SERVER_DOMAINS.

endpoint: Required[str]#

HTTP(S) base URL of the deployment’s S3 API.

region: NotRequired[str]#

Signing region. Defaults to us-east-1.

root: NotRequired[str | os.PathLike[str]]#

Root within the bucket. The default is /.

scheme: Required[Literal['rustfs']]#

The service scheme; fixed to “rustfs”.

secret_access_key: NotRequired[str]#

Secret access key. Set this field together with access_key_id.

class opendal.config.S3Config#

Bases: TypedDict

Configuration for the s3 service.

access_key_id: NotRequired[str]#

access_key_id of this backend. - If access_key_id is set, we will take user’s input first. - If not, we will try to load it from environment.

allow_anonymous: NotRequired[bool]#

Allow anonymous will allow opendal to send request without signing when credential is not loaded. [Deprecated since 0.57.0] Please use skip_signature instead of allow_anonymous

assume_role_duration_seconds: NotRequired[int]#

assume_role_duration_seconds for this backend.

assume_role_session_tags: NotRequired[dict[str, str]]#

assume_role_session_tags for this backend.

batch_max_operations: NotRequired[int]#

Deprecated: S3 delete batch capability is enabled by default. [Deprecated since 0.57.0] S3 delete batch capability is enabled by default. Use CapabilityOverrideLayer to override delete_max_size for specific endpoints.

bucket: Required[str]#

bucket name of this backend. required.

checksum_algorithm: NotRequired[str]#

Checksum Algorithm to use when sending checksums in HTTP headers. This is necessary when writing to AWS S3 Buckets with Object Lock enabled for example. Available options: - “crc32c” - “md5”

container_authorization_token: NotRequired[str]#

Authorization token sent to the AWS container credential endpoint. This token takes precedence over the configured token file and the ambient direct and file token forms.

container_authorization_token_file: NotRequired[str]#

File containing the authorization token sent to the AWS container credential endpoint. This file takes precedence over both ambient token forms. The credential provider trims surrounding whitespace after reading the file.

container_credentials_endpoint: NotRequired[str]#

Full URI for AWS container credential metadata. This endpoint takes precedence over the relative container credential URI and both ambient container credential URI forms. It does not change the position or priority of the default ECS credential provider.

container_credentials_relative_uri: NotRequired[str]#

Relative URI for AWS container credential metadata. An explicit full endpoint takes precedence over this value. This value takes precedence over the ambient full and relative container credential URIs. OpenDAL joins it to container_metadata_uri_override when set, otherwise to http://169.254.170.2. Setting any container credential field replaces the ECS slot in the default credential chain. It does not move that slot ahead of earlier default providers.

container_metadata_uri_override: NotRequired[str]#

Base URI used to resolve a relative AWS container credential URI. This override affects relative URIs only. It does not alter a configured or ambient full URI. The override alone does not select an endpoint.

default_acl: NotRequired[str]#

Default ACL for new objects. Note that some s3 services like minio do not support this option.

default_region: NotRequired[str]#

Fallback signing region when neither region, AWS_REGION, nor AWS_DEFAULT_REGION supplies one.

default_storage_class: NotRequired[str]#

default storage_class for this backend. Available values: - DEEP_ARCHIVE - GLACIER - GLACIER_IR - INTELLIGENT_TIERING - ONEZONE_IA - EXPRESS_ONEZONE - OUTPOSTS - REDUCED_REDUNDANCY - STANDARD - STANDARD_IA S3 compatible services don’t support all of them

delete_max_size: NotRequired[int]#

Deprecated: S3 delete batch capability is enabled by default. [Deprecated since 0.57.0] S3 delete batch capability is enabled by default. Use CapabilityOverrideLayer to override delete_max_size for specific endpoints.

disable_config_load: NotRequired[bool]#

Disable automatic endpoint loading and ambient environment/profile credential providers. This skips endpoint environment variables and removes the static environment, shared-profile, SSO, web-identity, and external process credential slots. Region environment lookup and compute metadata credential providers, including AWS container credentials and EC2 instance metadata, remain enabled.

disable_ec2_metadata: NotRequired[bool]#

Disable load credential from ec2 metadata. This option is used to disable the default behavior of opendal to load credential from ec2 metadata, a.k.a., IMDSv2

disable_list_objects_v2: NotRequired[bool]#

OpenDAL uses List Objects V2 by default to list objects. However, some legacy services do not yet support V2. This option allows users to switch back to the older List Objects V1.

disable_stat_with_override: NotRequired[bool]#

Deprecated: S3 stat override capabilities are enabled by default. [Deprecated since 0.57.0] S3 stat override capabilities are enabled by default. Use CapabilityOverrideLayer to override them for specific endpoints.

disable_write_with_if_match: NotRequired[bool]#

Deprecated: S3 write with If-Match capability is enabled by default. [Deprecated since 0.57.0] S3 write with If-Match capability is enabled by default and this option is no longer needed.

enable_request_payer: NotRequired[bool]#

Indicates whether the client agrees to pay for the requests made to the S3 bucket.

enable_versioning: NotRequired[bool]#

Deprecated: S3 versioning capability is enabled by default. [Deprecated since 0.57.0] S3 versioning capability is enabled by default and this option is no longer needed.

enable_virtual_host_style: NotRequired[bool]#

Enable virtual host style so that opendal will send API requests in virtual host style instead of path style. - By default, opendal will send API to https://s3.us-east-1.amazonaws.com/bucket_name - Enabled, opendal will send API to https://bucket_name.s3.us-east-1.amazonaws.com

enable_write_with_append: NotRequired[bool]#

Deprecated: S3 append capability is enabled by default. [Deprecated since 0.57.0] S3 append capability is enabled by default and this option is no longer needed.

endpoint: NotRequired[str]#

endpoint of this backend. Endpoint must be full uri, e.g. - AWS S3: https://s3.amazonaws.com or https://s3.{region}.amazonaws.com - Cloudflare R2: https://<ACCOUNT_ID>.r2.cloudflarestorage.com - Aliyun OSS: https://{region}.aliyuncs.com - Tencent COS: https://cos.{region}.myqcloud.com - Minio: http://127.0.0.1:9000 If user inputs endpoint without scheme like “s3.amazonaws.com”, we will prepend “https://” before it. - If endpoint is set, we will take user’s input first. - If not, we will try to load it from environment. - If still not set, default to https://s3.amazonaws.com.

external_id: NotRequired[str]#

external_id for this backend.

profile: NotRequired[str]#

AWS profile. By default, reqsign which is the default credential provider, supplies profile in order: - explicit option - AWS_PROFILE environment variable, from which reqsign reads profile from: - ~/.aws/credentials (or the path specified by AWS_SHARED_CREDENTIALS_FILE) - ~/.aws/config (or the path specified by AWS_CONFIG_FILE)

region: NotRequired[str]#

Region represent the signing region of this endpoint. This is required if you are using the default AWS S3 endpoint. If using a custom endpoint, - If region is set, we will take user’s input first. - If not, we will try to load it from environment.

role_arn: NotRequired[str]#

role_arn for this backend. If role_arn is set, we will use already known config as source credential to assume role with role_arn.

role_session_name: NotRequired[str]#

role_session_name for this backend.

root: NotRequired[str | os.PathLike[str]]#

root of this backend. All operations will happen under this root. default to / if not set.

scheme: Required[Literal['s3']]#

The service scheme; fixed to “s3”.

secret_access_key: NotRequired[str]#

secret_access_key of this backend. - If secret_access_key is set, we will take user’s input first. - If not, we will try to load it from environment.

server_side_encryption: NotRequired[str]#

server_side_encryption for this backend. Available values: AES256, aws:kms.

server_side_encryption_aws_kms_key_id: NotRequired[str]#

server_side_encryption_aws_kms_key_id for this backend - If server_side_encryption set to aws:kms, and server_side_encryption_aws_kms_key_id is not set, S3 will use aws managed kms key to encrypt data. - If server_side_encryption set to aws:kms, and server_side_encryption_aws_kms_key_id is a valid kms key id, S3 will use the provided kms key to encrypt data. - If the server_side_encryption_aws_kms_key_id is invalid or not found, an error will be returned. - If server_side_encryption is not aws:kms, setting server_side_encryption_aws_kms_key_id is a noop.

server_side_encryption_bucket_key_enabled: NotRequired[bool]#

Control S3 Bucket Keys for SSE-KMS writes and copies. Omit this option to inherit the bucket setting. false disables Bucket Keys for destination objects, and true enables them.

server_side_encryption_customer_algorithm: NotRequired[str]#

server_side_encryption_customer_algorithm for this backend. Available values: AES256.

server_side_encryption_customer_key: NotRequired[str]#

server_side_encryption_customer_key for this backend. Value: BASE64-encoded key that matches algorithm specified in server_side_encryption_customer_algorithm.

server_side_encryption_customer_key_md5: NotRequired[str]#

Set server_side_encryption_customer_key_md5 for this backend. Value: MD5 digest of key specified in server_side_encryption_customer_key.

session_token: NotRequired[str]#

session_token (aka, security token) of this backend. This token will expire after sometime, it’s recommended to set session_token by hand.

skip_signature: NotRequired[bool]#

Skip signature will skip loading credentials and signing requests.

class opendal.config.ScalewayConfig#

Bases: TypedDict

Configuration for the scaleway service.

access_key_id: NotRequired[str]#

Access key ID. Set this field together with secret_access_key.

bucket: Required[str]#

Bucket name.

disable_config_load: NotRequired[bool]#

Disable loading credentials from AWS environment variables and shared profile files. Set both access_key_id and secret_access_key when enabled.

enable_virtual_host_style: NotRequired[bool]#

Use virtual-hosted-style bucket addressing.

endpoint: NotRequired[str]#

Explicit HTTP(S) base endpoint. The default is https://s3.<region>.scw.cloud.

region: Required[str]#

Bucket region, used as the signing region.

root: NotRequired[str | os.PathLike[str]]#

Root within the bucket. The default is /.

scheme: Required[Literal['scaleway']]#

The service scheme; fixed to “scaleway”.

secret_access_key: NotRequired[str]#

Secret access key. Set this field together with access_key_id.

class opendal.config.SeafileConfig#

Bases: TypedDict

Configuration for the seafile service.

endpoint: NotRequired[str]#

endpoint address of this backend.

password: NotRequired[str]#

password of this backend.

repo_name: Required[str]#

repo_name of this backend. required.

root: NotRequired[str | os.PathLike[str]]#

root of this backend. All operations will happen under this root.

scheme: Required[Literal['seafile']]#

The service scheme; fixed to “seafile”.

username: NotRequired[str]#

username of this backend.

class opendal.config.SeaweedfsConfig#

Bases: TypedDict

Configuration for the seaweedfs service.

access_key_id: NotRequired[str]#

Access key ID. Set this field together with secret_access_key.

bucket: Required[str]#

Bucket name.

disable_config_load: NotRequired[bool]#

Disable loading credentials from AWS environment variables and shared profile files. Set both access_key_id and secret_access_key when enabled.

enable_virtual_host_style: NotRequired[bool]#

Use virtual-hosted-style addressing when the gateway has a matching domainName.

endpoint: Required[str]#

HTTP(S) base URL of the deployment’s S3 gateway.

region: NotRequired[str]#

Signing region. Defaults to us-east-1.

root: NotRequired[str | os.PathLike[str]]#

Root within the bucket. The default is /.

scheme: Required[Literal['seaweedfs']]#

The service scheme; fixed to “seaweedfs”.

secret_access_key: NotRequired[str]#

Secret access key. Set this field together with access_key_id.

opendal.config.ServiceConfig = opendal.config.AkamaiConfig | opendal.config.AliyunDriveConfig | opendal.config.AlluxioConfig | opendal.config.AzblobConfig | opendal.config.AzdlsConfig | opendal.config.AzfileConfig | opendal.config.B2Config | opendal.config.B2S3Config | opendal.config.CacacheConfig | opendal.config.CephRgwConfig | opendal.config.CosConfig | opendal.config.CosS3Config | opendal.config.DashmapConfig | opendal.config.DropboxConfig | opendal.config.ExoscaleConfig | opendal.config.FoyerConfig | opendal.config.FsConfig | opendal.config.FtpConfig | opendal.config.GarageConfig | opendal.config.GcsConfig | opendal.config.GcsGrpcConfig | opendal.config.GcsS3Config | opendal.config.GdriveConfig | opendal.config.GhacConfig | opendal.config.GithubConfig | opendal.config.GridfsConfig | opendal.config.HdfsNativeConfig | opendal.config.HetznerConfig | opendal.config.HfConfig | opendal.config.HttpConfig | opendal.config.IbmCosConfig | opendal.config.IdriveE2Config | opendal.config.IonosConfig | opendal.config.IpfsConfig | opendal.config.IpmfsConfig | opendal.config.KoofrConfig | opendal.config.LakefsS3Config | opendal.config.MemcachedConfig | opendal.config.MemoryConfig | opendal.config.MiniMokaConfig | opendal.config.MinioConfig | opendal.config.MokaConfig | opendal.config.MongodbConfig | opendal.config.MysqlConfig | opendal.config.NeonConfig | opendal.config.ObsConfig | opendal.config.ObsS3Config | opendal.config.OciConfig | opendal.config.OnedriveConfig | opendal.config.OssConfig | opendal.config.OssS3Config | opendal.config.OvhcloudConfig | opendal.config.PersyConfig | opendal.config.PostgresqlConfig | opendal.config.QingstorConfig | opendal.config.R2Config | opendal.config.RedbConfig | opendal.config.RedisConfig | opendal.config.RustfsConfig | opendal.config.S3Config | opendal.config.ScalewayConfig | opendal.config.SeafileConfig | opendal.config.SeaweedfsConfig | opendal.config.SftpConfig | opendal.config.SledConfig | opendal.config.SpacesConfig | opendal.config.SqliteConfig | opendal.config.StorjConfig | opendal.config.SupabaseConfig | opendal.config.SwiftConfig | opendal.config.SwiftS3apiConfig | opendal.config.TigrisConfig | opendal.config.TosConfig | opendal.config.TosS3Config | opendal.config.UpyunConfig | opendal.config.VercelArtifactsConfig | opendal.config.WasabiConfig | opendal.config.WebdavConfig | opendal.config.WebhdfsConfig | opendal.config.YandexDiskConfig#

Discriminated union of every service configuration, keyed on scheme.

class opendal.config.SftpConfig#

Bases: TypedDict

Configuration for the sftp service.

acquire_timeout: NotRequired[str | timedelta]#

Time limit for waiting for an SFTP connection pool slot. Defaults to 10 seconds. Zero disables the limit. A datetime.timedelta or human readable duration string, e.g. “5s” (see https://docs.rs/humantime/latest/humantime/fn.parse_duration.html).

connect_timeout: NotRequired[str | timedelta]#

Time limit for each SFTP connection setup stage and each pooled connection health check. Defaults to 10 seconds. Zero disables the limit. A datetime.timedelta or human readable duration string, e.g. “5s” (see https://docs.rs/humantime/latest/humantime/fn.parse_duration.html).

control_directory: NotRequired[str]#

Directory for the SSH control socket. The SSH client creates a temporary directory holding the control socket here. Defaults to $XDG_STATE_HOME or $HOME/.local/state, falling back to the current directory.

enable_copy: NotRequired[bool]#

Deprecated: SFTP copy capability is enabled by default. [Deprecated since 0.57.0] SFTP copy capability is enabled by default and this option is no longer needed.

endpoint: NotRequired[str]#

endpoint of this backend

key: NotRequired[str]#

key of this backend

known_hosts_strategy: NotRequired[str]#

known_hosts_strategy of this backend

root: NotRequired[str | os.PathLike[str]]#

root of this backend

scheme: Required[Literal['sftp']]#

The service scheme; fixed to “sftp”.

user: NotRequired[str]#

user of this backend

class opendal.config.SledConfig#

Bases: TypedDict

Configuration for the sled service.

datadir: NotRequired[str]#

That path to the sled data directory.

root: NotRequired[str | os.PathLike[str]]#

The root for sled.

scheme: Required[Literal['sled']]#

The service scheme; fixed to “sled”.

tree: NotRequired[str]#

The tree for sled.

class opendal.config.SpacesConfig#

Bases: TypedDict

Configuration for the spaces service.

access_key_id: NotRequired[str]#

Access key ID. Set this field together with secret_access_key.

bucket: Required[str]#

Bucket name.

datacenter: NotRequired[str]#

Spaces datacenter slug. Required unless endpoint is set.

disable_config_load: NotRequired[bool]#

Disable loading credentials from AWS environment variables and shared profile files. Set both access_key_id and secret_access_key when enabled.

enable_virtual_host_style: NotRequired[bool]#

Use virtual-hosted-style bucket addressing.

endpoint: NotRequired[str]#

Explicit HTTP(S) base endpoint. The default is https://<datacenter>.digitaloceanspaces.com.

region: NotRequired[str]#

Signing region, independent of the Spaces datacenter.

root: NotRequired[str | os.PathLike[str]]#

Root within the bucket. The default is /.

scheme: Required[Literal['spaces']]#

The service scheme; fixed to “spaces”.

secret_access_key: NotRequired[str]#

Secret access key. Set this field together with access_key_id.

class opendal.config.SqliteConfig#

Bases: TypedDict

Configuration for the sqlite service.

connection_string: NotRequired[str]#

Set the connection_string of the sqlite service. This connection string is used to connect to the sqlite service. The format of connect string resembles the url format of the sqlite client: - sqlite::memory: - sqlite:data.db - sqlite://data.db For more information, please visit <https://docs.rs/sqlx/latest/sqlx/sqlite/struct.SqliteConnectOptions.html>.

key_field: NotRequired[str]#

Set the key field name of the sqlite service to read/write. Default to key if not specified.

root: NotRequired[str | os.PathLike[str]]#

set the working directory, all operations will be performed under it. default: “/”

scheme: Required[Literal['sqlite']]#

The service scheme; fixed to “sqlite”.

table: NotRequired[str]#

Set the table name of the sqlite service to read/write.

value_field: NotRequired[str]#

Set the value field name of the sqlite service to read/write. Default to value if not specified.

class opendal.config.StorjConfig#

Bases: TypedDict

Configuration for the storj service.

access_key_id: NotRequired[str]#

Access key ID. Set this field together with secret_access_key.

bucket: Required[str]#

Bucket name.

disable_config_load: NotRequired[bool]#

Disable loading credentials from AWS environment variables and shared profile files. Set both access_key_id and secret_access_key when enabled.

endpoint: Required[str]#

HTTPS gateway URL issued with the S3 key pair for the access grant.

region: NotRequired[str]#

Signing region. Defaults to us-east-1.

root: NotRequired[str | os.PathLike[str]]#

Root within the bucket. The default is /.

scheme: Required[Literal['storj']]#

The service scheme; fixed to “storj”.

secret_access_key: NotRequired[str]#

Secret access key. Set this field together with access_key_id.

class opendal.config.SupabaseConfig#

Bases: TypedDict

Configuration for the supabase service.

access_key_id: NotRequired[str]#

Access key ID. Set this field together with secret_access_key.

bucket: Required[str]#

Bucket name.

disable_config_load: NotRequired[bool]#

Disable loading credentials from AWS environment variables and shared profile files. Set both access_key_id and secret_access_key when enabled.

endpoint: NotRequired[str]#

Explicit HTTP(S) base endpoint. The default is https://<project_ref>.storage.supabase.co/storage/v1/s3.

project_ref: NotRequired[str]#

Supabase project reference. Required unless endpoint is set.

region: Required[str]#

Region from the project’s S3 settings, used for signing.

root: NotRequired[str | os.PathLike[str]]#

Root within the bucket. The default is /.

scheme: Required[Literal['supabase']]#

The service scheme; fixed to “supabase”.

secret_access_key: NotRequired[str]#

Secret access key. Set this field together with access_key_id.

session_token: NotRequired[str]#

User JWT for Supabase session authentication. Requires access_key_id and secret_access_key.

class opendal.config.SwiftConfig#

Bases: TypedDict

Configuration for the swift service.

container: NotRequired[str]#

The container for Swift.

endpoint: NotRequired[str]#

The endpoint for Swift.

root: NotRequired[str | os.PathLike[str]]#

The root for Swift.

scheme: Required[Literal['swift']]#

The service scheme; fixed to “swift”.

temp_url_hash_algorithm: NotRequired[str]#

The hash algorithm for TempURL signing. Supported values: sha1, sha256, sha512. Defaults to sha256. The cluster must have the chosen algorithm in its tempurl.allowed_digests (check GET /info).

temp_url_key: NotRequired[str]#

The TempURL key for generating presigned URLs. This corresponds to the X-Account-Meta-Temp-URL-Key or X-Container-Meta-Temp-URL-Key header value configured on the Swift account or container.

token: NotRequired[str]#

The token for Swift.

class opendal.config.SwiftS3apiConfig#

Bases: TypedDict

Configuration for the swift-s3api service.

access_key_id: NotRequired[str]#

S3 access key ID, such as the access key from a Keystone EC2 credential.

bucket: Required[str]#

Swift container name as exposed by s3api.

disable_config_load: NotRequired[bool]#

Disable loading credentials from AWS environment variables and shared profile files. Set both access_key_id and secret_access_key when enabled.

enable_virtual_host_style: NotRequired[bool]#

Use virtual-hosted-style addressing when the proxy defines a matching storage_domain.

endpoint: Required[str]#

HTTP(S) base URL of the Swift proxy with s3api enabled.

region: NotRequired[str]#

Signing region configured as location in s3api. Defaults to us-east-1.

root: NotRequired[str | os.PathLike[str]]#

Root within the bucket. The default is /.

scheme: Required[Literal['swift-s3api']]#

The service scheme; fixed to “swift-s3api”.

secret_access_key: NotRequired[str]#

S3 secret access key, such as the secret from a Keystone EC2 credential.

class opendal.config.TigrisConfig#

Bases: TypedDict

Configuration for the tigris service.

access_key_id: NotRequired[str]#

Access key ID. Set this field together with secret_access_key.

bucket: Required[str]#

Bucket name.

disable_config_load: NotRequired[bool]#

Disable loading credentials from AWS environment variables and shared profile files. Set both access_key_id and secret_access_key when enabled.

enable_virtual_host_style: NotRequired[bool]#

Use virtual-hosted-style bucket addressing.

endpoint: NotRequired[str]#

Explicit HTTP(S) base endpoint. The default is https://t3.storage.dev.

region: NotRequired[str]#

Signing region.

root: NotRequired[str | os.PathLike[str]]#

Root within the bucket. The default is /.

scheme: Required[Literal['tigris']]#

The service scheme; fixed to “tigris”.

secret_access_key: NotRequired[str]#

Secret access key. Set this field together with access_key_id.

session_token: NotRequired[str]#

Session token for temporary credentials. Requires both access keys.

class opendal.config.TimeoutLayerConfig#

Bases: TypedDict

Configuration for the timeout layer.

io_timeout: NotRequired[timedelta]#

Deadline for an I/O step, such as reading a chunk.

name: Required[Literal['timeout']]#

The layer name, fixed to timeout.

timeout: NotRequired[timedelta]#

Deadline for a service operation, such as stat.

class opendal.config.TosConfig#

Bases: TypedDict

Configuration for the tos service.

access_key_id: NotRequired[str]#

access_key_id of this backend. - If access_key_id is set, we will take user’s input first. - If not, we will try to load it from environment.

bucket: Required[str]#

bucket name of this backend. required.

disable_config_load: NotRequired[bool]#

Disable config load so that opendal will not load config from environment. For examples: - envs like VOLCENGINE_ACCESS_KEY_ID

endpoint: NotRequired[str]#

endpoint of this backend. Endpoint must be full uri, e.g. - TOS: https://tos-cn-beijing.volces.com - TOS with region: https://tos-{region}.volces.com If user inputs endpoint without scheme like “tos-cn-beijing.volces.com”, we will prepend “https://” before it.

region: NotRequired[str]#

Region represent the signing region of this endpoint. Required if endpoint is not provided. - If region is set, we will take user’s input first. - If not, we will try to load it from environment. - If still not set, default to cn-beijing.

root: NotRequired[str | os.PathLike[str]]#

root of this backend. All operations will happen under this root. default to / if not set.

scheme: Required[Literal['tos']]#

The service scheme; fixed to “tos”.

secret_access_key: NotRequired[str]#

secret_access_key of this backend. - If secret_access_key is set, we will take user’s input first. - If not, we will try to load it from environment.

security_token: NotRequired[str]#

security_token of this backend. This token will expire after sometime, it’s recommended to set security_token by hand.

skip_signature: NotRequired[bool]#

Skip signature will skip loading credentials and signing requests.

class opendal.config.TosS3Config#

Bases: TypedDict

Configuration for the tos-s3 service.

access_key_id: NotRequired[str]#

TOS access key ID.

bucket: Required[str]#

Bucket name.

disable_config_load: NotRequired[bool]#

Disable loading credentials from AWS environment variables and shared profile files. Set both access_key_id and secret_access_key when enabled.

endpoint: Required[str]#

HTTP(S) S3-compatible base endpoint for the selected TOS product and region.

region: Required[str]#

Signing region for the selected TOS S3 endpoint.

root: NotRequired[str | os.PathLike[str]]#

Root within the bucket. The default is /.

scheme: Required[Literal['tos-s3']]#

The service scheme; fixed to “tos-s3”.

secret_access_key: NotRequired[str]#

TOS secret access key.

class opendal.config.UpyunConfig#

Bases: TypedDict

Configuration for the upyun service.

bucket: Required[str]#

bucket address of this backend.

operator: NotRequired[str]#

username of this backend.

password: NotRequired[str]#

password of this backend.

root: NotRequired[str | os.PathLike[str]]#

root of this backend. All operations will happen under this root.

scheme: Required[Literal['upyun']]#

The service scheme; fixed to “upyun”.

class opendal.config.VercelArtifactsConfig#

Bases: TypedDict

Configuration for the vercel-artifacts service.

access_token: NotRequired[str]#

The access token for Vercel.

endpoint: NotRequired[str]#

The endpoint for the Vercel artifacts API. Defaults to https://api.vercel.com.

scheme: Required[Literal['vercel-artifacts']]#

The service scheme; fixed to “vercel-artifacts”.

team_id: NotRequired[str]#

The Vercel team ID. When set, the teamId query parameter is appended to all API requests.

team_slug: NotRequired[str]#

The Vercel team slug. When set, the slug query parameter is appended to all API requests.

class opendal.config.WasabiConfig#

Bases: TypedDict

Configuration for the wasabi service.

access_key_id: NotRequired[str]#

Access key ID. Set this field together with secret_access_key.

bucket: Required[str]#

Bucket name.

disable_config_load: NotRequired[bool]#

Disable loading credentials from AWS environment variables and shared profile files. Set both access_key_id and secret_access_key when enabled.

enable_virtual_host_style: NotRequired[bool]#

Use virtual-hosted-style bucket addressing.

endpoint: NotRequired[str]#

Explicit HTTP(S) base endpoint. The default is the published service URL for the bucket region.

region: Required[str]#

Bucket region, used as the signing region.

root: NotRequired[str | os.PathLike[str]]#

Root within the bucket. The default is /.

scheme: Required[Literal['wasabi']]#

The service scheme; fixed to “wasabi”.

secret_access_key: NotRequired[str]#

Secret access key. Set this field together with access_key_id.

session_token: NotRequired[str]#

Session token for temporary credentials. Requires both access keys.

class opendal.config.WebdavConfig#

Bases: TypedDict

Configuration for the webdav service.

disable_copy: NotRequired[bool]#

Deprecated: WebDAV copy capability is enabled by default. [Deprecated since 0.57.0] WebDAV copy capability is enabled by default and this option is no longer needed.

disable_create_dir: NotRequired[bool]#

Disable automatic parent directory creation before writing files. By default, OpenDAL checks for parent directories using PROPFIND and creates missing directories using MKCOL before writing files. Enable this option to skip those checks and MKCOL calls for servers such as bazel-remote. Explicit create_dir calls are unaffected. Default: false

disable_depth_infinity: NotRequired[bool]#

Disable native recursive listing with WebDAV’s Depth: infinity. Set this to true for servers that reject or ignore infinity depth. With capability simulation enabled, OpenDAL walks the directory tree using Depth: 1 requests instead. The default is false.

enable_conditional_read: NotRequired[bool]#

Deprecated: WebDAV conditional read capabilities are enabled by default. [Deprecated since 0.60.0] WebDAV conditional read capabilities are enabled by default. Use CapabilityOverrideLayer to override read_with_if_match, read_with_if_none_match, read_with_if_modified_since and read_with_if_unmodified_since for endpoints without ETag support.

enable_user_metadata: NotRequired[bool]#

Deprecated: WebDAV user metadata capability is enabled by default. [Deprecated since 0.57.0] WebDAV user metadata capability is enabled by default. Use CapabilityOverrideLayer to override write_with_user_metadata for endpoints without PROPPATCH support.

endpoint: NotRequired[str]#

endpoint of this backend

password: NotRequired[str]#

password of this backend

root: NotRequired[str | os.PathLike[str]]#

root of this backend

scheme: Required[Literal['webdav']]#

The service scheme; fixed to “webdav”.

token: NotRequired[str]#

token of this backend

user_metadata_prefix: NotRequired[str]#

The XML namespace prefix for user metadata properties. This prefix is used in PROPPATCH/PROPFIND XML requests. Different servers may require different prefixes. Default: “opendal”

user_metadata_uri: NotRequired[str]#

The XML namespace URI for user metadata properties. This URI uniquely identifies the namespace for custom properties. Different servers may require different namespace URIs. For example, Nextcloud might work better with its own namespace. Default: https://opendal.apache.org/ns

username: NotRequired[str]#

username of this backend

class opendal.config.WebhdfsConfig#

Bases: TypedDict

Configuration for the webhdfs service.

atomic_write_dir: NotRequired[str | os.PathLike[str]]#

atomic_write_dir of this backend

delegation: NotRequired[str]#

Delegation token for webhdfs.

disable_list_batch: NotRequired[bool]#

Disable batch listing

endpoint: NotRequired[str]#

Endpoint for webhdfs.

root: NotRequired[str | os.PathLike[str]]#

Root for webhdfs.

scheme: Required[Literal['webhdfs']]#

The service scheme; fixed to “webhdfs”.

user_name: NotRequired[str]#

Name of the user for webhdfs.

class opendal.config.YandexDiskConfig#

Bases: TypedDict

Configuration for the yandex-disk service.

access_token: Required[str]#

yandex disk oauth access_token.

root: NotRequired[str | os.PathLike[str]]#

root of this backend. All operations will happen under this root.

scheme: Required[Literal['yandex-disk']]#

The service scheme; fixed to “yandex-disk”.