Metadata-Version: 2.3
Name: cloady
Version: 0.5.0
Summary: A client library for accessing Cloady API
Requires-Dist: httpx>=0.23.1,<0.29.0
Requires-Dist: attrs>=22.2.0
Requires-Dist: boto3>=1.34 ; extra == 's3'
Requires-Python: >=3.11
Provides-Extra: s3
Description-Content-Type: text/markdown

# cloady
A client library for accessing the Cloady API.

## Usage
Create a client:

```python
from cloady import Cloady

cloady = Cloady(base_url="https://cloady.com", token="cldy_…")
```

`Cloady` is an `AuthenticatedClient` that also carries `cloady.files` — file
operations over app volumes, speaking S3 (SigV4 via boto3) against the
same-origin `/s3` endpoint internally:

```python
from cloady.files import VolumeRef

ref = VolumeRef(slug="neptolab", region="hil1", env="prod",
                svc_id="dailyfrog", volume="dailyfrog-data")

cloady.files.list(ref, "")
cloady.files.upload(ref, "logs", "out.txt", b"hi")
cloady.files.download(ref, "logs/out.txt", "./out.txt")
cloady.files.rename(ref, "", "old", "new", is_dir=True)
cloady.files.remove(ref, "", [("cache", True)])
```

File operations need the `s3` extra: `pip install 'cloady[s3]'`.

For unauthenticated endpoints a plain `Client` is available:

```python
from cloady import Client

client = Client(base_url="https://cloady.com")
```

REST endpoints live under `cloady.generated.api` — one module per
path/method combo, with `sync`, `sync_detailed`, `asyncio`, and
`asyncio_detailed` variants:

```python
from cloady.generated.api.default import list_workspaces
from cloady.generated.types import Response

with cloady as client:
    workspaces = list_workspaces.sync(client=client)
    response = list_workspaces.sync_detailed(client=client)
```

Or async:

```python
async with cloady as client:
    workspaces = await list_workspaces.asyncio(client=client)
```

Models are in `cloady.generated.models`, error types in
`cloady.generated.errors`.

TLS behaves like httpx: pass `verify_ssl="/path/to/bundle.pem"` for a custom
CA bundle, or `verify_ssl=False` to disable verification (a security risk).
The underlying `httpx.Client` can be customized via `httpx_args` or replaced
with `set_httpx_client` — see the docstrings on `Client`.

## Layout

`cloady/generated/` is produced by `openapi-python-client` from the repo's
`openapi.json` (`npm run gen:python`) and is fully overwritten on every
regeneration — never edit it. Everything outside it (`__init__.py`,
`files.py`, `pyproject.toml`, this README) is handwritten.

## Building / publishing
This project uses [uv](https://github.com/astral-sh/uv):
1. Update the metadata in `pyproject.toml` (e.g. version).
2. Build with `uv build`, publish with `uv publish`.
