Skip to main content

A modern Python web framework filled with asynchronous salsa.

Project description


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

Documentation / CLI / Twitter / Blog / Mentions / FAQ

Migrating from v0.13.x? Read the v0.14 release notes.

Bocadillo is a Python async web framework that makes server-side async web apps fun to build and accessible to everyone.

It is designed to be:

  • Productive: a carefully chosen set of included batteries helps you solve common and more advanced problems — request routing, app configuration, static files, data validation, and more!

  • Real-time capable: embrace asynchronous programming and the baked-in WebSocket and SSE support to build real-time, highly-concurrent systems.

  • Flexible: inject resources into web views using providers, an explicit, modular and easy-to-use mechanism inspired by pytest fixtures.

  • Performant: squeeze the juice out of Starlette and uvicorn, the lightning-fast ASGI toolkit and web server.

  • Empowering: use tailored testing and command line tools to build delicious, high-quality applications.

  • Transparent: every single feature is documented front to back and has optimal editor support thanks to a 100% type-annotated code base.

Quick start

We all love delicious "Hello, world!" examples, don't we? Here's ours:

  1. Install Bocadillo and the Bocadillo CLI:
pip install bocadillo bocadillo-cli
  1. Generate the project and cd into it:
bocadillo create hello
cd hello/
  1. Edit the application script:
# hello/app.py
from bocadillo import App

app = App()

@app.route("/")
async def index(req, res):
    res.text = "Hello, world!"
  1. Start a uvicorn server (hot reload enabled!):
uvicorn hello.asgi:app --reload
  1. Say hello!
$ curl http://localhost:8000
Hello, world!
  1. Edit app.py to send "Hello, Bocadillo!" instead, then hit save. Uvicorn will pick up the changes and restart the application. Try it out again:
$ curl http://localhost:8000
Hello, Bocadillo!

Tastes good! 🥪

Hungry for more? Head to the docs.

Changelog

We record changes to Bocadillo in the changelog. In particular, check out the Unreleased section to see what's coming in the next release.

Contributing

Found a bug? A typo? Want to help build a new feature? We'd love to see your contributions! There are also many ways to contribute that don't include code: helping with issues, laying out new ideas, improving docs, etc.

Check out our Contributing guide to get started.

By the way, here's our Contributor Hall of Fame. 👨‍💻👩‍💻

Credits

Logo designed by Florimond Manca. Sandwich icon designed by macrovector.

Project details


Download files

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

Source Distribution

bocadillo-0.14.1.tar.gz (45.1 kB view details)

Uploaded Source

Built Distribution

bocadillo-0.14.1-py3-none-any.whl (68.8 kB view details)

Uploaded Python 3

File details

Details for the file bocadillo-0.14.1.tar.gz.

File metadata

  • Download URL: bocadillo-0.14.1.tar.gz
  • Upload date:
  • Size: 45.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for bocadillo-0.14.1.tar.gz
Algorithm Hash digest
SHA256 198b3f26ca10115cc8373bb5816bf5cd5e3ca042e83525fb04072b7482a70892
MD5 2928dc0ef084df90206ea6f920610091
BLAKE2b-256 063671a7d497e6e82bc34c77b1a2f9a550c0910f8d5479b549da2e1619a0a8d9

See more details on using hashes here.

File details

Details for the file bocadillo-0.14.1-py3-none-any.whl.

File metadata

  • Download URL: bocadillo-0.14.1-py3-none-any.whl
  • Upload date:
  • Size: 68.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for bocadillo-0.14.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4b6974610725aaf55d22a4f39df218eefd5ff01b4887e8d9536cb0209eeb720d
MD5 e629483f96bceed5d23b5659bc15c32d
BLAKE2b-256 31651da612e8a93537e3c30e301eaf87dabb6044c5417ad9267d772245ff1f0f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page