{ "info": { "author": "Tom Christie", "author_email": "tom@tomchristie.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Internet :: WWW/HTTP" ], "description": "
\n\n \u2728 The little ASGI framework that shines. \u2728\n
\n\n\n---\n\n**Documentation**: [https://www.starlette.io/](https://www.starlette.io/)\n\n---\n\n# Starlette\n\nStarlette is a lightweight [ASGI](https://asgi.readthedocs.io/en/latest/) framework/toolkit,\nwhich is ideal for building high performance asyncio services.\n\nIt is production-ready, and gives you the following:\n\n* Seriously impressive performance.\n* WebSocket support.\n* GraphQL support.\n* In-process background tasks.\n* Startup and shutdown events.\n* Test client built on `requests`.\n* CORS, GZip, Static Files, Streaming responses.\n* Session and Cookie support.\n* 100% test coverage.\n* 100% type annotated codebase.\n* Zero hard dependencies.\n\n## Requirements\n\nPython 3.6+\n\n## Installation\n\n```shell\n$ pip3 install starlette\n```\n\nYou'll also want to install an ASGI server, such as [uvicorn](http://www.uvicorn.org/), [daphne](https://github.com/django/daphne/), or [hypercorn](https://pgjones.gitlab.io/hypercorn/).\n\n```shell\n$ pip3 install uvicorn\n```\n\n## Example\n\n```python\nfrom starlette.applications import Starlette\nfrom starlette.responses import JSONResponse\nimport uvicorn\n\napp = Starlette(debug=True)\n\n\n@app.route('/')\nasync def homepage(request):\n return JSONResponse({'hello': 'world'})\n\nif __name__ == '__main__':\n uvicorn.run(app, host='0.0.0.0', port=8000)\n```\n\nFor a more complete example, see [encode/starlette-example](https://github.com/encode/starlette-example).\n\n## Dependencies\n\nStarlette does not have any hard dependencies, but the following are optional:\n\n* [`requests`][requests] - Required if you want to use the `TestClient`.\n* [`aiofiles`][aiofiles] - Required if you want to use `FileResponse` or `StaticFiles`.\n* [`jinja2`][jinja2] - Required if you want to use `Jinja2Templates`.\n* [`python-multipart`][python-multipart] - Required if you want to support form parsing, with `request.form()`.\n* [`itsdangerous`][itsdangerous] - Required for `SessionMiddleware` support.\n* [`pyyaml`][pyyaml] - Required for `SchemaGenerator` support.\n* [`graphene`][graphene] - Required for `GraphQLApp` support.\n* [`ujson`][ujson] - Required if you want to use `UJSONResponse`.\n\nYou can install all of these with `pip3 install starlette[full]`.\n\n## Framework or Toolkit\n\nStarlette is designed to be used either as a complete framework, or as\nan ASGI toolkit. You can use any of its components independently.\n\n```python\nfrom starlette.responses import PlainTextResponse\n\n\nclass App:\n def __init__(self, scope):\n assert scope['type'] == 'http'\n self.scope = scope\n\n async def __call__(self, receive, send):\n response = PlainTextResponse('Hello, world!')\n await response(receive, send)\n```\n\nRun the `App` application in `example.py`:\n\n```shell\n$ uvicorn example:App\nINFO: Started server process [11509]\nINFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)\n```\n\nRun uvicorn with `--reload` to enable auto-reloading on code changes.\n\n## Modularity\n\nThe modularity that Starlette is designed on promotes building re-usable\ncomponents that can be shared between any ASGI framework. This should enable\nan ecosystem of shared middleware and mountable applications.\n\nThe clean API separation also means it's easier to understand each component\nin isolation.\n\n## Performance\n\nIndependent TechEmpower benchmarks show Starlette applications running under Uvicorn\nas [one of the fastest Python frameworks available](https://www.techempower.com/benchmarks/#section=data-r17&hw=ph&test=fortune&l=zijzen-1). *(\\*)*\n\nFor high throughput loads you should:\n\n* Make sure to install `ujson` and use `UJSONResponse`.\n* Run using gunicorn using the `uvicorn` worker class.\n* Use one or two workers per-CPU core. (You might need to experiment with this.)\n* Disable access logging.\n\nEg.\n\n```shell\ngunicorn -w 4 -k uvicorn.workers.UvicornWorker --log-level warning example:app\n```\n\nSeveral of the ASGI servers also have pure Python implementations available,\nso you can also run under `PyPy` if your application code has parts that are\nCPU constrained.\n\nEither programatically:\n\n```python\nuvicorn.run(..., http='h11', loop='asyncio')\n```\n\nOr using Gunicorn:\n\n```shell\ngunicorn -k uvicorn.workers.UvicornH11Worker ...\n```\n\n— \u2b50\ufe0f —
\nStarlette is BSD licensed code. Designed & built in Brighton, England.
\n\n[requests]: http://docs.python-requests.org/en/master/\n[aiofiles]: https://github.com/Tinche/aiofiles\n[jinja2]: http://jinja.pocoo.org/\n[python-multipart]: https://andrew-d.github.io/python-multipart/\n[graphene]: https://graphene-python.org/\n[itsdangerous]: https://pythonhosted.org/itsdangerous/\n[sqlalchemy]: https://www.sqlalchemy.org\n[pyyaml]: https://pyyaml.org/wiki/PyYAMLDocumentation\n[ujson]: https://github.com/esnme/ultrajson\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/naokipeter/starlette", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "starlette-naokipeter", "package_url": "https://pypi.org/project/starlette-naokipeter/", "platform": "", "project_url": "https://pypi.org/project/starlette-naokipeter/", "project_urls": { "Homepage": "https://github.com/naokipeter/starlette" }, "release_url": "https://pypi.org/project/starlette-naokipeter/0.12.0b3/", "requires_dist": [ "aiofiles ; extra == 'full'", "asyncpg ; extra == 'full'", "graphene ; extra == 'full'", "itsdangerous ; extra == 'full'", "jinja2 ; extra == 'full'", "python-multipart ; extra == 'full'", "pyyaml ; extra == 'full'", "requests ; extra == 'full'", "ujson ; extra == 'full'" ], "requires_python": ">=3.6", "summary": "The little ASGI library that shines.", "version": "0.12.0b3" }, "last_serial": 5293149, "releases": { "0.12.0b3": [ { "comment_text": "", "digests": { "md5": "9e69b4f71fb4740308933f289f7fa9ec", "sha256": "f48e392c65a50d8b245a09ba504e3766aeac8801ce9714f7ddfbb0ef41585db7" }, "downloads": -1, "filename": "starlette_naokipeter-0.12.0b3-py3-none-any.whl", "has_sig": false, "md5_digest": "9e69b4f71fb4740308933f289f7fa9ec", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 55880, "upload_time": "2019-05-20T16:05:40", "url": "https://files.pythonhosted.org/packages/c9/8b/0dbd84b25a6b371725a353503d8a95ec8c145a79e367d1f354c8b6633365/starlette_naokipeter-0.12.0b3-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9e69b4f71fb4740308933f289f7fa9ec", "sha256": "f48e392c65a50d8b245a09ba504e3766aeac8801ce9714f7ddfbb0ef41585db7" }, "downloads": -1, "filename": "starlette_naokipeter-0.12.0b3-py3-none-any.whl", "has_sig": false, "md5_digest": "9e69b4f71fb4740308933f289f7fa9ec", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 55880, "upload_time": "2019-05-20T16:05:40", "url": "https://files.pythonhosted.org/packages/c9/8b/0dbd84b25a6b371725a353503d8a95ec8c145a79e367d1f354c8b6633365/starlette_naokipeter-0.12.0b3-py3-none-any.whl" } ] }