Skip to main content

sanic-base-extension

Flask-like extension support for Sanic framework

Features

  • Flask-like style initializing and using with Sanic applications

  • Easy to write a new extension and use it later

Installation

This package should be installed using pip:

pip install sanic-base-extension

Example

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(app)  # available via `app.custom` or `app.extensions['custom']`
app.ctx.custom.hello('world')  # Hello, world!

License

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

Metadata

Release files for sanic-base-extension 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sanic-base-extension 0.2.0
File Size Uploaded Provenance Actions
sanic-base-extension-0.2.0.tar.gz 3.3 kB Without provenance Details for sanic-base-extension-0.2.0.tar.gz

Release files / sanic-base-extension-0.2.0.tar.gz

Download URL sanic-base-extension-0.2.0.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
644665332be85932378bd57babe968bb92bd02d0963d1dee55d2a4b47e9127ec
BLAKE2b-256 checksum
How to use checksums
5796f5b2df0937b672a14b60b8c3c88c7114ed6ad3eb94976ff0dac498ae6d3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.5

Security for sanic-base-extension 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page