# VF Toolkit

Python wrapper for VoxelFarm cloud tools: `storage_manager`, `upload_db`, and `vf-setup`.

## Command-Line Tools

After installing the package, the following commands are available from your system PATH:

- `vf-storage-manager` - Cloud storage manager tool
- `vf-upload-db` - Database upload tool
- `vf-setup` - Interactive VoxelFarm configuration setup

### Examples

```bash
# Run storage manager
vf-storage-manager --help

# Run upload database tool
vf-upload-db --help

# Run interactive setup
vf-setup
```

## Installation

```bash
pip install vf-toolkit
```

## Usage

### Storage Manager

```python
from vf_toolkit import StorageManager, AzureConfig

# Create Azure configuration
config_file = AzureConfig.create(
    container_name="my-container",
    connection_string="DefaultEndpointsProtocol=https;...",
    organization="MyOrg",
    project="MyProject",
    instance="Instance01",
    db_name="Database01"
)

# Use storage manager
storage = StorageManager()

# Upload file
result = storage.upload(config_file, "/local/path", "remote/path")
if result['success']:
    print("Upload successful!")
else:
    print(f"Error: {result['stderr']}")

# Download file
result = storage.download(config_file, "remote/path", "/local/path")
```

### Upload DB

```python
from vf_toolkit import UploadDB, AWSConfig

# Create AWS configuration
config_file = AWSConfig.create(
    bucket_name="my-bucket",
    region="us-east-1",
    access_key_id="AKIAIOSFODNN7EXAMPLE",
    secret_access_key="wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
    organization="MyOrg",
    project="MyProject",
    instance="Instance01",
    db_name="Database01",
    output_folder="/path/to/database"
)

# Use upload_db
uploader = UploadDB()

# Upload database with swarm (4 workers)
for worker_id in range(4):
    result = uploader.upload(config_file, swarm_index=worker_id, swarm_size=4)
    if result['success']:
        print(f"Worker {worker_id} completed successfully")
```

## Supported Platforms

- Linux (x86_64)
- Windows (x86_64)

Platform-specific binaries are included in the package.