# nodus.volume

> `Volume`: named storage with Modal's commit and reload semantics for `ReadWriteMany` (resources.md §5.1, ADR-091).

Source: https://nodus-platform-site.pages.dev/docs/reference/python/nodus-volume/
Build revision: 211ad9f836655b1c3a2668c4693e442471f28614

<!-- Generated by scripts/gen-reference.mjs from the SDK docstrings (griffe). Do not edit: run make gen. -->

`Volume`: named storage with Modal’s commit and reload semantics for `ReadWriteMany` (resources.md §5.1, ADR-091).

File transfers go through the kopia client inside the `nodus` CLI with a storage grant from the Volume’s `uploads` subresource, so they run at object-store speed and never proxy bytes through the API.

## `BatchUpload`

```python
class BatchUpload(volume: _Volume) -> None
```

### `BatchUpload.put_directory`

```python
put_directory(local_path: str | os.PathLike[str], remote_path: str) -> None
```

### `BatchUpload.put_file`

```python
put_file(local_path: str | os.PathLike[str], remote_path: str) -> None
```

## `Volume`

```python
class Volume(name: str, *, create_if_missing: bool = False, access_mode: str | None = None, size: str = '50Gi', project: str | None = None, source: Obj | None = None) -> None
```

### `Volume.batch_upload`

```python
batch_upload() -> _BatchUpload
```

`with vol.batch_upload() as up: up.put_file(...); up.put_directory(...)` uploads as one revision.

### `Volume.clear`

```python
clear() -> None
```

Commit an empty revision; the Volume and its history stay.

### `Volume.commit`

```python
commit() -> None
```

Inside a container that mounts this Volume: publish this attempt’s changed paths as a new revision.

### `Volume.from_name`

```python
from_name(name: str, create_if_missing: bool = False, access_mode: str | None = None, size: str = '50Gi', project: str | None = None) -> _Volume
```

A reference resolved on first use; `create_if_missing=True` creates a `ReadWriteMany` Volume (as Modal).

### `Volume.import_from`

```python
import_from(name: str, *, huggingface: str | None = None, revision: str | None = None, git: str | None = None, url: str | None = None, sha256: str | None = None, extract: str = 'auto', s3: str | None = None, connection: str | None = None, query: str | None = None, secret: str | None = None, size: str = '50Gi', project: str | None = None) -> _Volume
```

Create a `ReadOnlyMany` Volume imported from Hugging Face, git, a URL, S3 or a Connection query.

### `Volume.listdir`

```python
listdir(path: str = '/') -> list[str]
```

### `Volume.name`

Type: `str`

### `Volume.put_directory`

```python
put_directory(local_path: str | os.PathLike[str], remote_path: str) -> None
```

### `Volume.put_file`

```python
put_file(local_path: str | os.PathLike[str], remote_path: str) -> None
```

### `Volume.read_file`

```python
read_file(remote_path: str) -> bytes
```

### `Volume.reload`

```python
reload() -> None
```

Inside a container: remount the latest revision (close open files first).

### `Volume.remove_file`

```python
remove_file(path: str) -> None
```

### `Volume.revisions`

```python
revisions() -> list[Obj]
```
