MCPcopy Create free account
hub / github.com/apify/crawlee-python / open

Method open

src/crawlee/storages/_key_value_store.py:113–137  ·  view source on GitHub ↗
(
        cls,
        *,
        id: str | None = None,
        name: str | None = None,
        alias: str | None = None,
        configuration: Configuration | None = None,
        storage_client: StorageClient | None = None,
    )

Source from the content-addressed store, hash-verified

111 @override
112 @classmethod
113 async def open(
114 cls,
115 *,
116 id: str | None = None,
117 name: str | None = None,
118 alias: str | None = None,
119 configuration: Configuration | None = None,
120 storage_client: StorageClient | None = None,
121 ) -> KeyValueStore:
122 configuration = service_locator.get_configuration() if configuration is None else configuration
123 storage_client = service_locator.get_storage_client() if storage_client is None else storage_client
124
125 client_opener_coro = storage_client.create_kvs_client(
126 id=id, name=name, alias=alias, configuration=configuration
127 )
128 additional_cache_key = storage_client.get_storage_client_cache_key(configuration=configuration)
129
130 return await service_locator.storage_instance_manager.open_storage_instance(
131 cls,
132 id=id,
133 name=name,
134 alias=alias,
135 client_opener_coro=client_opener_coro,
136 storage_client_cache_key=additional_cache_key,
137 )
138
139 @override
140 async def drop(self) -> None:

Callers

nothing calls this directly

Calls 5

get_configurationMethod · 0.80
get_storage_clientMethod · 0.80
open_storage_instanceMethod · 0.80
create_kvs_clientMethod · 0.45

Tested by

no test coverage detected