Metadata-Version: 2.5
Name: pagekit-core
Version: 0.1.0
Summary: Python client for the Pagekit content API
Project-URL: Homepage, https://github.com/arovi-labs/pagekit
Project-URL: Repository, https://github.com/arovi-labs/pagekit
Project-URL: Issues, https://github.com/arovi-labs/pagekit/issues
Author: Arovi Labs
License-Expression: MIT
Keywords: blog,cms,content-api,headless,pagekit
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT 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: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: httpx<1,>=0.27
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: respx>=0.22; extra == 'dev'
Description-Content-Type: text/markdown

# pagekit

Python client for the [Pagekit](https://pagekit.app) content API.

## Installation

```bash
pip install pagekit-core
```

## Quick start

```python
from pagekit import Pagekit

client = Pagekit(api_key="pk_live_...")

# List posts
page = client.posts.list(status="published", limit=10)
for post in page.data:
    print(post.title)

# Create a post
post = client.posts.create(title="Hello world", content="<p>First post</p>")

# Get by slug
post = client.posts.get_by_slug("hello-world")
```

## Async usage

```python
from pagekit import AsyncPagekit

client = AsyncPagekit(api_key="pk_live_...")

posts = await client.posts.list()
```

## Configuration

```python
client = Pagekit(
    api_key="pk_live_...",
    base_url="https://api.pagekit.app/v1",  # default
    timeout=30,                               # seconds
    headers={"X-Custom": "value"},            # extra headers
)
```

## Error handling

```python
from pagekit import Pagekit, PagekitError

client = Pagekit(api_key="pk_live_...")

try:
    post = client.posts.get("nonexistent")
except PagekitError as e:
    print(e.status)   # 404
    print(e.code)     # "not_found"
    print(e.is_auth_error)      # False
    print(e.is_rate_limited)    # False
    print(e.is_server_error)    # False
```

## License

MIT
