Metadata-Version: 2.4
Name: pocketapi-framework
Version: 0.1.0
Summary: Zero-boilerplate REST API framework — turn any Python file into a live API
License: MIT
Project-URL: Homepage, https://github.com/adnanahamed66772ndpc/pocketapi
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: starlette>=0.36.0
Requires-Dist: uvicorn[standard]>=0.27.0

# Pocket API

**Zero-boilerplate REST API framework for Python.**

Turn any Python file into a live REST API with auto-generated Swagger documentation. Just write functions — Pocket API handles the rest.

## Installation

```bash
pip install pocketapi
```

## Quick Start

Create a Python file with your functions:

```python
# api.py
def hello(name: str = "World"):
    """Say hello to someone."""
    return {"greeting": f"Hello, {name}!"}

def add(a: int, b: int):
    """Add two integers."""
    return {"sum": a + b}
```

Then serve it:

```bash
pocketapi serve api.py
```

Now visit:
- **API**: http://localhost:8000/
- **Docs**: http://localhost:8000/docs

Test your endpoints:

```bash
curl "http://localhost:8000/hello?name=Alice"
# {"greeting": "Hello, Alice!"}

curl "http://localhost:8000/add?a=10&b=20"
# {"sum": 30}
```

## Features

- **Zero boilerplate** — functions become endpoints automatically
- **Type coercion** — type hints auto-cast query parameters
- **Swagger UI** — interactive docs at `/docs`
- **OpenAPI 3.0** — machine-readable spec at `/openapi.json`
- **Error handling** — missing params return 400, server errors return 500

## License

MIT
