Metadata-Version: 2.5
Name: aurastamp-sdk
Version: 1.0.0
Summary: Hide and reveal short messages inside images, via the Aurastamp API
Project-URL: Homepage, https://aurastamp.com
Project-URL: Repository, https://github.com/sunutf/aurastamp
Author: sunutf
License: MIT
Keywords: aurastamp,image,steganography,watermark
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Multimedia :: Graphics
Requires-Python: >=3.10
Requires-Dist: requests>=2.31
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: responses>=0.25; extra == 'dev'
Description-Content-Type: text/markdown

# Aurastamp SDK (Python)

Hide and reveal short messages inside images.

```sh
pip install aurastamp-sdk
```

## The payload is 7 bytes

The message is embedded in the image itself, and the model reserves exactly
**7 bytes** for it. Anything longer is rejected before a request is made.

That is 7 characters of ASCII, but fewer for anything else — `'가나'` is two
characters and six bytes.

To hide something longer, store the text somewhere and embed a short key
instead; that is what [aurastamp.com](https://aurastamp.com) does.

## Usage

```python
from aurastamp_sdk import Aurastamp

aurastamp = Aurastamp()  # or Aurastamp("http://localhost:8000")

# Hide a message
encoded = aurastamp.image.encode_file(
    image_file_path="photo.png",
    message="hello",
    output_path="encoded.png",
)

# Reveal it again
print(aurastamp.image.decode_file(image_file_path="encoded.png"))
#=> '  hello'   (padded to 7 bytes)
```

Working with bytes directly:

```python
with open("photo.png", "rb") as f:
    encoded = aurastamp.image.encode(image=f.read(), message="hello", filename="photo.png")

message = aurastamp.image.decode(image=encoded, filename="encoded.png")
```

## Configuration

| Setting            | Default                     |
| ------------------ | --------------------------- |
| `server_url` arg   | `AURASTAMP_API_URL` env var |
| `AURASTAMP_API_URL`| `https://api.aurastamp.com` |

## Errors

Every failure raises `AurastampError`, carrying the server's `detail` message
and the HTTP status where there is one.

```python
from aurastamp_sdk import AurastampError

try:
    aurastamp.image.encode_file(image_file_path="photo.png", message="way too long")
except AurastampError as error:
    print(error, error.status)
```

## Coming from the `aurastamp` package

This supersedes `aurastamp` on PyPI, which is unmaintained and published from an
account this project no longer controls. Its last release could not talk to the
current API: it base64-decoded a response that was already raw PNG bytes and
read keys off the decode response that the server never sends.

The import is `aurastamp_sdk`, not `aurastamp` — two distributions installing
the same top-level package would overwrite each other's files.

If you depend on `aurastamp`, switch to `aurastamp-sdk`. What changed:

- `encode` / `encode_local_file` → `encode` / `encode_file`, and they now return
  **PNG bytes** rather than a `requests.Response`
- `decode` / `decode_local_file` → `decode` / `decode_file`, returning the
  message **string**
- the unused `model`, `return_type` and `hidden_image` arguments are gone
- failures raise `AurastampError` instead of returning a non-2xx response
