lightweight web framework
Project description
fly
fly is lightweight web application framework. This is a library with Python, but all the core parts of the server are implemented in C language to speed up.
-
Event driven architecture. (non-blocking network I/O)
-
Usable as Web server and Application server.
-
Lightweight and fast.
-
Since fly as a server by itself, there is no need to prepare a WSGI server or ASGI server.
fly currently supports the following platforms.
Python | Linux | macOS | FreeBSD |
---|---|---|---|
3.6 | - | ||
3.7 | |||
3.8 | |||
3.9 | |||
3.10 |
Install
$ pip install fly-server
Hello World
It is so easy to use fly.
-
import fly and make fly instance.
-
mount directory and registery route.(option)
-
run fly.
from fly import Fly
app = Fly()
@app.get("/")
def index(request):
return "Hello, fly!"
$ fly app.py
Result
* fly Running on 0.0.0.0:1234 (Press CTRL+C to quit)
* fly 1 workers
* Application file: /home/user/app.py
* Log to stdout: on
* Log to stderr: off
* Backlog count: 1024
* Max response content length: 1048576
* Max request content length: 1048576
* Index path: index.html
* SSL: False
* Log directory path: -
* Mount paths (/home/user/mnt,/home/user/mnt2)
- /home/user/mnt: files 2, mount_number 0
- /home/user/mnt2: files 0, mount_number 1
mount vs route
-
mount: use for static content(css, html, js)
-
route: use for dynamic content(like CGI)
Why fly ?
Interface of fly is as simple as possible. Extracted only the necessary parts as Web framework by referring to various Python web frameworks.
But, a core part of fly is implemented by C language, you can't think of it as Python Web framework.
So, if you're looking for flexible and fast Web framework, should use fly.
How fast ?
look at the result of benchmark.
HTTP version
HTTP1.1, HTTP1.1 over TLS/SSL, HTTP2 over TLS/SSL.
Contributing
Let's coding.
- Fork fly.
- Create a feature branch. (git checkout -b
new-feature
) - Commit your changes. (git commit -m
explain of commit
) - Push to the bench. (git push origin my-new-feature)
- Create new pull request.
Dependencies
-
Python >= 3.6
-
Openssl >= 1.1.11
-
Zlib >= 1.2.11
-
libbrotli(Optional) >= 1.0.9
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file fly-server-1.4.0.tar.gz
.
File metadata
- Download URL: fly-server-1.4.0.tar.gz
- Upload date:
- Size: 3.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0+
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58caffddd8f1eba001cdaebf52e04f1861b5d3f180d53a4140e26a9b26c41e34 |
|
MD5 | 4385cf8f8bc32fc10ddfd06fd6420fd8 |
|
BLAKE2b-256 | 53f22e82c8df0105d0084f9592711c76b4c038e73879d3851fb8089e624818ca |