Metadata-Version: 2.4
Name: startupaid
Version: 0.1.0
Summary: Official Python SDK for startupAid — send email & push, schedule social posts, and convert currency.
Project-URL: Homepage, https://startupaid.org
Project-URL: Source, https://github.com/StartupAid-Org/startupaid-python
Author: startupAid
License: MIT
Keywords: api,currency,email,push,sdk,social,startupaid
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# startupaid

Official Python SDK for [startupAid](https://startupaid.org) — send transactional
email, send push, schedule social posts, and convert currency, all with your
account API key. Pure standard library, no dependencies.

## Install

```bash
pip install startupaid
```

Requires Python 3.9+.

## Quick start

```python
from startupaid import Client

sa = Client("sk_your_key")

res = sa.convert("USD", "NGN", 100)
print(f"100 USD = {res['result']} NGN")
```

Create an API key in your startupAid dashboard → **API Keys**.

## Usage

### Email

```python
msg = sa.send_email(
    from_="Acme <hi@acme.com>",
    to="user@example.com",
    subject="Welcome",
    body="<h1>Hi 👋</h1>",
)
status = sa.get_message(msg["id"])
```

### Currency

```python
sa.convert("USD", "EUR", 250)
sa.rates("USD")
sa.currencies()
```

### Push

```python
sa.send_push(
    "app_id",
    target={"userRef": "u_123"},
    title="Your order shipped",
    body="Track it in the app.",
)
```

### Social

```python
channels = sa.list_channels()

post = sa.schedule_post(
    channels=[c["id"] for c in channels],
    content="We just shipped 🚀",
    # scheduled_for="2026-08-01T09:00:00Z"  # omit to publish now
)

sa.list_posts()
```

### Audiences

```python
sa.list_audiences()
sa.add_contact("audience_id", email="new@example.com", first_name="Ada")
```

## Configuration

```python
Client(
    "sk_your_key",
    base_url="http://localhost:8080",  # self-host / testing
    timeout=30.0,                       # per-request timeout (seconds)
)
```

## Errors

Non-2xx responses raise `StartupAidError` with the status code and message:

```python
from startupaid import StartupAidError

try:
    sa.convert("USD", "NGN", 1)
except StartupAidError as err:
    print(err.status, err.message)
```

Each method requires your account to be subscribed to the matching product
(email, currency, push, social); otherwise the API returns an upgrade prompt.

## License

MIT
