Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
โCITATION.cff file
Found CITATION.cff file -
โcodemeta.json file
Found codemeta.json file -
โ.zenodo.json file
Found .zenodo.json file -
โDOI references
-
โAcademic publication links
-
โAcademic email domains
-
โInstitutional organization owner
-
โJOSS paper metadata
-
โScientific vocabulary similarity
Low similarity (16.0%) to scientific vocabulary
Keywords
Repository
An ASGI web server, for Python. ๐ฆ
Basic Info
- Host: GitHub
- Owner: Kludex
- License: bsd-3-clause
- Language: Python
- Default Branch: master
- Homepage: https://www.uvicorn.org/
- Size: 3.43 MB
Statistics
- Stars: 9,668
- Watchers: 95
- Forks: 839
- Open Issues: 67
- Releases: 64
Topics
Metadata Files
README.md
An ASGI web server, for Python.
Documentation: https://www.uvicorn.org
Uvicorn is an ASGI web server implementation for Python.
Until recently Python has lacked a minimal low-level server/application interface for async frameworks. The ASGI specification fills this gap, and means we're now able to start building a common set of tooling usable across all async frameworks.
Uvicorn supports HTTP/1.1 and WebSockets.
Quickstart
Install using pip:
shell
$ pip install uvicorn
This will install uvicorn with minimal (pure Python) dependencies.
shell
$ pip install 'uvicorn[standard]'
This will install uvicorn with "Cython-based" dependencies (where possible) and other "optional extras".
In this context, "Cython-based" means the following:
- the event loop
uvloopwill be installed and used if possible. - the http protocol will be handled by
httptoolsif possible.
Moreover, "optional extras" means that:
- the websocket protocol will be handled by
websockets(should you want to usewsprotoyou'd need to install it manually) if possible. - the
--reloadflag in development mode will usewatchfiles. - windows users will have
coloramainstalled for the colored logs. python-dotenvwill be installed should you want to use the--env-fileoption.PyYAMLwill be installed to allow you to provide a.yamlfile to--log-config, if desired.
Create an application, in example.py:
```python async def app(scope, receive, send): assert scope['type'] == 'http'
await send({
'type': 'http.response.start',
'status': 200,
'headers': [
(b'content-type', b'text/plain'),
],
})
await send({
'type': 'http.response.body',
'body': b'Hello, world!',
})
```
Run the server:
shell
$ uvicorn example:app
Why ASGI?
Most well established Python Web frameworks started out as WSGI-based frameworks.
WSGI applications are a single, synchronous callable that takes a request and returns a response. This doesnโt allow for long-lived connections, like you get with long-poll HTTP or WebSocket connections, which WSGI doesn't support well.
Having an async concurrency model also allows for options such as lightweight background tasks, and can be less of a limiting factor for endpoints that have long periods being blocked on network I/O such as dealing with slow HTTP requests.
Alternative ASGI servers
A strength of the ASGI protocol is that it decouples the server implementation from the application framework. This allows for an ecosystem of interoperating webservers and application frameworks.
Daphne
The first ASGI server implementation, originally developed to power Django Channels, is the Daphne webserver.
It is run widely in production, and supports HTTP/1.1, HTTP/2, and WebSockets.
Any of the example applications given here can equally well be run using daphne instead.
$ pip install daphne
$ daphne app:App
Hypercorn
Hypercorn was initially part of the Quart web framework, before being separated out into a standalone ASGI server.
Hypercorn supports HTTP/1.1, HTTP/2, and WebSockets.
It also supports the excellent trio async framework, as an alternative to asyncio.
$ pip install hypercorn
$ hypercorn app:App
Mangum
Mangum is an adapter for using ASGI applications with AWS Lambda & API Gateway.
Granian
Granian is an ASGI compatible Rust HTTP server which supports HTTP/2, TLS and WebSockets.
Uvicorn is BSD licensed code.
Designed & crafted with care.
— ๐ฆ —
Owner
- Name: Marcelo Trylesinski
- Login: Kludex
- Kind: user
- Location: Utrecht, Netherlands
- Company: @encode @pydantic
- Website: https://www.fastapiexpert.com/
- Twitter: marcelotryle
- Repositories: 193
- Profile: https://github.com/Kludex
Software Engineer @ Pydantic ๐ง๐ท๐บ๐พ๐ฎ๐น Uvicorn & Starlette maintainer ๐ฆ๐ FastAPI Expert โก
Citation (CITATION.cff)
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!
cff-version: 1.2.0
title: Uvicorn
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Marcelo
family-names: Trylesinski
email: marcelotryle@gmail.com
- given-names: Tom
family-names: Christie
email: tom@tomchristie.com
repository-code: 'https://github.com/encode/uvicorn'
url: 'https://www.uvicorn.org/'
abstract: Uvicorn is an ASGI web server implementation for Python.
keywords:
- asgi
- server
license: BSD-3-Clause
GitHub Events
Total
- Watch event: 9
- Issue comment event: 5
- Pull request event: 3
Last Year
- Watch event: 9
- Issue comment event: 5
- Pull request event: 3
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 2
- Total pull requests: 12
- Average time to close issues: N/A
- Average time to close pull requests: 6 days
- Total issue authors: 2
- Total pull request authors: 9
- Average comments per issue: 0.5
- Average comments per pull request: 0.25
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 3
Past Year
- Issues: 2
- Pull requests: 12
- Average time to close issues: N/A
- Average time to close pull requests: 6 days
- Issue authors: 2
- Pull request authors: 9
- Average comments per issue: 0.5
- Average comments per pull request: 0.25
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 3
Top Authors
Issue Authors
- tri-dataxight (1)
- mattp- (1)
Pull Request Authors
- dependabot[bot] (3)
- secrett2633 (2)
- Ngone6325 (1)
- activecat (1)
- lddfym (1)
- vvanglro (1)
- LincolnPuzey (1)
- ollanta (1)
- rnv812 (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- actions/checkout v4 composite
- actions/setup-python v4 composite
- actions/checkout v4 composite
- actions/setup-python v4 composite
- click >=7.0
- h11 >=0.8
- typing_extensions >=4.0; python_version < '3.11'
- a2wsgi ==1.8.0
- build ==1.0.3
- coverage ==7.3.1
- coverage-conditional-plugin ==0.9.0
- cryptography ==41.0.6
- httpx ==0.25.2
- mkdocs ==1.5.2
- mkdocs-material ==9.1.21
- mypy ==1.7.1
- pytest ==7.4.3
- pytest-mock ==3.11.1
- ruff ==0.1.6
- trustme ==1.1.0
- twine ==4.0.2
- types-click ==7.1.8
- types-pyyaml ==6.0.12.12
- watchgod ==0.8.2
- websockets ==12.0
- wsproto ==1.2.0