57

GitHub - bocadilloproject/bocadillo: ? A modern Python web framework filled with...

 5 years ago
source link: https://github.com/bocadilloproject/bocadillo
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

README.md

banner.png?raw=true

A modern Python web framework filled with asynchronous salsa.


travis python downloads pypi black codecov license Join the chat at https://gitter.im/bocadilloproject/bocadillo

Bocadillo

Bocadillo is a Python web framework that provides a sane toolkit for quickly building performant web applications and services, while encouraging best practices and keeping developer experience in mind.

Under the hood, it uses the Starlette ASGI toolkit and the lightning-fast uvicorn ASGI server.

Read the documentation

Quick start

Install it:

pip install bocadillo

Build something:

# api.py
import bocadillo

api = bocadillo.API()

@api.route('/')
async def index(req, res):
    # Use a template from the ./templates directory 
    res.html = await api.template('index.html')

@api.route('/greet/{person}')
def greet(req, res, person):
    res.media = {'message': f'Hi, {person}!'}

if __name__ == '__main__':
    api.run()

Launch:

python api.py

Make requests!

curl http://localhost:8000/greet/Bocadillo
{"message": "Hi, Bocadillo!"}

Hungry for more? Head to the docs.

Contributing

See CONTRIBUTING for contribution guidelines.

Changelog

See CHANGELOG for a chronological log of changes to Bocadillo.

Roadmap

To see what has already been implemented for the next release, see the Unreleased section of our changelog.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK