Metadata-Version: 2.4
Name: flagdrop-sdk
Version: 0.1.0
Summary: FlagDrop Python SDK — evaluate feature flags from your cloud bucket
Author-email: FlagDrop <support@flagdrop.io>
License: MIT
Project-URL: Homepage, https://flagdrop.io
Project-URL: Documentation, https://flagdrop.io/docs
Keywords: feature-flags,flagdrop,sdk,s3,feature-toggles
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: boto3>=1.28.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21; extra == "dev"
Requires-Dist: moto[s3]>=5.0; extra == "dev"

# FlagDrop Python SDK

Feature flag evaluation that runs entirely in your cloud. No vendor servers, no data leaving your infrastructure.

## Installation

```bash
pip install flagdrop-sdk
```

## Quick Start

```python
from flagdrop import FlagClient

client = FlagClient(
    bucket="my-app-flags",
    environment="production",
    provider="aws",
    region="us-east-1",
)
client.initialize()

# Boolean flag
enabled = client.get_bool("new-checkout", False)

# String flag with targeting context
theme = client.get_string("app-theme", "light", {"plan": "enterprise"})

# Number flag
max_items = client.get_number("max-items", 10)

# JSON flag
config = client.get_json("feature-config", {"limit": 5})
```

## How It Works

1. You define flags in the [FlagDrop dashboard](https://flagdrop.io)
2. FlagDrop pushes a JSON config file to an S3 bucket in **your** AWS account
3. The SDK reads that file and evaluates flags locally at runtime

No network calls to FlagDrop servers during evaluation. No latency. No single point of failure.

## Configuration

| Parameter | Description |
|-----------|-------------|
| `bucket` | S3 bucket name where flag configs are stored |
| `environment` | Environment name (e.g., `production`, `staging`) |
| `provider` | Cloud provider (`aws`) |
| `region` | AWS region (e.g., `us-east-1`) |
| `scope` | Config scope: `backend` (default) or `frontend` |
| `refresh_interval_seconds` | How often to re-fetch config (default: 30s, 0 to disable) |

## Targeting Rules

The SDK evaluates targeting rules locally. Supported operators:

- `eq`, `neq` — exact match / not equal
- `in`, `notIn` — value in list / not in list
- `lt`, `gt` — less than / greater than (numeric)
- `startsWith`, `endsWith`, `contains` — string matching
- `segment` — segment membership

## Rollouts

Percentage-based rollouts use deterministic hashing, so the same user always gets the same result.

## Requirements

- Python 3.9+
- `boto3` (AWS SDK)
- AWS credentials with read access to your flag config bucket

## Links

- [FlagDrop](https://flagdrop.io) — Feature flags in your cloud
- [Documentation](https://flagdrop.io/docs)
