Skip to main content

Brisk

The fast ASGI framework


Repository

Table of Contents

  1. Usage
  2. Documentation

Usage

Install using pip: pip install brisk-py

Basic Example:
from brisk_py import brisk
app = brisk.App()

# simple routing
@app.get('/')
def route(request):
    return '<h1>Hello World</h1>'
# render html file
@app.get('/')
def route(request):
    return brisk.html('index.html')
Create an api
from brisk_py import brisk 
app = brisk.App()

users = {'users': [{'user': 'John Doe', 'age': 34}, {'user': 'Jane Doe', 'age': 37}]}

@app.get('/users')
def route(request):
    return users

@app.get('/user')
def route(request):
    user = request.body.get('user')
    if user:
        return users.get(user, {'message': 'user not found'})
    else:
        return {'message': 'no user provided'}

@app.post('/users')
def route(request):
    user = request.body.get('user')
    age = request.body.get('age')

    if age and user:
        users.append({'user': user, 'age': age})
        return {'message': 'success'}
    else:
        return {'message': 'error'}
Run Python in HTML
# main.py
from brisk_py import brisk 
app = brisk.App()

@app.get('/')
def route(request):
    fav_things = ['raindrops on roses', 'whiskers on kittens', 'bright copper kettles', 'warm woolen mittens']
    return html('index.html', fav_things=fav_things)

Documentation

TBD

Metadata

Release files for Brisk-py 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 Brisk-py 0.2.0
File Size Uploaded
Brisk-py-0.2.0.tar.gz 6.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Brisk-py 0.2.0
File Interpreter ABI Platform
Brisk_py-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.7 kB

Release files / Brisk-py-0.2.0.tar.gz

Download URL Brisk-py-0.2.0.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
461f213cfc9da88307d208d6abc35dba87f5b2876660cd7d7f489d940767b2a6
BLAKE2b-256 checksum
How to use checksums
5b9bf5d70768d6414cb9761a5ae95e84965b1811f0fcd7fa9255e699aad2d120
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

Release files / Brisk_py-0.2.0-py3-none-any.whl

Download URL Brisk_py-0.2.0-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
672b64ec9deabe60c9cff01ab1707d148d873d4a0deb7ecebb1076efc2e831e6
BLAKE2b-256 checksum
How to use checksums
ee4dfc704170320a4df9f3bec24790abac1cd1702992cede482b5f631e033302
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

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