All Projects → hivesolutions → Netius

hivesolutions / Netius

Licence: apache-2.0
Readable, simple and fast asynchronous non-blocking network apps

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Netius

hypercorn-fastapi-docker
Docker image with Hypercorn for FastAPI apps in Python 3.7, 3.8, 3.9. Ready for HTTP2 and HTTPS
Stars: ✭ 18 (-84.21%)
Mutual labels:  http2, asyncio, wsgi
Hypercorn
Official mirror of https://gitlab.com/pgjones/hypercorn https://pgjones.gitlab.io/hypercorn/
Stars: ✭ 193 (+69.3%)
Mutual labels:  asyncio, http2
Pulsar
Event driven concurrent framework for Python
Stars: ✭ 1,867 (+1537.72%)
Mutual labels:  asyncio, wsgi
Python Proxy
HTTP/HTTP2/HTTP3/Socks4/Socks5/Shadowsocks/ShadowsocksR/SSH/Redirect/Pf TCP/UDP asynchronous tunnel proxy implemented in Python 3 asyncio.
Stars: ✭ 692 (+507.02%)
Mutual labels:  asyncio, http2
Ruffles
Lightweight and fully managed reliable UDP library.
Stars: ✭ 131 (+14.91%)
Mutual labels:  library, net
Pytask Io
Python Async Task Queue
Stars: ✭ 81 (-28.95%)
Mutual labels:  asyncio, wsgi
Paco
Small utility library for coroutine-driven asynchronous generic programming in Python 3.4+
Stars: ✭ 198 (+73.68%)
Mutual labels:  asyncio, library
Androidlibs
🔥正在成为史上最全分类 Android 开源大全~~~~(长期更新 Star 一下吧)
Stars: ✭ 7,148 (+6170.18%)
Mutual labels:  library, net
Aiodine
🧪 Async-first Python dependency injection library
Stars: ✭ 51 (-55.26%)
Mutual labels:  asyncio, library
Siler
⚡ Flat-files and plain-old PHP functions rockin'on as a set of general purpose high-level abstractions.
Stars: ✭ 1,056 (+826.32%)
Mutual labels:  library, http2
Cdnjs
🤖 CDN assets - The #1 free and open source CDN built to make life easier for developers.
Stars: ✭ 9,270 (+8031.58%)
Mutual labels:  library, http2
Neatinput
A .NET standard project which aims to make keyboard and mouse input monitoring easy on Windows and eventually Linux.
Stars: ✭ 89 (-21.93%)
Mutual labels:  library, net
Inapppy
Python In-app purchase validator for Apple AppStore and GooglePlay.
Stars: ✭ 110 (-3.51%)
Mutual labels:  asyncio, library
Bloc.js
A predictable state management library that helps implement the BLoC design pattern in JavaScript
Stars: ✭ 111 (-2.63%)
Mutual labels:  library
Imagelistview
A .NET listview control for image files with asynchronously loaded thumbnails.
Stars: ✭ 113 (-0.88%)
Mutual labels:  net
React Native Tcp Socket
React Native TCP socket API for Android, iOS & macOS with client SSL/TLS support
Stars: ✭ 112 (-1.75%)
Mutual labels:  net
Deepcopy.js
deep copy data
Stars: ✭ 112 (-1.75%)
Mutual labels:  library
Aiofiles
File support for asyncio
Stars: ✭ 1,748 (+1433.33%)
Mutual labels:  asyncio
Tls Channel
A Java library that implements a ByteChannel interface over SSLEngine, enabling easy-to-use (socket-like) TLS for Java applications.
Stars: ✭ 113 (-0.88%)
Mutual labels:  library
Colibri Core
Colibri core is an NLP tool as well as a C++ and Python library for working with basic linguistic constructions such as n-grams and skipgrams (i.e patterns with one or more gaps, either of fixed or dynamic size) in a quick and memory-efficient way. At the core is the tool ``colibri-patternmodeller`` whi ch allows you to build, view, manipulate and query pattern models.
Stars: ✭ 112 (-1.75%)
Mutual labels:  library

Netius

Fast and readable async non-blocking network apps

Netius is a Python network library that can be used for the rapid creation of asynchronous non-blocking servers and clients. It has no dependencies, it's cross-platform, and brings some sample netius-powered servers out of the box, namely a production-ready WSGI server.

Simplicity and performance are the main drivers of this project. The codebase adheres to very strict code standards, and is extensively commented; and as far as performance is concerned, it aims to be up to par with equivalent native implementations, where PyPy can be used to provide the extra boost to raise performance up to these standards.

Bear in mind that although netius is non-blocking, it will naturally still block if the operations performed within the event loop are blocking, like reading or writing a file, which are both blocking operations in the Python standard library. Running multiple netius instances in parallel, and having a fast server like NGINX act as their reverse proxy, is one way of minimising the perceptibility of such blockages.

Installation

pip install netius

Or download the source from GitHub.

Netius has no dependencies, and is therefore cross-platform. It's compatible with PyPy, with which it benefits of performance increases up to 1.5x - 2.5x faster in most environments, when compared with running it with the cPython interpreter.

Usage

WSGI Server

import netius.servers

def app(environ, start_response):
    status = "200 OK"
    contents = "Hello World"
    content_l = len(contents)
    headers = (
        ("Content-Length", content_l),
        ("Content-Type", "text/plain"),
        ("Connection", "keep-alive")
    )
    start_response(status, headers)
    yield contents

server = netius.servers.WSGIServer(app = app)
server.serve(port = 8080)

HTTP Client

Synchronous usage

import netius.clients
result = netius.clients.HTTPClient.get_s(
    "http://www.flickr.com/",
    asynchronous = False
)
print(result["data"])

Asynchronous usage

import netius.clients

def on_partial(client, parser, data):
    print(data)

def on_message(client, parser, message):
    netius.clients.HTTPClient.cleanup_s()

netius.clients.HTTPClient.get_s(
    "http://www.flickr.com/",
    callback = on_message,
    on_data = on_partial
)

Test servers

The servers that come with netius out-of-the-box, can be tested through the command line:

Class Example
WSGIServer python -m netius.servers.wsgi
FTPServer python -m netius.servers.ftp
HelloServer MESSAGE="Hello Netius" python -m netius.extra.hello
FileServer BASE_PATH=/ python -m netius.extra.file
SMTPServer python -m netius.servers.smtp
RelaySMTPServer python -m netius.extra.smtp_r

Learn more

Basic

Advanced topics

More information can be found in the Advanced Topics page.

License

Netius is currently licensed under the Apache License, Version 2.0.

Build Automation

Build Status Build Status GitHub Coverage Status PyPi Status License

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].