Metadata-Version: 2.4
Name: refactual-sdk
Version: 0.1.0
Summary: Official Refactual REST API client for Python.
Author-email: Refactual <support@refactual.com>
License: Apache-2.0
Project-URL: Homepage, https://app.refactual.com/developer/docs
Project-URL: Documentation, https://app.refactual.com/developer/docs
Project-URL: Source, https://github.com/refactual/refactual
Project-URL: Issues, https://github.com/refactual/refactual/issues
Project-URL: Changelog, https://github.com/refactual/refactual/releases
Keywords: refactual,ai,llm,api,sdk,claude,code-refactoring,modernization,cobol,legacy-code
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
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: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: urllib3>=2.0
Provides-Extra: dev
Requires-Dist: build>=1.0; extra == "dev"
Requires-Dist: twine>=5.0; extra == "dev"
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: ruff>=0.4; extra == "dev"
Dynamic: license-file

# refactual-sdk

Official Refactual REST API client for Python.

> **Status: preview** — this package is not yet published on PyPI.
> The API shape below is stable; until the publish lands, call the
> REST API directly with `requests` / `httpx`.

```bash
# Once published:
pip install refactual-sdk
```

## Quickstart

```python
from refactual import Refactual

client = Refactual(api_key="rk_live_...")
reply  = client.chat.completions.create(
    model="claude-sonnet-4-6",
    messages=[{"role": "user", "content": "Explain async/await"}],
)
print(reply["content"])
```

## OAuth 2.0 (client_credentials)

```python
token = Refactual(api_key="rk_placeholder").oauth.token(
    client_id="rc_live_xxx",
    client_secret="rcs_live_xxx",
    scope=["chat:write", "chat:read"],
)
client = Refactual(access_token=token["access_token"])
```

## Webhook verification

```python
from refactual import verify_webhook
verify_webhook(raw_body, request.headers.get("Refactual-Signature"), secret)
```

See [API.md](https://github.com/refactual/refactor/blob/main/API.md) for
the full reference.
