> ## Documentation Index
> Fetch the complete documentation index at: https://docs.moorcheh.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# List Namespaces

> Retrieve a list of all namespaces using the Python SDK

## namespaces.list

Retrieves a list of all namespaces accessible by your API key.

**Returns:** `Dict[str, Any]` - A dictionary containing a list of namespace objects under the namespaces key.

**Raises:** `AuthenticationError`, `APIError`.

### Example

```python List Namespaces Example theme={null}
from moorcheh_sdk import MoorchehClient

with MoorchehClient() as client:
    all_namespaces = client.namespaces.list()
    
    print(f"Found {len(all_namespaces.get('namespaces', []))} namespaces:")
    for ns in all_namespaces.get('namespaces', []):
        print(f"- Namespace: {ns['namespace_name']}, Type: {ns['type']}, Items: {ns['item_count']}")
```

### Response Structure

The response contains a `namespaces` array with the following fields for each namespace:

* `namespace_name` (str): Unique name of the namespace
* `type` (str): Namespace type: "text" or "vector"
* `vector_dimension` (int | None): Vector dimension (null for text namespaces)
* `item_count` (int): Total number of items in the namespace
* `created_at` (str): ISO 8601 timestamp of creation

### Complete Example

```python Complete Example theme={null}
from moorcheh_sdk import MoorchehClient

with MoorchehClient() as client:
    # List all namespaces
    namespaces = client.namespaces.list()
    
    # Process the results
    text_namespaces = []
    vector_namespaces = []
    
    for ns in namespaces.get('namespaces', []):
        if ns['type'] == 'text':
            text_namespaces.append(ns)
        else:
            vector_namespaces.append(ns)
    
    print(f"Text namespaces: {len(text_namespaces)}")
    print(f"Vector namespaces: {len(vector_namespaces)}")
    
    # Display namespace details
    for ns in namespaces.get('namespaces', []):
        print(f"\n{ns['namespace_name']}:")
        print(f"  Type: {ns['type']}")
        print(f"  Items: {ns['item_count']}")
        print(f"  Created: {ns['created_at']}")
```

## Use Cases

* **Dashboard Display**: Show namespace overview with usage statistics
* **Data Management**: Monitor storage usage and document counts
* **Namespace Selection**: Populate dropdowns for namespace selection in applications
* **Usage Analytics**: Track namespace growth and activity over time
* **Resource Planning**: Understand storage and document distribution across namespaces

## Related Operations

* [Create Namespace](/python-sdk/namespaces/create) - Create a new namespace
* [Delete Namespace](/python-sdk/namespaces/delete) - Remove a namespace
