Metadata-Version: 2.4
Name: growpanel
Version: 0.1.5
Summary: Python SDK for the GrowPanel subscription analytics REST API
Project-URL: Homepage, https://growpanel.io
Project-URL: Documentation, https://api.growpanel.io/docs
Project-URL: Repository, https://github.com/growpanel/growpanel-sdk-python
Author: GrowPanel ApS
License: MIT
Keywords: arr,churn,growpanel,metrics,mrr,saas,subscription-analytics
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 :: Office/Business :: Financial
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Requires-Dist: attrs>=24.0
Requires-Dist: httpx>=0.27
Requires-Dist: python-dateutil>=2.8
Provides-Extra: dev
Requires-Dist: build>=1.0; extra == 'dev'
Requires-Dist: openapi-python-client>=0.21; extra == 'dev'
Requires-Dist: twine>=5.0; extra == 'dev'
Description-Content-Type: text/markdown

# growpanel (Python)

Official Python SDK for the [GrowPanel](https://growpanel.io) subscription analytics REST API.

```bash
pip install growpanel
```

```python
from growpanel import GrowPanel

gp = GrowPanel(api_key="gp_...")

summary = gp.reports.get_summary()
print(summary.summary.mrr_current)

mrr = gp.reports.get_mrr(date="20260101-20260531", interval="month")
for period in mrr.result:
    print(period.date, period.total_mrr)
```

## Auth

Issue a key in **app.growpanel.io → Account → API keys**. Pass it as `api_key=` when constructing the client; it\'s sent as `Authorization: Bearer <key>` on every request.

## Surfaces

The SDK groups operations by API area, mirroring the [interactive docs](https://api.growpanel.io/docs):

- `gp.reports.*` — MRR, leads, cohorts, cashflow, retention, churn
- `gp.customers.*` — list + detail (analytics view)
- `gp.plans.*` — list plans
- `gp.plan_groups.*`, `gp.segments.*`, `gp.data_sources.*`, `gp.data_customers.*`, `gp.data_invoices.*`, `gp.data_plans.*` — data management with full CRUD
- `gp.profile.*`, `gp.notifications.*`, `gp.webhooks.*` — account & integrations

For anything not exposed as a named method, `gp.raw` is the generated module tree — every endpoint in the OpenAPI spec is reachable from there.

## Generating from the live spec

```bash
pip install -e ".[dev]"
openapi-python-client generate \
    --url https://api-dev.growpanel.io/openapi.json \
    --config openapi-python-client.config.yaml \
    --overwrite
```

Output lands in `src/growpanel/_generated/`. In CI, this runs automatically on every API change.

## Errors

```python
from growpanel import GrowPanel, GrowPanelError

gp = GrowPanel(api_key="...")
try:
    gp.customers.detail(id="cus_doesnotexist")
except GrowPanelError as err:
    if err.status == 404:
        ...  # handle not-found
    raise
```

## Interactive docs

The full reference (with try-it-out) lives at [api.growpanel.io/docs](https://api.growpanel.io/docs).
