klen / muffin

Muffin is a fast, simple and asyncronous web-framework for Python 3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

image

Muffin -- is a fast, lightweight and asyncronous ASGI web-framework for Python 3.

Tests Status

Documentation Status

PYPI Version

Python Versions


Features

Docs are available at https://klen.github.io/muffin/. Pull requests with documentation enhancements and/or fixes are awesome and most welcome.

Installation

We recommend using the latest version of Python. The library supports Python 3.8 and newer (PyPy-3.9+ are supported too).

Muffin should be installed using pip: :

pip install muffin

The command will install minimal configuration.

To install Muffin with gunicorn, uvicorn, uvloop, httptools use the command:

$ pip install muffin[standard]

Dependencies

These distributions will be installed automatically when installing Muffin.

Quickstart

Example "Hello User" with the Muffin:

What did that code do?

  1. First we imported the muffin.Application class. An instance of this class will be our application.
  2. Next we create an instance of this class.
  3. We then use the muffin.Application.route decorator to tell Muffin what URLs should trigger our handler function.
  4. The function returns the message we want to display in the user's browser.

Save the script as example.py and run it using Uvicorn (or another ASGI server): :

$ uvicorn example:app

Open http://localhost:8000, http://localhost:8000/hello/username in your browser. Enjoy!

Plugins overview

The list of some Muffin plugins (please make PR if you want to provide more):

Jinja2 templates (asyncio/trio/curio)

Tests Status

PYPI Version

Signed Cookie-Based HTTP sessions (asyncio/trio/curio)

Tests Status

PYPI Version

Work with OAuth (authorization, resources loading) (asyncio/trio/curio)

Tests Status

PYPI Version

Sentry integration (asyncio/trio/curio)

Tests Status

PYPI Version

Peewee support (SQL, ORM) (asyncio/trio/curio)

Tests Status

PYPI Version

Localization support (asyncio/trio/curio)

Tests Status

PYPI Version

Work with SQL databases (asyncio only)

Tests Status

PYPI Version

Work with Mongo DB (asyncio only)

Tests Status

PYPI Version

The package provides enhanced support for writing REST APIs (asyncio/trio/curio)

Tests Status

PYPI Version

Redis support

Tests Status

PYPI Version

Automatically build Admin UI

Tests Status

PYPI Version

Prometheus metrics exporter

Tests Status

PYPI Version

Benchmarks

You could find some tests here: http://klen.github.io/py-frameworks-bench/

Bug tracker

If you have any suggestions, bug reports or annoyances please report them to the issue tracker at https://github.com/klen/muffin/issues

Contributing

Development of The Muffin happens at: https://github.com/klen/muffin

Contributors

Muffin > 0.40 (completelly rewriten from scratch)

Muffin < 0.40 (based on AIOHTTP)

License

Licensed under a MIT license.

About

Muffin is a fast, simple and asyncronous web-framework for Python 3

License:MIT License


Languages

Language:Python 97.0%Language:Makefile 3.0%