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
pip install pocketapi
Quick Start
Create a Python file with your functions:
# 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:
pocketapi serve api.py
Now visit:
- API: http://localhost:8000/
- Docs: http://localhost:8000/docs
Test your endpoints:
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
Metadata
Release files for pocketapi-framework 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pocketapi_framework-0.1.0.tar.gz | 9.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pocketapi_framework-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.0 kB
Release files / pocketapi_framework-0.1.0.tar.gz
| Download URL | pocketapi_framework-0.1.0.tar.gz |
|---|---|
| Size | 9.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
59770db47f0ef15259d3f4801576289d40ebbb1478acd8866a9bdbb95ddab487
|
|
BLAKE2b-256 checksum How to use checksums |
91f79a98ddd520985332f35587d2ff0d34873aab8b0655f307b044df854abac2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.2
|
Release files / pocketapi_framework-0.1.0-py3-none-any.whl
| Download URL | pocketapi_framework-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
19792b017b0ff16b5fae206a8b82a0efcf659f2e9c635c16005d61f854c5d0af
|
|
BLAKE2b-256 checksum How to use checksums |
20eb338dfc425e00577e7ea7122e1b874df3d4e2f05443c6b088f5e714fa4395
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.2
|
Security for pocketapi-framework 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.