Skip to main content

Flask-like extension support for Sanic framework

Project description

Flask-like extension support for Sanic framework


  • Flask-like style initializing and using with Sanic applications

  • Easy to write a new extension and use it later


This package should be installed using pip:

pip install sanic-base-extension


from sanic import Sanic
from sanic_base_ext import BaseExtension

class CustomExtension(BaseExtension):
    extension_name = app_attribute = 'custom'

    def hello(self, user):
        print("Hello, {}!".format(user))

app = Sanic(__name__)
CustomExtension()  # available via `app.custom` or `app.extensions['custom']`
app.custom.hello('world')  # Hello, world!


The sanic-base-extension is published under BSD license. For more details read LICENSE file.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Built Distribution

sanic_base_extension-0.1.0-py3-any.whl (3.7 kB view hashes)

Uploaded 0 1 0

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page