{"id":16853760,"url":"https://github.com/abersheeran/baize","last_synced_at":"2025-10-04T07:57:24.385Z","repository":{"id":39754517,"uuid":"340819925","full_name":"abersheeran/baize","owner":"abersheeran","description":"Powerful and exquisite WSGI/ASGI framework/toolkit.","archived":false,"fork":false,"pushed_at":"2025-08-10T10:25:05.000Z","size":615,"stargazers_count":92,"open_issues_count":1,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-09-19T19:38:37.379Z","etag":null,"topics":["asgi","python3","wsgi"],"latest_commit_sha":null,"homepage":"https://baize.aber.sh","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abersheeran.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-02-21T04:51:11.000Z","updated_at":"2025-09-07T18:44:38.000Z","dependencies_parsed_at":"2024-06-19T05:27:33.728Z","dependency_job_id":"867dede8-1f77-461c-a211-18c9cfdeb062","html_url":"https://github.com/abersheeran/baize","commit_stats":{"total_commits":253,"total_committers":3,"mean_commits":84.33333333333333,"dds":0.007905138339920903,"last_synced_commit":"4240519a4659a731ba7d545af63b2ac43ff4015e"},"previous_names":[],"tags_count":54,"template":false,"template_full_name":null,"purl":"pkg:github/abersheeran/baize","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abersheeran%2Fbaize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abersheeran%2Fbaize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abersheeran%2Fbaize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abersheeran%2Fbaize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abersheeran","download_url":"https://codeload.github.com/abersheeran/baize/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abersheeran%2Fbaize/sbom","scorecard":{"id":160573,"data":{"date":"2025-08-11","repo":{"name":"github.com/abersheeran/baize","commit":"ecc675ea4d852c17c3e33bb580e61b30da90dc05"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/doc.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":5,"reason":"7 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/abersheeran/baize/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:44: update your workflow using https://app.stepsecurity.io/secureworkflow/abersheeran/baize/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:61: update your workflow using https://app.stepsecurity.io/secureworkflow/abersheeran/baize/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:97: update your workflow using https://app.stepsecurity.io/secureworkflow/abersheeran/baize/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:99: update your workflow using https://app.stepsecurity.io/secureworkflow/abersheeran/baize/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/doc.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/abersheeran/baize/doc.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:107","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 third-party GitHubAction dependencies pinned","Info:   0 out of   1 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":8,"reason":"2 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-vqfr-h8mv-ghfj","Warn: Project is vulnerable to: GHSA-2c2j-9gv5-cj73"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 9 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T13:17:39.584Z","repository_id":39754517,"created_at":"2025-08-16T13:17:39.584Z","updated_at":"2025-08-16T13:17:39.584Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276229736,"owners_count":25606950,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-21T02:00:07.055Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asgi","python3","wsgi"],"created_at":"2024-10-13T13:53:06.298Z","updated_at":"2025-10-04T07:57:24.366Z","avatar_url":"https://github.com/abersheeran.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BáiZé\n\n[![Codecov](https://img.shields.io/codecov/c/github/abersheeran/baize?style=flat-square)](https://codecov.io/gh/abersheeran/baize)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/baize?label=Support%20Python%20Version\u0026style=flat-square)](https://pypi.org/project/baize/)\n\nPowerful and exquisite WSGI/ASGI framework/toolkit. Only relies on the standard library.\n\nThe 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.\n\nUnder 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.\n\n- Type annotations as strict as possible (almost no Any)\n- Support range file response, server-sent event response\n- Support WebSocket (only ASGI)\n- WSGI, ASGI routing to combine any application like [Django(wsgi)](https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/)/[Kuí(wsgi)](https://kui.aber.sh/wsgi/)/[Pyramid](https://trypyramid.com/)/[Bottle](https://bottlepy.org/)/[Flask](https://flask.palletsprojects.com/) or [Django(asgi)](https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/)/[Kuí(asgi)](https://kui.aber.sh/asgi/)/[Starlette](https://www.starlette.io/)/[FastAPI](https://fastapi.tiangolo.com/)/[Sanic](https://sanic.readthedocs.io/en/stable/)/[Quart](https://pgjones.gitlab.io/quart/)\n\n## Install\n\n```\npip install -U baize\n```\n\n## Document and other website\n\n[BáiZé Document](https://baize.aber.sh/)\n\nIf you have questions or idea, you can send it to [Discussions](https://github.com/abersheeran/baize/discussions).\n\n## Quick Start\n\nA short example for WSGI application, if you don't know what is WSGI, please read [PEP3333](https://www.python.org/dev/peps/pep-3333/).\n\n```python\nimport time\nfrom typing import Callable\nfrom baize.wsgi import (\n    decorator,\n    request_response,\n    Router,\n    Request,\n    Response,\n    PlainTextResponse,\n)\n\n\n@decorator\ndef timer(request: Request, next_call: Callable[[Request], Response]) -\u003e Response:\n    start_time = time.time()\n    response = next_call(request)\n    end_time = time.time()\n    response.headers[\"x-time\"] = str(round((end_time - start_time) * 1000))\n    return response\n\n\n@request_response\n@timer\ndef sayhi(request: Request) -\u003e Response:\n    return PlainTextResponse(\"hi, \" + request.path_params[\"name\"])\n\n\n@request_response\n@timer\ndef echo(request: Request) -\u003e Response:\n    return PlainTextResponse(request.body)\n\n\napplication = Router(\n    (\"/\", PlainTextResponse(\"homepage\")),\n    (\"/echo\", echo),\n    (\"/sayhi/{name}\", sayhi),\n)\n\n\nif __name__ == \"__main__\":\n    import uvicorn\n\n    uvicorn.run(application, interface=\"wsgi\", port=8000)\n```\n\nA short example for ASGI application, if you don't know what is ASGI, please read [ASGI Documention](https://asgi.readthedocs.io/en/latest/).\n\n```python\nimport time\nfrom typing import Awaitable, Callable\nfrom baize.asgi import (\n    decorator,\n    request_response,\n    Router,\n    Request,\n    Response,\n    PlainTextResponse,\n)\n\n\n@decorator\nasync def timer(\n    request: Request, next_call: Callable[[Request], Awaitable[Response]]\n) -\u003e Response:\n    start_time = time.time()\n    response = await next_call(request)\n    end_time = time.time()\n    response.headers[\"x-time\"] = str(round((end_time - start_time) * 1000))\n    return response\n\n\n@request_response\n@timer\nasync def sayhi(request: Request) -\u003e Response:\n    return PlainTextResponse(\"hi, \" + request.path_params[\"name\"])\n\n\n@request_response\n@timer\nasync def echo(request: Request) -\u003e Response:\n    return PlainTextResponse(await request.body)\n\n\napplication = Router(\n    (\"/\", PlainTextResponse(\"homepage\")),\n    (\"/echo\", echo),\n    (\"/sayhi/{name}\", sayhi),\n)\n\n\nif __name__ == \"__main__\":\n    import uvicorn\n\n    uvicorn.run(application, interface=\"asgi3\", port=8000)\n```\n\n## License\n\nApache-2.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabersheeran%2Fbaize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabersheeran%2Fbaize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabersheeran%2Fbaize/lists"}