shibudb-client


Nameshibudb-client JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/Podcopic-Labs/ShibuDb
SummaryA comprehensive Python client for ShibuDb database
upload_time2025-08-05 16:19:53
maintainerNone
docs_urlNone
authorShibuDb Team
requires_python>=3.7
licenseNone
keywords database key-value vector similarity-search embedded
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # shibudb-client-python
ShibuDb client library for python

# ShibuDb Python Client

A comprehensive Python client for ShibuDb database that supports authentication, key-value operations, vector similarity search, space management, and connection pooling.

## Features

- 🔐 **Authentication & User Management**: Secure login with role-based access control
- 🔑 **Key-Value Operations**: Traditional key-value storage with PUT, GET, DELETE operations
- 🧮 **Vector Similarity Search**: Advanced vector operations with multiple index types
- 🗂️ **Space Management**: Create, delete, and manage different storage spaces
- 🛡️ **Error Handling**: Comprehensive error handling with custom exceptions
- 📊 **Connection Management**: Automatic connection handling with context managers
- 🔗 **Connection Pooling**: High-performance connection pooling for concurrent operations

## Installation

### Prerequisites

1. **ShibuDb Server**: Ensure the ShibuDb server is running
   ```bash
   # Start the server (requires sudo)
   sudo shibudb start 4444
   ```

2. **Python Requirements**: The client uses only standard library modules
    - Python 3.7+
    - No external dependencies required

### Setup

1. **Clone or download the client files**:
   ```bash
   # Copy the client files to your project
   cp shibudb_client.py your_project/
   ```

2. **Import the client**:
   ```python
   from shibudb_client import ShibuDbClient, User, connect
   ```

## Quick Start

### Basic Connection and Authentication

```python
from shibudb_client import ShibuDbClient

# Create client and authenticate
client = ShibuDbClient("localhost", 4444)
client.authenticate("admin", "admin")

# Use context manager for automatic cleanup
with ShibuDbClient("localhost", 4444) as client:
    client.authenticate("admin", "admin")
    # Your operations here
```

### Connection Pooling

```python
from shibudb_client import create_connection_pool

# Create a connection pool
pool = create_connection_pool(
    host="localhost",
    port=4444,
    username="admin",
    password="admin",
    min_size=2,
    max_size=10
)

# Use pooled connections
with pool.get_connection() as client:
    response = client.list_spaces()
    print(f"Available spaces: {response}")

# Pool automatically manages connections
pool.close()
```

### Key-Value Operations

```python
# Create and use a space
client.create_space("mytable", "key-value")
client.use_space("mytable")

# Basic operations
client.put("name", "John Doe")
response = client.get("name")
print(response["value"])  # "John Doe"

client.delete("name")
```

### Vector Operations

```python
# Create a vector space
client.create_space("vectors", "vector", dimension=128, index_type="Flat", metric="L2")
client.use_space("vectors")

# Insert vectors
client.insert_vector(1, [0.1, 0.2, 0.3, ...])
client.insert_vector(2, [0.4, 0.5, 0.6, ...])

# Search for similar vectors
results = client.search_topk([0.1, 0.2, 0.3, ...], k=5)
print(results["message"])  # Search results

# Range search
results = client.range_search([0.1, 0.2, 0.3, ...], radius=0.5)
```

## API Reference

### ShibuDbClient

#### Constructor
```python
ShibuDbClient(host="localhost", port=4444, timeout=30)
```

#### Authentication
```python
client.authenticate(username: str, password: str) -> Dict[str, Any]
```

#### Space Management
```python
client.create_space(name: str, engine_type: str, dimension: Optional[int] = None, 
                   index_type: str = "Flat", metric: str = "L2") -> Dict[str, Any]
client.delete_space(name: str) -> Dict[str, Any]
client.list_spaces() -> Dict[str, Any]
client.use_space(name: str) -> Dict[str, Any]
```

#### Key-Value Operations
```python
client.put(key: str, value: str, space: Optional[str] = None) -> Dict[str, Any]
client.get(key: str, space: Optional[str] = None) -> Dict[str, Any]
client.delete(key: str, space: Optional[str] = None) -> Dict[str, Any]
```

#### Vector Operations
```python
client.insert_vector(vector_id: int, vector: List[float], space: Optional[str] = None) -> Dict[str, Any]
client.search_topk(query_vector: List[float], k: int = 1, space: Optional[str] = None) -> Dict[str, Any]
client.range_search(query_vector: List[float], radius: float, space: Optional[str] = None) -> Dict[str, Any]
client.get_vector(vector_id: int, space: Optional[str] = None) -> Dict[str, Any]
```

#### User Management (Admin Only)
```python
client.create_user(user: User) -> Dict[str, Any]
client.update_user_password(username: str, new_password: str) -> Dict[str, Any]
client.update_user_role(username: str, new_role: str) -> Dict[str, Any]
client.update_user_permissions(username: str, permissions: Dict[str, str]) -> Dict[str, Any]
client.delete_user(username: str) -> Dict[str, Any]
client.get_user(username: str) -> Dict[str, Any]
```

### Data Models

#### User
```python
@dataclass
class User:
    username: str
    password: str
    role: str = "user"
    permissions: Dict[str, str] = None
```

#### SpaceInfo
```python
@dataclass
class SpaceInfo:
    name: str
    engine_type: str
    dimension: Optional[int] = None
    index_type: Optional[str] = None
    metric: Optional[str] = None
```

### Exceptions

- `ShibuDbError`: Base exception for all client errors
- `AuthenticationError`: Raised when authentication fails
- `ConnectionError`: Raised when connection fails
- `QueryError`: Raised when query execution fails
- `PoolExhaustedError`: Raised when connection pool is exhausted

## Examples

### Complete Example

```python
from shibudb_client import ShibuDbClient, User

def main():
    # Connect and authenticate
    with ShibuDbClient("localhost", 4444) as client:
        client.authenticate("admin", "admin")
        
        # Create spaces
        client.create_space("users", "key-value")
        client.create_space("embeddings", "vector", dimension=128)
        
        # Store user data
        client.use_space("users")
        client.put("user1", "Alice Johnson")
        client.put("user2", "Bob Smith")
        
        # Store embeddings
        client.use_space("embeddings")
        client.insert_vector(1, [0.1, 0.2, 0.3, ...])
        client.insert_vector(2, [0.4, 0.5, 0.6, ...])
        
        # Search for similar embeddings
        results = client.search_topk([0.1, 0.2, 0.3, ...], k=5)
        print(f"Search results: {results}")

if __name__ == "__main__":
    main()
```

### Error Handling

```python
from shibudb_client import ShibuDbClient, AuthenticationError, ConnectionError, QueryError

try:
    client = ShibuDbClient("localhost", 4444)
    client.authenticate("admin", "admin")
    
    # Your operations here
    
except AuthenticationError as e:
    print(f"Authentication failed: {e}")
except ConnectionError as e:
    print(f"Connection failed: {e}")
except QueryError as e:
    print(f"Query failed: {e}")
finally:
    client.close()
```

### Advanced Usage

```python
from shibudb_client import ShibuDbClient, User

# Create admin user
admin_user = User(
    username="admin",
    password="adminpass",
    role="admin"
)

# Create regular user with permissions
user = User(
    username="user1",
    password="userpass",
    role="user",
    permissions={"mytable": "read", "vectortable": "write"}
)

with ShibuDbClient("localhost", 4444) as client:
    client.authenticate("admin", "admin")
    
    # Create users
    client.create_user(user)
    
    # Create spaces for different purposes
    client.create_space("users", "key-value")
    client.create_space("products", "key-value")
    client.create_space("embeddings", "vector", dimension=256)
    client.create_space("recommendations", "vector", dimension=512)
    
    # Store data in different spaces
    client.use_space("users")
    client.put("user1", "Alice Johnson")
    
    client.use_space("embeddings")
    client.insert_vector(1, [0.1, 0.2, 0.3, ...])
    
    # Search for recommendations
    query_vector = [0.1, 0.2, 0.3, ...]
    results = client.search_topk(query_vector, k=10)
```

## Running Examples

### Simple Test
```bash
python simple_test.py
```

### Comprehensive Examples
```bash
python example.py
```

### Connection Pooling Examples
```bash
python pooling_example.py
```

### Comprehensive Connection Pooling Tests
```bash
python comprehensive_pool_test.py
```

## Connection Pooling

The ShibuDb client supports connection pooling for high-performance concurrent operations. Connection pooling provides:

- **Connection Reuse**: Efficiently reuse database connections
- **Concurrent Operations**: Support for multiple simultaneous operations
- **Automatic Health Checks**: Background health monitoring of connections
- **Configurable Pool Size**: Adjustable minimum and maximum pool sizes
- **Timeout Handling**: Configurable connection acquisition timeouts

### Pool Configuration

```python
from shibudb_client import create_connection_pool, ConnectionConfig

# Create pool with custom configuration
pool = create_connection_pool(
    host="localhost",
    port=4444,
    username="admin",
    password="admin",
    min_size=2,              # Minimum connections in pool
    max_size=10,             # Maximum connections in pool
    acquire_timeout=30,      # Timeout for acquiring connection (seconds)
    health_check_interval=60 # Health check interval (seconds)
)
```

### Using Connection Pools

```python
# Basic usage
with pool.get_connection() as client:
    response = client.list_spaces()
    print(f"Spaces: {response}")

# Concurrent operations
import threading
from concurrent.futures import ThreadPoolExecutor

def worker(worker_id):
    with pool.get_connection() as client:
        client.create_space(f"space_{worker_id}", "key-value")
        client.use_space(f"space_{worker_id}")
        client.put(f"key_{worker_id}", f"value_{worker_id}")
        return client.get(f"key_{worker_id}")

# Run concurrent workers
with ThreadPoolExecutor(max_workers=5) as executor:
    futures = [executor.submit(worker, i) for i in range(5)]
    for future in as_completed(futures):
        result = future.result()
        print(f"Result: {result}")
```

### Pool Statistics

```python
# Get pool statistics
stats = pool.get_stats()
print(f"Pool size: {stats['pool_size']}")
print(f"Active connections: {stats['active_connections']}")
print(f"Min size: {stats['min_size']}")
print(f"Max size: {stats['max_size']}")
```

### Error Handling with Pools

```python
from shibudb_client import PoolExhaustedError

try:
    with pool.get_connection() as client:
        # Your operations here
        pass
except PoolExhaustedError as e:
    print(f"Pool exhausted: {e}")
except AuthenticationError as e:
    print(f"Authentication failed: {e}")
except ConnectionError as e:
    print(f"Connection failed: {e}")
```

## Engine Types

### Key-Value Engine
- Traditional key-value storage
- Supports PUT, GET, DELETE operations
- No dimension required

### Vector Engine
- Vector similarity search
- Multiple index types:
    - **Flat**: Exact search (default)
    - **HNSW**: Hierarchical Navigable Small World
    - **IVF**: Inverted File Index
    - **IVF with PQ**: Product Quantization
- Distance metrics:
    - **L2**: Euclidean distance (default)
    - **IP**: Inner product
    - **COS**: Cosine similarity

## Security

- **Authentication Required**: All operations require valid credentials
- **Role-Based Access**: Admin and user roles with different permissions
- **Space-Level Permissions**: Read/write permissions per space
- **Connection Security**: TCP-based communication with timeout handling

## Troubleshooting

### Common Issues

1. **Connection Failed**
    - Ensure ShibuDb server is running: `sudo shibudb start 4444`
    - Check server port and host settings
    - Verify firewall settings

2. **Authentication Failed**
    - Verify username and password
    - Ensure user exists in the system
    - Check user permissions

3. **Space Not Found**
    - Use `list_spaces()` to see available spaces
    - Create space before using: `create_space()`
    - Use `use_space()` to switch to a space

4. **Vector Dimension Mismatch**
    - Ensure vector dimension matches space dimension
    - Check space creation parameters
    - Verify vector format (comma-separated floats)

### Debug Mode

Enable debug logging:
```python
import logging
logging.basicConfig(level=logging.DEBUG)
```

## Contributing

1. Fork the repository
2. Create a feature branch
3. Add tests for new functionality
4. Submit a pull request

## License

This client is provided as-is for use with ShibuDb database.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Podcopic-Labs/ShibuDb",
    "name": "shibudb-client",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "database, key-value, vector, similarity-search, embedded",
    "author": "ShibuDb Team",
    "author_email": "support@shibudb.com",
    "download_url": "https://files.pythonhosted.org/packages/c7/ec/35c8a4375b4e3e4846a375a27c974326142121daf46453b765e78e6aaa4f/shibudb_client-1.0.1.tar.gz",
    "platform": null,
    "description": "# shibudb-client-python\nShibuDb client library for python\n\n# ShibuDb Python Client\n\nA comprehensive Python client for ShibuDb database that supports authentication, key-value operations, vector similarity search, space management, and connection pooling.\n\n## Features\n\n- \ud83d\udd10 **Authentication & User Management**: Secure login with role-based access control\n- \ud83d\udd11 **Key-Value Operations**: Traditional key-value storage with PUT, GET, DELETE operations\n- \ud83e\uddee **Vector Similarity Search**: Advanced vector operations with multiple index types\n- \ud83d\uddc2\ufe0f **Space Management**: Create, delete, and manage different storage spaces\n- \ud83d\udee1\ufe0f **Error Handling**: Comprehensive error handling with custom exceptions\n- \ud83d\udcca **Connection Management**: Automatic connection handling with context managers\n- \ud83d\udd17 **Connection Pooling**: High-performance connection pooling for concurrent operations\n\n## Installation\n\n### Prerequisites\n\n1. **ShibuDb Server**: Ensure the ShibuDb server is running\n   ```bash\n   # Start the server (requires sudo)\n   sudo shibudb start 4444\n   ```\n\n2. **Python Requirements**: The client uses only standard library modules\n    - Python 3.7+\n    - No external dependencies required\n\n### Setup\n\n1. **Clone or download the client files**:\n   ```bash\n   # Copy the client files to your project\n   cp shibudb_client.py your_project/\n   ```\n\n2. **Import the client**:\n   ```python\n   from shibudb_client import ShibuDbClient, User, connect\n   ```\n\n## Quick Start\n\n### Basic Connection and Authentication\n\n```python\nfrom shibudb_client import ShibuDbClient\n\n# Create client and authenticate\nclient = ShibuDbClient(\"localhost\", 4444)\nclient.authenticate(\"admin\", \"admin\")\n\n# Use context manager for automatic cleanup\nwith ShibuDbClient(\"localhost\", 4444) as client:\n    client.authenticate(\"admin\", \"admin\")\n    # Your operations here\n```\n\n### Connection Pooling\n\n```python\nfrom shibudb_client import create_connection_pool\n\n# Create a connection pool\npool = create_connection_pool(\n    host=\"localhost\",\n    port=4444,\n    username=\"admin\",\n    password=\"admin\",\n    min_size=2,\n    max_size=10\n)\n\n# Use pooled connections\nwith pool.get_connection() as client:\n    response = client.list_spaces()\n    print(f\"Available spaces: {response}\")\n\n# Pool automatically manages connections\npool.close()\n```\n\n### Key-Value Operations\n\n```python\n# Create and use a space\nclient.create_space(\"mytable\", \"key-value\")\nclient.use_space(\"mytable\")\n\n# Basic operations\nclient.put(\"name\", \"John Doe\")\nresponse = client.get(\"name\")\nprint(response[\"value\"])  # \"John Doe\"\n\nclient.delete(\"name\")\n```\n\n### Vector Operations\n\n```python\n# Create a vector space\nclient.create_space(\"vectors\", \"vector\", dimension=128, index_type=\"Flat\", metric=\"L2\")\nclient.use_space(\"vectors\")\n\n# Insert vectors\nclient.insert_vector(1, [0.1, 0.2, 0.3, ...])\nclient.insert_vector(2, [0.4, 0.5, 0.6, ...])\n\n# Search for similar vectors\nresults = client.search_topk([0.1, 0.2, 0.3, ...], k=5)\nprint(results[\"message\"])  # Search results\n\n# Range search\nresults = client.range_search([0.1, 0.2, 0.3, ...], radius=0.5)\n```\n\n## API Reference\n\n### ShibuDbClient\n\n#### Constructor\n```python\nShibuDbClient(host=\"localhost\", port=4444, timeout=30)\n```\n\n#### Authentication\n```python\nclient.authenticate(username: str, password: str) -> Dict[str, Any]\n```\n\n#### Space Management\n```python\nclient.create_space(name: str, engine_type: str, dimension: Optional[int] = None, \n                   index_type: str = \"Flat\", metric: str = \"L2\") -> Dict[str, Any]\nclient.delete_space(name: str) -> Dict[str, Any]\nclient.list_spaces() -> Dict[str, Any]\nclient.use_space(name: str) -> Dict[str, Any]\n```\n\n#### Key-Value Operations\n```python\nclient.put(key: str, value: str, space: Optional[str] = None) -> Dict[str, Any]\nclient.get(key: str, space: Optional[str] = None) -> Dict[str, Any]\nclient.delete(key: str, space: Optional[str] = None) -> Dict[str, Any]\n```\n\n#### Vector Operations\n```python\nclient.insert_vector(vector_id: int, vector: List[float], space: Optional[str] = None) -> Dict[str, Any]\nclient.search_topk(query_vector: List[float], k: int = 1, space: Optional[str] = None) -> Dict[str, Any]\nclient.range_search(query_vector: List[float], radius: float, space: Optional[str] = None) -> Dict[str, Any]\nclient.get_vector(vector_id: int, space: Optional[str] = None) -> Dict[str, Any]\n```\n\n#### User Management (Admin Only)\n```python\nclient.create_user(user: User) -> Dict[str, Any]\nclient.update_user_password(username: str, new_password: str) -> Dict[str, Any]\nclient.update_user_role(username: str, new_role: str) -> Dict[str, Any]\nclient.update_user_permissions(username: str, permissions: Dict[str, str]) -> Dict[str, Any]\nclient.delete_user(username: str) -> Dict[str, Any]\nclient.get_user(username: str) -> Dict[str, Any]\n```\n\n### Data Models\n\n#### User\n```python\n@dataclass\nclass User:\n    username: str\n    password: str\n    role: str = \"user\"\n    permissions: Dict[str, str] = None\n```\n\n#### SpaceInfo\n```python\n@dataclass\nclass SpaceInfo:\n    name: str\n    engine_type: str\n    dimension: Optional[int] = None\n    index_type: Optional[str] = None\n    metric: Optional[str] = None\n```\n\n### Exceptions\n\n- `ShibuDbError`: Base exception for all client errors\n- `AuthenticationError`: Raised when authentication fails\n- `ConnectionError`: Raised when connection fails\n- `QueryError`: Raised when query execution fails\n- `PoolExhaustedError`: Raised when connection pool is exhausted\n\n## Examples\n\n### Complete Example\n\n```python\nfrom shibudb_client import ShibuDbClient, User\n\ndef main():\n    # Connect and authenticate\n    with ShibuDbClient(\"localhost\", 4444) as client:\n        client.authenticate(\"admin\", \"admin\")\n        \n        # Create spaces\n        client.create_space(\"users\", \"key-value\")\n        client.create_space(\"embeddings\", \"vector\", dimension=128)\n        \n        # Store user data\n        client.use_space(\"users\")\n        client.put(\"user1\", \"Alice Johnson\")\n        client.put(\"user2\", \"Bob Smith\")\n        \n        # Store embeddings\n        client.use_space(\"embeddings\")\n        client.insert_vector(1, [0.1, 0.2, 0.3, ...])\n        client.insert_vector(2, [0.4, 0.5, 0.6, ...])\n        \n        # Search for similar embeddings\n        results = client.search_topk([0.1, 0.2, 0.3, ...], k=5)\n        print(f\"Search results: {results}\")\n\nif __name__ == \"__main__\":\n    main()\n```\n\n### Error Handling\n\n```python\nfrom shibudb_client import ShibuDbClient, AuthenticationError, ConnectionError, QueryError\n\ntry:\n    client = ShibuDbClient(\"localhost\", 4444)\n    client.authenticate(\"admin\", \"admin\")\n    \n    # Your operations here\n    \nexcept AuthenticationError as e:\n    print(f\"Authentication failed: {e}\")\nexcept ConnectionError as e:\n    print(f\"Connection failed: {e}\")\nexcept QueryError as e:\n    print(f\"Query failed: {e}\")\nfinally:\n    client.close()\n```\n\n### Advanced Usage\n\n```python\nfrom shibudb_client import ShibuDbClient, User\n\n# Create admin user\nadmin_user = User(\n    username=\"admin\",\n    password=\"adminpass\",\n    role=\"admin\"\n)\n\n# Create regular user with permissions\nuser = User(\n    username=\"user1\",\n    password=\"userpass\",\n    role=\"user\",\n    permissions={\"mytable\": \"read\", \"vectortable\": \"write\"}\n)\n\nwith ShibuDbClient(\"localhost\", 4444) as client:\n    client.authenticate(\"admin\", \"admin\")\n    \n    # Create users\n    client.create_user(user)\n    \n    # Create spaces for different purposes\n    client.create_space(\"users\", \"key-value\")\n    client.create_space(\"products\", \"key-value\")\n    client.create_space(\"embeddings\", \"vector\", dimension=256)\n    client.create_space(\"recommendations\", \"vector\", dimension=512)\n    \n    # Store data in different spaces\n    client.use_space(\"users\")\n    client.put(\"user1\", \"Alice Johnson\")\n    \n    client.use_space(\"embeddings\")\n    client.insert_vector(1, [0.1, 0.2, 0.3, ...])\n    \n    # Search for recommendations\n    query_vector = [0.1, 0.2, 0.3, ...]\n    results = client.search_topk(query_vector, k=10)\n```\n\n## Running Examples\n\n### Simple Test\n```bash\npython simple_test.py\n```\n\n### Comprehensive Examples\n```bash\npython example.py\n```\n\n### Connection Pooling Examples\n```bash\npython pooling_example.py\n```\n\n### Comprehensive Connection Pooling Tests\n```bash\npython comprehensive_pool_test.py\n```\n\n## Connection Pooling\n\nThe ShibuDb client supports connection pooling for high-performance concurrent operations. Connection pooling provides:\n\n- **Connection Reuse**: Efficiently reuse database connections\n- **Concurrent Operations**: Support for multiple simultaneous operations\n- **Automatic Health Checks**: Background health monitoring of connections\n- **Configurable Pool Size**: Adjustable minimum and maximum pool sizes\n- **Timeout Handling**: Configurable connection acquisition timeouts\n\n### Pool Configuration\n\n```python\nfrom shibudb_client import create_connection_pool, ConnectionConfig\n\n# Create pool with custom configuration\npool = create_connection_pool(\n    host=\"localhost\",\n    port=4444,\n    username=\"admin\",\n    password=\"admin\",\n    min_size=2,              # Minimum connections in pool\n    max_size=10,             # Maximum connections in pool\n    acquire_timeout=30,      # Timeout for acquiring connection (seconds)\n    health_check_interval=60 # Health check interval (seconds)\n)\n```\n\n### Using Connection Pools\n\n```python\n# Basic usage\nwith pool.get_connection() as client:\n    response = client.list_spaces()\n    print(f\"Spaces: {response}\")\n\n# Concurrent operations\nimport threading\nfrom concurrent.futures import ThreadPoolExecutor\n\ndef worker(worker_id):\n    with pool.get_connection() as client:\n        client.create_space(f\"space_{worker_id}\", \"key-value\")\n        client.use_space(f\"space_{worker_id}\")\n        client.put(f\"key_{worker_id}\", f\"value_{worker_id}\")\n        return client.get(f\"key_{worker_id}\")\n\n# Run concurrent workers\nwith ThreadPoolExecutor(max_workers=5) as executor:\n    futures = [executor.submit(worker, i) for i in range(5)]\n    for future in as_completed(futures):\n        result = future.result()\n        print(f\"Result: {result}\")\n```\n\n### Pool Statistics\n\n```python\n# Get pool statistics\nstats = pool.get_stats()\nprint(f\"Pool size: {stats['pool_size']}\")\nprint(f\"Active connections: {stats['active_connections']}\")\nprint(f\"Min size: {stats['min_size']}\")\nprint(f\"Max size: {stats['max_size']}\")\n```\n\n### Error Handling with Pools\n\n```python\nfrom shibudb_client import PoolExhaustedError\n\ntry:\n    with pool.get_connection() as client:\n        # Your operations here\n        pass\nexcept PoolExhaustedError as e:\n    print(f\"Pool exhausted: {e}\")\nexcept AuthenticationError as e:\n    print(f\"Authentication failed: {e}\")\nexcept ConnectionError as e:\n    print(f\"Connection failed: {e}\")\n```\n\n## Engine Types\n\n### Key-Value Engine\n- Traditional key-value storage\n- Supports PUT, GET, DELETE operations\n- No dimension required\n\n### Vector Engine\n- Vector similarity search\n- Multiple index types:\n    - **Flat**: Exact search (default)\n    - **HNSW**: Hierarchical Navigable Small World\n    - **IVF**: Inverted File Index\n    - **IVF with PQ**: Product Quantization\n- Distance metrics:\n    - **L2**: Euclidean distance (default)\n    - **IP**: Inner product\n    - **COS**: Cosine similarity\n\n## Security\n\n- **Authentication Required**: All operations require valid credentials\n- **Role-Based Access**: Admin and user roles with different permissions\n- **Space-Level Permissions**: Read/write permissions per space\n- **Connection Security**: TCP-based communication with timeout handling\n\n## Troubleshooting\n\n### Common Issues\n\n1. **Connection Failed**\n    - Ensure ShibuDb server is running: `sudo shibudb start 4444`\n    - Check server port and host settings\n    - Verify firewall settings\n\n2. **Authentication Failed**\n    - Verify username and password\n    - Ensure user exists in the system\n    - Check user permissions\n\n3. **Space Not Found**\n    - Use `list_spaces()` to see available spaces\n    - Create space before using: `create_space()`\n    - Use `use_space()` to switch to a space\n\n4. **Vector Dimension Mismatch**\n    - Ensure vector dimension matches space dimension\n    - Check space creation parameters\n    - Verify vector format (comma-separated floats)\n\n### Debug Mode\n\nEnable debug logging:\n```python\nimport logging\nlogging.basicConfig(level=logging.DEBUG)\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Add tests for new functionality\n4. Submit a pull request\n\n## License\n\nThis client is provided as-is for use with ShibuDb database.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A comprehensive Python client for ShibuDb database",
    "version": "1.0.1",
    "project_urls": {
        "Bug Reports": "https://github.com/Podcopic-Labs/ShibuDb/issues",
        "Documentation": "https://github.com/Podcopic-Labs/ShibuDb/tree/main/python_client",
        "Homepage": "https://github.com/Podcopic-Labs/ShibuDb",
        "Source": "https://github.com/Podcopic-Labs/ShibuDb"
    },
    "split_keywords": [
        "database",
        " key-value",
        " vector",
        " similarity-search",
        " embedded"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "0301c9ad635afea18f67d377b31ed5003e3eb6fa66cdd6531e269aefdd67bf66",
                "md5": "0a19d1455623e473e7eec393dffc95a3",
                "sha256": "260e4a5e51ae4363eb40d4d70bc177b31874376f1ff8056b632b81b34644b524"
            },
            "downloads": -1,
            "filename": "shibudb_client-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0a19d1455623e473e7eec393dffc95a3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 10996,
            "upload_time": "2025-08-05T16:19:52",
            "upload_time_iso_8601": "2025-08-05T16:19:52.365953Z",
            "url": "https://files.pythonhosted.org/packages/03/01/c9ad635afea18f67d377b31ed5003e3eb6fa66cdd6531e269aefdd67bf66/shibudb_client-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c7ec35c8a4375b4e3e4846a375a27c974326142121daf46453b765e78e6aaa4f",
                "md5": "d35e807b8984e1782d3a0a4f9667287c",
                "sha256": "a6be7c025872e470c2718e0cd0334687d75e975572c856dfa533c09ac3e36a24"
            },
            "downloads": -1,
            "filename": "shibudb_client-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "d35e807b8984e1782d3a0a4f9667287c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 11089,
            "upload_time": "2025-08-05T16:19:53",
            "upload_time_iso_8601": "2025-08-05T16:19:53.410279Z",
            "url": "https://files.pythonhosted.org/packages/c7/ec/35c8a4375b4e3e4846a375a27c974326142121daf46453b765e78e6aaa4f/shibudb_client-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-05 16:19:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Podcopic-Labs",
    "github_project": "ShibuDb",
    "github_not_found": true,
    "lcname": "shibudb-client"
}
        
Elapsed time: 2.03451s