Providers¶
anyuri.providers.GSUri ¶
Bases: AnyUri
URI for Google Cloud Storage resources.
Accepts both gs:// and https://storage.googleapis.com/ forms.
Stores internally as HTTPS; as_uri() returns the gs:// form.
Examples:
>>> GSUri("gs://bucket/1.jpg")
GSUri("gs://bucket/1.jpg")
>>> GSUri("https://storage.googleapis.com/bucket/1.jpg")
GSUri("gs://bucket/1.jpg")
validate
classmethod
¶
validate(value)
Validate and return the appropriate AnyUri subclass for value.
Raises:
| Type | Description |
|---|---|
UriSchemaError
|
if no registered type accepts the input. |
Source code in src/anyuri/providers/_gcs.py
43 44 45 | |
as_uri ¶
as_uri()
Canonical URI form (e.g. gs://bucket/key for GCS).
Returns:
| Type | Description |
|---|---|
str
|
The canonical URI string. |
Source code in src/anyuri/providers/_gcs.py
47 48 | |
anyuri.providers.S3Uri ¶
Bases: AnyUri
URI for AWS S3 resources.
Accepts s3://, virtual-hosted HTTPS, and path-style HTTPS forms.
Stores internally as virtual-hosted HTTPS; as_uri() returns s3://.
Examples:
>>> S3Uri("s3://bucket/key.jpg")
S3Uri("s3://bucket/key.jpg")
>>> S3Uri("https://bucket.s3.amazonaws.com/key.jpg")
S3Uri("s3://bucket/key.jpg")
validate
classmethod
¶
validate(value)
Validate and return the appropriate AnyUri subclass for value.
Raises:
| Type | Description |
|---|---|
UriSchemaError
|
if no registered type accepts the input. |
Source code in src/anyuri/providers/_s3.py
63 64 65 | |
as_uri ¶
as_uri()
Canonical URI form (e.g. gs://bucket/key for GCS).
Returns:
| Type | Description |
|---|---|
str
|
The canonical URI string. |
Source code in src/anyuri/providers/_s3.py
67 68 69 70 71 | |
anyuri.providers.AzureUri ¶
Bases: AnyUri
URI for Azure Blob Storage resources.
Accepts abfs://, abfss:// (ADLS Gen2), and HTTPS Blob Storage forms.
Stores internally as HTTPS; as_uri() returns the abfs:// canonical form.
The ABFS format is: abfs://<container>@<account>.dfs.core.windows.net/<path>
Examples:
>>> AzureUri("abfs://container@account.dfs.core.windows.net/file.txt")
AzureUri("abfs://container@account.dfs.core.windows.net/file.txt")
>>> AzureUri("https://account.blob.core.windows.net/container/file.txt")
AzureUri("abfs://container@account.dfs.core.windows.net/file.txt")
validate
classmethod
¶
validate(value)
Validate and return the appropriate AnyUri subclass for value.
Raises:
| Type | Description |
|---|---|
UriSchemaError
|
if no registered type accepts the input. |
Source code in src/anyuri/providers/_azure.py
56 57 58 | |
as_uri ¶
as_uri()
Canonical URI form (e.g. gs://bucket/key for GCS).
Returns:
| Type | Description |
|---|---|
str
|
The canonical URI string. |
Source code in src/anyuri/providers/_azure.py
60 61 62 63 64 65 66 67 68 69 | |
anyuri.providers.R2Uri ¶
Bases: AnyUri
URI for Cloudflare R2 resources.
Accepts r2://<account>/<bucket>/<key> and HTTPS R2 storage forms.
Stores internally as HTTPS; as_uri() returns the r2:// form.
Examples:
>>> R2Uri("r2://accountid/bucket/key.jpg")
R2Uri("r2://accountid/bucket/key.jpg")
>>> R2Uri("https://accountid.r2.cloudflarestorage.com/bucket/key.jpg")
R2Uri("r2://accountid/bucket/key.jpg")
validate
classmethod
¶
validate(value)
Validate and return the appropriate AnyUri subclass for value.
Raises:
| Type | Description |
|---|---|
UriSchemaError
|
if no registered type accepts the input. |
Source code in src/anyuri/providers/_r2.py
48 49 50 | |
as_uri ¶
as_uri()
Canonical URI form (e.g. gs://bucket/key for GCS).
Returns:
| Type | Description |
|---|---|
str
|
The canonical URI string. |
Source code in src/anyuri/providers/_r2.py
52 53 54 55 56 | |
anyuri.providers.B2Uri ¶
Bases: AnyUri
URI for Backblaze B2 resources.
Accepts b2://bucket/key and https://f<N>.backblazeb2.com/file/bucket/key.
Always normalizes to the native b2:// form; the cluster number is discarded
because it is not derivable from the bucket name alone.
Examples:
>>> B2Uri("b2://mybucket/key.jpg")
B2Uri("b2://mybucket/key.jpg")
>>> B2Uri("https://f003.backblazeb2.com/file/mybucket/key.jpg")
B2Uri("b2://mybucket/key.jpg")
validate
classmethod
¶
validate(value)
Validate and return the appropriate AnyUri subclass for value.
Raises:
| Type | Description |
|---|---|
UriSchemaError
|
if no registered type accepts the input. |
Source code in src/anyuri/providers/_b2.py
52 53 54 | |
as_uri ¶
as_uri()
Canonical URI form (e.g. gs://bucket/key for GCS).
Returns:
| Type | Description |
|---|---|
str
|
The canonical URI string. |
Source code in src/anyuri/providers/_b2.py
56 57 | |