All Projects → aio-libs → Aiohttp

aio-libs / Aiohttp

Licence: other
Asynchronous HTTP client/server framework for asyncio and Python

Programming Languages

python
139335 projects - #7 most used programming language
cython
566 projects
Makefile
30231 projects
Gherkin
971 projects
Dockerfile
14818 projects
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Aiohttp

stream video server
demonstrates how to create video streaming server with the help of aiohttp and opencv
Stars: ✭ 15 (-99.87%)
Mutual labels:  aiohttp, http-server, asyncio
Kubernetes asyncio
Python asynchronous client library for Kubernetes http://kubernetes.io/
Stars: ✭ 147 (-98.77%)
Mutual labels:  async, asyncio, aiohttp
Python Simple Rest Client
Simple REST client for python 3.6+
Stars: ✭ 143 (-98.81%)
Mutual labels:  asyncio, aiohttp, http-client
Fooproxy
稳健高效的评分制-针对性- IP代理池 + API服务,可以自己插入采集器进行代理IP的爬取,针对你的爬虫的一个或多个目标网站分别生成有效的IP代理数据库,支持MongoDB 4.0 使用 Python3.7(Scored IP proxy pool ,customise proxy data crawler can be added anytime)
Stars: ✭ 195 (-98.37%)
Mutual labels:  async, asyncio, aiohttp
waspy
WASP framework for Python
Stars: ✭ 43 (-99.64%)
Mutual labels:  http-client, http-server, asyncio
Arsenic
Async WebDriver implementation for asyncio and asyncio-compatible frameworks
Stars: ✭ 209 (-98.25%)
Mutual labels:  async, asyncio, aiohttp
Http Kit
http-kit is a minimalist, event-driven, high-performance Clojure HTTP server/client library with WebSocket and asynchronous support
Stars: ✭ 2,234 (-81.34%)
Mutual labels:  async, http-client, http-server
aiohttp-json-rpc
Implements JSON-RPC 2.0 using aiohttp
Stars: ✭ 54 (-99.55%)
Mutual labels:  http-client, aiohttp, http-server
Chili
Chili: HTTP Served Hot
Stars: ✭ 7 (-99.94%)
Mutual labels:  async, asyncio, http-server
Meinheld
Meinheld is a high performance asynchronous WSGI Web Server (based on picoev)
Stars: ✭ 1,339 (-88.82%)
Mutual labels:  async, http-server
Ruia
Async Python 3.6+ web scraping micro-framework based on asyncio
Stars: ✭ 1,366 (-88.59%)
Mutual labels:  asyncio, aiohttp
Fastapi Plugins
FastAPI framework plugins
Stars: ✭ 104 (-99.13%)
Mutual labels:  async, asyncio
Backendschool2019
Приложение для практического руководства по разработке бекенд-сервисов на Python (на основе вступительного испытания в Школу бэкенд‑разработки Яндекса)
Stars: ✭ 129 (-98.92%)
Mutual labels:  asyncio, aiohttp
Rororo
Implement aiohttp.web OpenAPI 3 server applications with schema first approach.
Stars: ✭ 95 (-99.21%)
Mutual labels:  asyncio, aiohttp
Aioauth
Asynchronous OAuth 2.0 framework and provider for Python 3
Stars: ✭ 102 (-99.15%)
Mutual labels:  asyncio, aiohttp
Raven Aiohttp
An aiohttp transport for raven-python
Stars: ✭ 92 (-99.23%)
Mutual labels:  asyncio, aiohttp
Snug
Write reusable web API interactions
Stars: ✭ 108 (-99.1%)
Mutual labels:  async, http-client
Aiometer
A Python concurrency scheduling library, compatible with asyncio and trio.
Stars: ✭ 110 (-99.08%)
Mutual labels:  async, asyncio
Igropyr
a async http server base on libuv for Chez Scheme
Stars: ✭ 85 (-99.29%)
Mutual labels:  async, http-server
Sockjs
SockJS Server
Stars: ✭ 105 (-99.12%)
Mutual labels:  asyncio, aiohttp

Async http client/server framework

aiohttp logo


GitHub Actions status for master branch codecov.io status for master branch Latest PyPI package version Downloads count Latest Read The Docs Discourse status Chat on Gitter

Key Features

  • Supports both client and server side of HTTP protocol.
  • Supports both client and server Web-Sockets out-of-the-box and avoids Callback Hell.
  • Provides Web-server with middlewares and plugable routing.

Getting started

Client

To get something from the web:

import aiohttp
import asyncio

async def main():

    async with aiohttp.ClientSession() as session:
        async with session.get('http://python.org') as response:

            print("Status:", response.status)
            print("Content-type:", response.headers['content-type'])

            html = await response.text()
            print("Body:", html[:15], "...")

loop = asyncio.get_event_loop()
loop.run_until_complete(main())

This prints:

Status: 200
Content-type: text/html; charset=utf-8
Body: <!doctype html> ...

Coming from requests ? Read why we need so many lines.

Server

An example using a simple server:

# examples/server_simple.py
from aiohttp import web

async def handle(request):
    name = request.match_info.get('name', "Anonymous")
    text = "Hello, " + name
    return web.Response(text=text)

async def wshandle(request):
    ws = web.WebSocketResponse()
    await ws.prepare(request)

    async for msg in ws:
        if msg.type == web.WSMsgType.text:
            await ws.send_str("Hello, {}".format(msg.data))
        elif msg.type == web.WSMsgType.binary:
            await ws.send_bytes(msg.data)
        elif msg.type == web.WSMsgType.close:
            break

    return ws


app = web.Application()
app.add_routes([web.get('/', handle),
                web.get('/echo', wshandle),
                web.get('/{name}', handle)])

if __name__ == '__main__':
    web.run_app(app)

Documentation

https://aiohttp.readthedocs.io/

Demos

https://github.com/aio-libs/aiohttp-demos

External links

Feel free to make a Pull Request for adding your link to these pages!

Communication channels

aio-libs discourse group: https://aio-libs.discourse.group

gitter chat https://gitter.im/aio-libs/Lobby

We support Stack Overflow. Please add aiohttp tag to your question there.

Requirements

Optionally you may install the cChardet and aiodns libraries (highly recommended for sake of speed).

License

aiohttp is offered under the Apache 2 license.

Keepsafe

The aiohttp community would like to thank Keepsafe (https://www.getkeepsafe.com) for its support in the early days of the project.

Source code

The latest developer version is available in a GitHub repository: https://github.com/aio-libs/aiohttp

Benchmarks

If you are interested in efficiency, the AsyncIO community maintains a list of benchmarks on the official wiki: https://github.com/python/asyncio/wiki/Benchmarks

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].