Metadata-Version: 2.4
Name: sonicwall-sdk
Version: 0.1.0
Summary: Python SDK for the SonicOS REST API
Project-URL: Homepage, https://gitlab.com/gandiva-tech/sonicwall-sdk
Project-URL: Documentation, https://gitlab.com/gandiva-tech/sonicwall-sdk/-/tree/main/docs
Project-URL: Repository, https://gitlab.com/gandiva-tech/sonicwall-sdk
Project-URL: Bug Tracker, https://gitlab.com/gandiva-tech/sonicwall-sdk/-/issues
Author-email: Gandiva Tech <engineering@gandiva.tech>
License: Apache-2.0
Keywords: api,firewall,sdk,sonicos,sonicwall
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: System :: Networking :: Firewalls
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: anyio>=4.0
Requires-Dist: httpx>=0.27
Requires-Dist: pydantic>=2.0
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: respx>=0.21; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Description-Content-Type: text/markdown

# SonicWall SDK for Python

Python client for SonicOS REST API with async-first APIs, sync wrapper, pending
config transaction helpers, and typed exceptions.

## Install

```bash
pip install sonicwall-sdk
# or
uv add sonicwall-sdk
```

## Quick start (async)

```python
import asyncio
from sonicwall import SonicWallClient

async def main() -> None:
    async with SonicWallClient(
        host="192.168.1.1",
        username="admin",
        password="secret",
        verify_ssl=False,
    ) as client:
        objs = await client.address_objects.list()
        print(f"address objects: {len(objs)}")

asyncio.run(main())
```

## Authentication

On SonicOS 7.x, the SDK performs Digest `auth-int` login handshake on
`POST /auth`, then sends `Authorization: Bearer <token>` for authenticated API
calls. This is automatic; no manual auth header or cookie handling is needed.

## Transactions

SonicOS stages writes in pending config. Use `pending()` to auto-commit on
success and auto-rollback on exceptions:

```python
async with client.pending():
    await client.address_objects.create(obj)
```

## More docs

- Root guide: `README.md`
- Python guide: `docs/python.md`
- SonicOS quirks: `docs/sonicwall-quirks.md`
