Metadata-Version: 2.4
Name: async-snowflake
Version: 0.1.0
Summary: Async Snowflake connector for Python with JWT authentication
Project-URL: Homepage, https://github.com/yourusername/async-snowflake
Project-URL: Documentation, https://async-snowflake.readthedocs.io
Project-URL: Repository, https://github.com/yourusername/async-snowflake
Author: Snowflake Connector Team
License: MIT
Keywords: async,connector,database,jwt,snowflake
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Requires-Dist: aiofiles>=25.1.0
Requires-Dist: cryptography>=46.0.0
Requires-Dist: httpx>=0.28.1
Requires-Dist: pydantic[email]>=2.12.5
Requires-Dist: pyjwt>=2.11.0
Requires-Dist: tomli>=2.0.0
Provides-Extra: cli
Requires-Dist: cryptography>=46.0.0; extra == 'cli'
Requires-Dist: tomli>=2.0.0; extra == 'cli'
Requires-Dist: typer>=0.23.1; extra == 'cli'
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=1.3.0; extra == 'dev'
Requires-Dist: pytest-cov>=6.0.0; extra == 'dev'
Requires-Dist: pytest>=9.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# Async Snowflake Connector for Python

An async Python connector for Snowflake using JWT authentication.

## Installation

```bash
pip install -r requirements.txt
```

## Configuration

### Credentials File

Create a `credentials.toml` file (do not commit to version control):

```toml
[default]
account = "YOUR_ACCOUNT"
user = "YOUR_USER"
private_key_path = "/path/to/private_key.pem"
region = "us-east-1"

# Multiple profiles supported
[production]
account = "PROD_ACCOUNT"
user = "admin"
private_key_path = "/path/to/prod_key.pem"
```

### Environment Variables

Alternatively, use environment variables:

```bash
export SNOWFLAKE_ACCOUNT="your_account"
export SNOWFLAKE_USER="your_user"
export SNOWFLAKE_PRIVATE_KEY_PATH="/path/to/key.pem"
export SNOWFLAKE_REGION="us-east-1"
```

## Usage

```python
from endpoints import SnowflakeClient
from authentication import SnowflakeJWTAuthClient
from authentication.credentials import CredentialsManager

# Option 1: Using credentials manager
credentials = CredentialsManager(profile="default").credentials

auth = SnowflakeJWTAuthClient(
    account=credentials.account,
    user=credentials.user,
    private_key_path=credentials.private_key_path,
)

client = await SnowflakeClient.create(
    base_url=credentials.base_url,
    auth_client=auth,
)

# Execute query
result = await client.query.execute("SELECT * FROM table")
print(result.data)

await client.close()

# Option 2: Using context manager
async with SnowflakeClient.create(base_url, auth) as client:
    result = await client.query.execute("SELECT 1")
```

## Fluent Interface

```python
# Account operations
await client.account.get_current_account()

# Database operations
await client.database.list()
await client.database.create("new_db")
await client.database.describe("my_db")

# Warehouse operations
await client.warehouse.list()
await client.warehouse.resume("warehouse_name")

# Query execution
result = await client.query.execute("SELECT * FROM table")
```

## Testing

```bash
# Run all tests
uv run pytest tests/ -v

# Run only unit tests
uv run pytest tests/unit/ -v

# Run only integration tests
uv run pytest tests/integration/ -v
```
