Metadata-Version: 2.4
Name: vaultdb.core
Version: 3.18.4
Summary: Vaultdb Core platform.
Home-page: https://github.com/vaultdbai/vaultdb
Author: Dev M Chechi
Author-email: devmchechi@gmail.com
License: Proprietary - Free use for one year, no replication or sale permitted
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: peewee>=3.17.0
Requires-Dist: python-dateutil>=2.8.2
Requires-Dist: pytz>=2023.3
Requires-Dist: boto3>=1.34.0
Requires-Dist: vaultdb>=0.10.3.dev1901
Requires-Dist: pandas>=2.0.0
Provides-Extra: service
Requires-Dist: celery>=5.3.6; extra == "service"
Requires-Dist: redis>=5.0.1; extra == "service"
Requires-Dist: flower>=2.0.1; extra == "service"
Provides-Extra: web
Requires-Dist: fastapi>=0.109.0; extra == "web"
Requires-Dist: uvicorn[standard]>=0.27.0; extra == "web"
Requires-Dist: httpx>=0.27.0; extra == "web"
Provides-Extra: dev
Requires-Dist: ruff; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: time-machine; extra == "dev"
Requires-Dist: wheel; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# VaultDB Core

VaultDB is a compute and application framework platform and database system designed to run jobs, Python-based UI, and compute-intensive workloads.

## Features

- **Multi-Database Support**: PostgreSQL (production) and SQLite (development/testing)
- **DuckDB Integration**: High-performance analytics database with S3 integration (uses 'vaultdb' package with modified DuckDB)
- **Task Execution**: Unified interface for Celery, AWS Lambda, and AWS Batch runners
- **Flexible Authentication**: Basic, AWS Cognito, and OAuth 2.0 support
- **AWS Integration**: Automatic credential management and S3 access

## Installation

### Core Installation
For basic usage with AWS Lambda and Batch runners:
```bash
pip install vaultdb.core
```

### Full Installation (with Celery)
To include Celery and Redis support for local task execution:
```bash
pip install "vaultdb.core[service]"
```

### Web API Support
To include dependencies for the Web API:
```bash
pip install "vaultdb.core[web]"
```

## Quick Start

### Basic Setup

```python
from vaultdb.core import Application, AuthType

# Local development with basic authentication
Application.connect(
    database="my_app.db",
    role="vaultdb",
    auth=AuthType.BASIC
)
```

### OAuth 2.0 Authentication

VaultDB supports OAuth 2.0 authentication with any provider (Google, GitHub, Microsoft, etc.):

```python
from vaultdb.core import Application, AuthType

# Configure OAuth 2.0 (via environment variables or directly)
Application.connect(
    database="my_database",
    role="vaultdb",
    auth=AuthType.OAUTH2,
    oauth2_authorization_code="code-from-oauth-provider"
)
```

OAuth 2.0 authentication automatically:
- Manages AWS credentials when provided by OAuth providers
- Creates AWS profiles for local development
- Enables S3 access and AWS job submission

### AWS Cognito Authentication

```python
from vaultdb.core import Application, AuthType

Application.connect(
    database="my_database",
    role="vaultdb",
    username="user@example.com",
    password="password",
    auth=AuthType.COGNITO
)
```

## Authentication Methods

VaultDB supports three authentication methods:

1. **Basic Authentication**: Simple authentication for local development
2. **AWS Cognito**: Full AWS Cognito integration
3. **OAuth 2.0**: Support for any OAuth 2.0 provider with automatic AWS credential management

## Task Execution

Execute tasks across multiple runners with a unified interface:

```python
from vaultdb import TED

# Define a task
@TED.task()
def my_task(x: int, y: int) -> int:
    """Add two numbers."""
    return x + y

# Submit task
result = my_task.apply_async(args=(5, 10))
print(f"Task ID: {result.task_id}")
```

## Configuration

### OAuth 2.0 Environment Variables

```bash
export oauth2_client_id="your-client-id"
export oauth2_client_secret="your-client-secret"
export oauth2_authorization_url="https://oauth.provider.com/authorize"
export oauth2_token_url="https://oauth.provider.com/token"
export oauth2_redirect_uri="http://localhost:8080/callback"
```

### AWS Cognito Environment Variables

```bash
export user_pool_id="us-east-1_XXXXXXXXX"
export user_pool_app_client_id="your-client-id"
export user_identity_pool_id="us-east-1:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
export user_bucket="your-s3-bucket"
```

## Advanced Usage

### OAuth 2.0 with Direct Tokens

```python
Application.connect(
    database="my_database",
    role="vaultdb",
    auth=AuthType.OAUTH2,
    oauth2_access_token="your-access-token",
    oauth2_refresh_token="your-refresh-token"
)
```

### OAuth 2.0 with AWS Credentials

```python
Application.connect(
    database="my_database",
    role="vaultdb",
    auth=AuthType.OAUTH2,
    oauth2_aws_access_key_id="AKIAIOSFODNN7EXAMPLE",
    oauth2_aws_secret_access_key="wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
    oauth2_aws_session_token="session-token"  # Optional
)
```

## Documentation

For detailed documentation, visit the [project repository](https://github.com/vaultdbai/vaultdb).

Key documentation:
- [OAuth 2.0 Authentication Guide](https://github.com/vaultdbai/vaultdb/blob/main/docs/oauth2_authentication_guide.md)
- [Task Runners Integration Guide](https://github.com/vaultdbai/vaultdb/blob/main/docs/task_runners_integration_guide.md)
- [Data Module Usage Guide](https://github.com/vaultdbai/vaultdb/blob/main/docs/data_module_usage_guide.md)

## Requirements

- Python 3.11+
- See `requirements.txt` for full dependency list

## License

Proprietary License - Free use for one year. Replication and sale are not permitted.

See the [LICENSE](https://github.com/vaultdbai/vaultdb/blob/main/LICENSE) file for full terms and conditions.

## Support

For issues and questions, please visit the [project repository](https://github.com/vaultdbai/vaultdb).
