# tinker_cookbook.stores.AsyncStorage

## _class_ [**tinker_cookbook.stores.AsyncStorage**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/stores/storage.py#L159)( _Protocol_)

Async byte-level file I/O.

Cloud backends (S3, GCS) implement this natively. LocalStorage wraps sync methods with `asyncio.to_thread`.

### [**aread**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/stores/storage.py#L166)( _path_)

Async version of `Storage.read`.

**Parameters:**

- [**path**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/stores/storage.py#L166) ( _str_)

**Returns:** _bytes_

### [**awrite**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/stores/storage.py#L170)( _path_, _data_)

Async version of `Storage.write`.

**Parameters:**

- [**path**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/stores/storage.py#L170) ( _str_)
- [**data**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/stores/storage.py#L170) ( _bytes_)

**Returns:** _None_

### [**aappend**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/stores/storage.py#L174)( _path_, _data_)

Async version of `Storage.append`.

**Parameters:**

- [**path**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/stores/storage.py#L174) ( _str_)
- [**data**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/stores/storage.py#L174) ( _bytes_)

**Returns:** _None_

### [**aexists**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/stores/storage.py#L178)( _path_)

Async version of `Storage.exists`.

**Parameters:**

- [**path**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/stores/storage.py#L178) ( _str_)

**Returns:** _bool_

### [**astat**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/stores/storage.py#L182)( _path_)

Async version of `Storage.stat`.

**Parameters:**

- [**path**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/stores/storage.py#L182) ( _str_)

**Returns:** _[StorageStat](https://tinker-docs.thinkingmachines.ai/cookbook/api-reference/stores/storagestat/) \| None_

### [**aread_range**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/stores/storage.py#L186)( _path_, _offset_, _length_)

Async version of `Storage.read_range`.

**Parameters:**

- [**path**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/stores/storage.py#L186) ( _str_)
- [**offset**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/stores/storage.py#L186) ( _int_)
- [**length**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/stores/storage.py#L186) ( _int \| None_)

**Returns:** _bytes_

### [**alist_dir**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/stores/storage.py#L190)( _prefix_)

Async version of `Storage.list_dir`.

**Parameters:**

- [**prefix**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/stores/storage.py#L190) ( _str_)

**Returns:** _list[str]_

### [**aremove**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/stores/storage.py#L194)( _path_)

Async version of `Storage.remove`.

**Parameters:**

- [**path**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/stores/storage.py#L194) ( _str_)

**Returns:** _None_

### [**aremove_dir**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/stores/storage.py#L198)( _path_)

Async version of `Storage.remove_dir`.

**Parameters:**

- [**path**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/stores/storage.py#L198) ( _str_)

**Returns:** _None_

## Referenced by

- [tinker_cookbook.stores.LocalStorage](https://tinker-docs.thinkingmachines.ai/cookbook/api-reference/stores/localstorage/)
