# GCSDirectoryLoader

> **Class** in `langchain_google_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-google-community/gcs_directory/GCSDirectoryLoader)

Load documents from Google Cloud Storage directory.

Inherits from [`BaseLoader`][langchain_core.document_loaders.BaseLoader].

Loads all files from a GCS bucket with optional prefix filtering.

!!! note "Installation"

    Requires additional dependencies:

    ```bash
    pip install langchain-google-community[gcs]
    ```

## Signature

```python
GCSDirectoryLoader(
    self,
    project_name: str,
    bucket: str,
    prefix: str = '',
    loader_func: Optional[Callable[[str], BaseLoader]] = None,
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project_name` | `str` | Yes | The ID of the project for the GCS bucket. |
| `bucket` | `str` | Yes | The name of the GCS bucket. |
| `prefix` | `str` | No | The prefix of the GCS bucket. (default: `''`) |
| `loader_func` | `Optional[Callable[[str], BaseLoader]]` | No | A loader function that instantiates a loader based on a `file_path` argument. If nothing is provided, the  `GCSFileLoader` would use its default loader. (default: `None`) |

## Extends

- `BaseLoader`

## Constructors

```python
__init__(
    self,
    project_name: str,
    bucket: str,
    prefix: str = '',
    loader_func: Optional[Callable[[str], BaseLoader]] = None,
)
```

| Name | Type |
|------|------|
| `project_name` | `str` |
| `bucket` | `str` |
| `prefix` | `str` |
| `loader_func` | `Optional[Callable[[str], BaseLoader]]` |


## Properties

- `project_name`
- `bucket`
- `prefix`

## Methods

- [`load()`](https://reference.langchain.com/python/langchain-google-community/gcs_directory/GCSDirectoryLoader/load)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-google/blob/982e4015b249de8b9ba1e787746d8cc1f6d6b790/libs/community/langchain_google_community/gcs_directory.py#L10)