Metadata-Version: 2.4
Name: surveycoder
Version: 1.0.2
Summary: Python SDK for Survey Coder Pro — AI-powered survey coding
Author-email: Survey Coder Pro <support@surveycoder.io>
License: MIT
Project-URL: Homepage, https://surveycoder.io
Project-URL: Documentation, https://docs.surveycoder.io
Project-URL: Repository, https://github.com/quack2025/survey-coder-api
Project-URL: Issues, https://github.com/quack2025/survey-coder-api/issues
Project-URL: Changelog, https://github.com/quack2025/survey-coder-api/releases
Keywords: survey,coding,qualitative,market-research,ai,nlp,spss,open-ended
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
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: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.24.0
Provides-Extra: pandas
Requires-Dist: pandas>=1.5.0; extra == "pandas"
Dynamic: license-file

# surveycoder

Python SDK for [Survey Coder Pro](https://surveycoder.io) — AI-powered open-ended survey coding.

## Installation

```bash
pip install surveycoder
# With pandas integration:
pip install surveycoder[pandas]
```

## Quick Start

```python
from surveycoder import SurveyCoderClient

client = SurveyCoderClient(api_key="scp_live_your_key")

result = client.code(
    responses=[
        {"id": "1", "text": "Me gusta el sabor pero es caro"},
        {"id": "2", "text": "Excelente servicio al cliente"},
    ],
    coding_type="qualitative",
    language="es",
)

print(result["codebook"])
print(result["results"])
```

## Pandas Integration

```python
df = client.code_to_dataframe(
    responses=[...],
    coding_type="qualitative",
)
df.to_excel("coded.xlsx")
```

## Export

```python
# Excel
excel_bytes = client.export_excel(
    project_id=result["project_id"],
    layout="wide_by_question",
    include_categories=False,
)
with open("coded.xlsx", "wb") as f:
    f.write(excel_bytes)

# CSV
csv_text = client.export_csv(project_id=result["project_id"])
```

## Large Datasets (async jobs)

```python
job = client.code(responses=large_dataset)  # >= 50 responses
result = client.wait_for_job(job["job_id"])  # Polls every 5s
```

## API Docs

[https://api.surveycoder.io/docs](https://api.surveycoder.io/docs)
