معرفی شرکت ها


cosmo-0.7.0


Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر

توضیحات

A high-level web server with fine tuned low-level control.
ویژگی مقدار
سیستم عامل -
نام فایل cosmo-0.7.0
نام cosmo
نسخه کتابخانه 0.7.0
نگهدارنده []
ایمیل نگهدارنده []
نویسنده Kronifer
ایمیل نویسنده 44979306+Kronifer@users.noreply.github.com
آدرس صفحه اصلی https://github.com/kronifer/cosmo
آدرس اینترنتی https://pypi.org/project/cosmo/
مجوز Apache-2.0
# Cosmo Cosmo is an asynchronous python webserver that utilizes raw sockets to send and receive data, without using ASGI/WSGI. ## Benchmarking ![Connections Handled per Second](https://user-images.githubusercontent.com/44979306/191119603-e9b97cb1-b8dc-4cf0-8bf3-2a927dac8dac.png) ## Examples ### Simple Server ```py from cosmo import App, Request, Response app = App("0.0.0.0", 8080) @app.route("/", "text/html") async def index(request: Request): return Response(f"<h1>{request.address}</h1>") app.serve() ``` ### Using Custom Headers ```py from cosmo import App, Request, Response app = App("0.0.0.0", 8080) @app.route("/", "text/html") async def index(request: Request): headers = {"x-custom-header": "custom"} content = "<h1>Custom Headers: </h1>\n<ul>" for header in headers.keys(): content += f"<li>{header}: {headers[header]}</li>\n" content += "</ul>" return Response(content, headers) app.serve() ``` ### Returning an HTML Page ```py from cosmo import App, html_page, Request, Response app = App("0.0.0.0", 8080) @app.route("/", "text/html") async def index(request: Request): return Response(html_page("path/to/page.html")) app.serve() ``` ### Using Routes from a different file In `router.py`: ```py from cosmo import Request, Response, Router router = Router() @router.route("/") async def index(): return Response("<h1>Hi</h1>") ``` In `app.py`: ```py from cosmo import App, Request, Response from router import router app = App("0.0.0.0", 8080) app.import_router(router) app.serve() ``` ## Docs Coming soon...


نیازمندی

مقدار نام
>=0.5.3,<0.6.0 loguru
>=5.10.1,<6.0.0 isort


زبان مورد نیاز

مقدار نام
>=3.8,<4.0 Python


نحوه نصب


نصب پکیج whl cosmo-0.7.0:

    pip install cosmo-0.7.0.whl


نصب پکیج tar.gz cosmo-0.7.0:

    pip install cosmo-0.7.0.tar.gz