Skip to main content

A simple async API framework based on Starlette.

test pypi pypistats pypi versions

Star OpenAPI is a web API framework based on Starlette. It uses Pydantic to verify data and automatic generation of interaction documentation.

The key features are:

Requirements

Python 3.11+

star-openapi is dependent on the following libraries:

Installation

pip install -U star-openapi[swagger]
Optional dependencies
  • httpx - Required if you want to use the TestClient.
  • python-multipart - Required if you want to support form parsing, with request.form().
  • itsdangerous - Required for SessionMiddleware support.
  • pyyaml - Required for SchemaGenerator support.

You can install all of these with pip install star-openapi[full].

You can install all of these with pip install star-openapi[swagger,redoc,rapidoc,rapipdf,scalar,elements].

A Simple Example

Here's a simple example, further go to the Example.

import uvicorn
from pydantic import BaseModel
from starlette.responses import JSONResponse

from star_openapi import OpenAPI

info = {"title": "Star API", "version": "1.0.0"}
app = OpenAPI(info=info)

book_tag = {"name": "book", "description": "book tag"}


class BookModel(BaseModel):
    name: str
    age: int


@app.post("/book", summary="get books", tags=[book_tag])
async def create_user(body: BookModel):
    """
    get all books
    """
    print(body.model_dump_json())
    return JSONResponse({"message": "Hello World"})


if __name__ == "__main__":
    print(app.routes)
    uvicorn.run(app)

API Document

Run the simple example, and go to http://127.0.0.1:8000/openapi.

OpenAPI UI plugins are optional dependencies that require manual installation.

pip install -U star-openapi[swagger,redoc,rapidoc,rapipdf,scalar,elements]

More optional ui templates goto the document about UI_Templates.

openapi

Metadata

Release files for star-openapi 0.9.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for star-openapi 0.9.9
File Size Uploaded Provenance Actions
star_openapi-0.9.9.tar.gz 563.9 kB Without provenance Details for star_openapi-0.9.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for star-openapi 0.9.9
File Interpreter ABI Platform Actions
star_openapi-0.9.9-py3-none-any.whl Python 3 none any Details for star_openapi-0.9.9-py3-none-any.whl

Total release size: 605.8 kB

Release files / star_openapi-0.9.9.tar.gz

Download URL star_openapi-0.9.9.tar.gz
Size 563.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b7a6b00b4b7c6d721690a597fc30850234592e284732c113dbca5c4eae861b51
BLAKE2b-256 checksum
How to use checksums
b775faed024c344e077930262b1d160836351c8b5725038b80877d520443dcc6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / star_openapi-0.9.9-py3-none-any.whl

Download URL star_openapi-0.9.9-py3-none-any.whl
Size 41.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8e02cd8cb57b6d3b2ed0f1ecc2794ba4781c2cc396d24e9adb78345e7aca7fb8
BLAKE2b-256 checksum
How to use checksums
c986170ef804a8960e592c178f85cefd978efd8fa68f4de9fcb7f0751738f6e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for star-openapi 0.9.9

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page