Skip to main content

Powerful and exquisite WSGI/ASGI framework/toolkit.

Project description

BáiZé

Codecov PyPI - Python Version

Powerful and exquisite WSGI/ASGI framework/toolkit. Use MyPyC to improve code running speed.

The minimize implementation of methods required in the Web framework. No redundant implementation means that you can freely customize functions without considering the conflict with baize's own implementation.

Under the ASGI/WSGI protocol, the interface of the request object and the response object is almost the same, only need to add or delete await in the appropriate place. In addition, it should be noted that ASGI supports WebSocket but WSGI does not.

Install

pip install -U baize

Or install from GitHub master branch

pip install -U git+https://github.com/abersheeran/baize@setup.py

Document and other website

BáiZé Document

If you have questions or idea, you can send it to Discussions.

Quick Start

A short example for WSGI application, if you don't know what is WSGI, please read PEP3333.

from baize.wsgi import request_response, Router, Request, Response, PlainTextResponse


@request_response
def sayhi(request: Request) -> Response:
    return PlainTextResponse("hi, " + request.path_params["name"])


@request_response
def echo(request: Request) -> Response:
    return PlainTextResponse(request.body)


application = Router(
    ("/", PlainTextResponse("homepage")),
    ("/echo", echo),
    ("/sayhi/{name}", sayhi),
)


if __name__ == "__main__":
    import uvicorn

    uvicorn.run(application, interface="wsgi", port=8000)

A short example for ASGI application, if you don't know what is ASGI, please read ASGI Documention.

from baize.asgi import request_response, Router, Request, Response, PlainTextResponse


@request_response
async def sayhi(request: Request) -> Response:
    return PlainTextResponse("hi, " + request.path_params["name"])


@request_response
async def echo(request: Request) -> Response:
    return PlainTextResponse(await request.body)


application = Router(
    ("/", PlainTextResponse("homepage")),
    ("/echo", echo),
    ("/sayhi/{name}", sayhi),
)


if __name__ == "__main__":
    import uvicorn

    uvicorn.run(application, interface="asgi3", port=8000)

License

Apache-2.0.

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

baize-0.11.0.tar.gz (33.5 kB view details)

Uploaded Source

Built Distributions

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

baize-0.11.0-py3-none-any.whl (36.6 kB view details)

Uploaded Python 3

baize-0.11.0-cp39-cp39-win_amd64.whl (220.1 kB view details)

Uploaded CPython 3.9Windows x86-64

baize-0.11.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.5+ x86-64

baize-0.11.0-cp39-cp39-macosx_10_14_x86_64.whl (273.0 kB view details)

Uploaded CPython 3.9macOS 10.14+ x86-64

baize-0.11.0-cp38-cp38-win_amd64.whl (188.4 kB view details)

Uploaded CPython 3.8Windows x86-64

baize-0.11.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (944.8 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.5+ x86-64

baize-0.11.0-cp38-cp38-macosx_10_14_x86_64.whl (231.6 kB view details)

Uploaded CPython 3.8macOS 10.14+ x86-64

baize-0.11.0-cp37-cp37m-win_amd64.whl (186.7 kB view details)

Uploaded CPython 3.7mWindows x86-64

baize-0.11.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (837.4 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.5+ x86-64

baize-0.11.0-cp37-cp37m-macosx_10_14_x86_64.whl (225.4 kB view details)

Uploaded CPython 3.7mmacOS 10.14+ x86-64

baize-0.11.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (808.4 kB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.5+ x86-64

baize-0.11.0-cp36-cp36m-macosx_10_14_x86_64.whl (220.3 kB view details)

Uploaded CPython 3.6mmacOS 10.14+ x86-64

File details

Details for the file baize-0.11.0.tar.gz.

File metadata

  • Download URL: baize-0.11.0.tar.gz
  • Upload date:
  • Size: 33.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for baize-0.11.0.tar.gz
Algorithm Hash digest
SHA256 983ced84d38555b8d24172ed01edb02371a2ddeb601d1defe2425509b8a39166
MD5 90433ec5cec37fb051100c63f21ab39b
BLAKE2b-256 e44c354d425d249dbf382a20aca358f78879e480809da3becc22311248365ab1

See more details on using hashes here.

File details

Details for the file baize-0.11.0-py3-none-any.whl.

File metadata

  • Download URL: baize-0.11.0-py3-none-any.whl
  • Upload date:
  • Size: 36.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for baize-0.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9fbf3bcee350582d9f1d94f2ed6639b73e12b90a42dc15652badf1698741bd9d
MD5 5555c7f9696fd5d44b4b9a9ce3b93919
BLAKE2b-256 7ca8dacfddea2fdc5ef8a608f75c0106e43e9dc617eae03e96ef2a17e82f50ab

See more details on using hashes here.

File details

Details for the file baize-0.11.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: baize-0.11.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 220.1 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for baize-0.11.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 b3d1b977ea2a43e98b1092f05a2971686703bcda7e922d003d61c6b7aa5d2fe7
MD5 1db1de48bfcf988fbb6fa7b99608fc31
BLAKE2b-256 020f074a7bc34bfe87a30c6b96cdc8017c53eb5e80196f17bf28dbe61b5f2748

See more details on using hashes here.

File details

Details for the file baize-0.11.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

  • Download URL: baize-0.11.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.9, manylinux: glibc 2.5+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for baize-0.11.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5a74b69b1d3ff370a28301d80c9501fa88ff3ff1d037d4e1ac56ff0f3d1db6a3
MD5 5132e048225bcead5e50bee0c13d380b
BLAKE2b-256 d8df39a5bd981aaa9073fa2be33e79d29b9310429a737a3a0d80291049ee749e

See more details on using hashes here.

File details

Details for the file baize-0.11.0-cp39-cp39-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: baize-0.11.0-cp39-cp39-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 273.0 kB
  • Tags: CPython 3.9, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for baize-0.11.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 698bd8339a1663552bf3f283eace3b6a288e61088312214aca25b0acc289b946
MD5 ed167078ebc2fa133f9f680275736934
BLAKE2b-256 3bdc02c0be598948c774a6795e5f856091e342e0c1620a9c25008b8b5eaa8f52

See more details on using hashes here.

File details

Details for the file baize-0.11.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: baize-0.11.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 188.4 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for baize-0.11.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 0d57c9692d63cf02a18377cb2f054af3f901480aac2beae5a6df69ae68680ef9
MD5 772c53b9c9f816a1eef882e84f99f5ee
BLAKE2b-256 714307033c917bda901b22bac5678db449e383693fe05be5b59e6299a541ce6b

See more details on using hashes here.

File details

Details for the file baize-0.11.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

  • Download URL: baize-0.11.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
  • Upload date:
  • Size: 944.8 kB
  • Tags: CPython 3.8, manylinux: glibc 2.5+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for baize-0.11.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5b577c78f2cf75bc27b391e4f86ea62f125393f2a9857f19cadef621c0d7320e
MD5 8f51de2a9aa47c690ba7ac4754b69d2c
BLAKE2b-256 cd629260bc1be0316a06564304780194ad9061178e6696865f0a0522efd89b6f

See more details on using hashes here.

File details

Details for the file baize-0.11.0-cp38-cp38-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: baize-0.11.0-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 231.6 kB
  • Tags: CPython 3.8, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for baize-0.11.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 fd06dd00aaf3bd39c94a61d0bd47899f784823ab039cd5cd531adf5a3168d761
MD5 49c2768f52affd9a7fc06913c8a634ba
BLAKE2b-256 c51393a95761217be8e179c8588d203fed64ab6cdcacceb46340fc8ad3730c53

See more details on using hashes here.

File details

Details for the file baize-0.11.0-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: baize-0.11.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 186.7 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.9

File hashes

Hashes for baize-0.11.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 c76f8dbed7785ffca07b6a71ed098b3cbe39aed9a21dcf642ab11a99c5b331bc
MD5 05f4cbdbb6cc7381261f95eeda3a7c37
BLAKE2b-256 bd900677d3798601ceda3b0ffac0d7b450441e88053d934b6a18ba53ec66428a

See more details on using hashes here.

File details

Details for the file baize-0.11.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

  • Download URL: baize-0.11.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
  • Upload date:
  • Size: 837.4 kB
  • Tags: CPython 3.7m, manylinux: glibc 2.5+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for baize-0.11.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a0d88768b43cebb74862624b89cce4329203fe961dec0740483bde4acf71c83e
MD5 58c14564128c3bfe08ee08a3647eb6a3
BLAKE2b-256 35c8ddcf0bedacef58c5d45776cbafefbfd2f4d3013f5db66160522efb7bc891

See more details on using hashes here.

File details

Details for the file baize-0.11.0-cp37-cp37m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: baize-0.11.0-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 225.4 kB
  • Tags: CPython 3.7m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for baize-0.11.0-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 765f1562c093fffd156fb22b4c6a9f48c118d9875ae67b964e96f5347217ba29
MD5 68f0289bdda62621973ff4d2c8c31aaf
BLAKE2b-256 9758a0b46acbf2d6038f2da366de3729f82c35bb2acddff6c657f195bf2a6365

See more details on using hashes here.

File details

Details for the file baize-0.11.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

  • Download URL: baize-0.11.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
  • Upload date:
  • Size: 808.4 kB
  • Tags: CPython 3.6m, manylinux: glibc 2.5+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.15

File hashes

Hashes for baize-0.11.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 6ccd4702956e6d3e6cb20b443b6b7c818315f5c0d798ce33f3d73d3deaf42da1
MD5 841f1429018228b366f3f39f58ecc453
BLAKE2b-256 c6ed4abe146d2a2004f157b6bd0d4ac4f9feb6f643637a011bec8ded15a4de18

See more details on using hashes here.

File details

Details for the file baize-0.11.0-cp36-cp36m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: baize-0.11.0-cp36-cp36m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 220.3 kB
  • Tags: CPython 3.6m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.15

File hashes

Hashes for baize-0.11.0-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 03c1253926e54b3e93f4365576f283316009f34581a83f6ee3620bcbcb811575
MD5 b647c2f83c5cadb75cb4501fc1064bc2
BLAKE2b-256 aaebfe7d720ab7959e36e0cf5d862ea6ad55a435d8641d7aaac198955afa3307

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