Skip to main content

No project description provided

Project description

Qyin

Qyin is a python web framework that is simple and easy to use

Installation

pip install qyin

Usage

from pydantic import BaseModel, Field
from starlette.responses import JSONResponse

from qyin import (
    Qyin,
    Route,
    RouteGroup,
)


class PingRequest(BaseModel):
    req_foo: str = Field(description="foo value of the request")
    req_bar: str = Field(description="bar value of the request")


class PingResponse(BaseModel):
    resp_foo: str = Field(description="foo value of the response")
    resp_bar: str = Field(description="bar value of the response")


async def home(request):
    return JSONResponse("Homepage")


# create router 
root_router = RouteGroup(path="/")

user_router = RouteGroup(path="/user")
project_router = RouteGroup(path="/project")

user_router.post("/login",
                 home,
                 request_model=PingRequest,
                 response_ok=PingResponse)
project_router.post("/create",
                    home,
                    request_model=PingRequest,
                    response_ok=PingResponse)

root_router.add_router(user_router)
root_router.add_router(project_router)

# create qyin app
qyin = Qyin(title="qying", description="qyin is a python web framework")
qyin.set_root_router(root_router)


if __name__ == "__main__":
    import uvicorn
    uvicorn.run(qyin, host="0.0.0.0", port=8000)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qyin-0.1.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qyin-0.1.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file qyin-0.1.0.tar.gz.

File metadata

  • Download URL: qyin-0.1.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.10.0 Windows/10

File hashes

Hashes for qyin-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7ff47fbbb069fb4a6baba0f46190ef0942454c3d403378bae1a418df3b110268
MD5 74cf424ab097707a614d8f75fc5c8e45
BLAKE2b-256 c7652f23b2d33858719e4d4b90f1de2f7f45cd0fd638146b90a44e070702e8c1

See more details on using hashes here.

File details

Details for the file qyin-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: qyin-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.10.0 Windows/10

File hashes

Hashes for qyin-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f605b2690aa17d1bf060b6f3d18cccf10c7bacccd4a0d48ff2e982eadbd29640
MD5 4e0c0f4ef69a93ec8544114229acf3fa
BLAKE2b-256 279fd4a684c1ccef5d6dff60bf3c308fb5fd8b2795ddd0cf6ec0fd1bad3343dc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page