tlcurl.url_adapters.api_url_adapter

A mostly dummy adapter for resolving URLs starting with api://.

Module Contents

Classes

Class

Description

ApiUrlAdapter

A mostly dummy adapter for resolving URLs starting with api://.

API

class ApiUrlAdapter

Bases: tlcurl.url_adapter.UrlAdapter

A mostly dummy adapter for resolving URLs starting with api://.

In fact, there is never a need to resolve “api://” URLs because the objects will already be in the ObjectRegistry, but this is a convenient place for putting other related functionality.

api_scheme = None
api_protocol = None
schemes() list[Scheme]
abstract read_string_content_from_url(
url: Url,
) str
abstract read_string_content_from_url_async(
url: Url,
) Future
abstract write_string_content_to_url_async(
url: Url,
content: str,
options: IfExistsOption = IfExistsOption.OVERWRITE,
) Future
abstract read_binary_content_from_url(
url: Url,
) bytes
abstract read_binary_content_from_url_async(
url: Url,
) Future
abstract write_binary_content_to_url_async(
url: Url,
content: bytes,
options: IfExistsOption = IfExistsOption.OVERWRITE,
) Future
abstract delete_url(
url: Url,
) None
abstract delete_url_async(
url: Url,
) Future
abstract copy_url_async(
source: Url,
destination: Url,
options: IfExistsOption = IfExistsOption.OVERWRITE,
) Future
abstract make_dirs(
url: Url,
exist_ok: bool = False,
) None
abstract make_dirs_async(
url: Url,
exist_ok: bool = False,
) Future
abstract get_file_size(
url: Url,
) int
abstract get_file_size_async(
url: Url,
) Future
abstract list_dir(
url: Url,
) Iterator[UrlAdapterDirEntry]
abstract list_dir_async(
url: Url,
) Future
exists(
url: Url,
) bool
abstract exists_async(
url: Url,
) Future
is_dir(
url: Url,
) bool
abstract is_dir_async(
url: Url,
) Future
is_writable(
url: Url,
) bool
abstract is_writable_async(
url: Url,
) Future
abstract stat(
url: Url,
) UrlAdapterDirEntry

API URLs don’t support file status operations.

Parameters:

url – The URL to get status for

Raises:

NotImplementedError – Always, as API URLs don’t support stat

abstract stat_async(
url: Url,
) Future
touch(
url: Url,
) None

API URLs don’t support file modification operations.

Parameters:

url – The URL to touch

Raises:

NotImplementedError – Always, as API URLs don’t support touch