Build a simple REST API or web service without installing a large framework.
Add a small web interface to an existing Python script or tool with minimal setup.
Learn how web routing and HTTP request handling work in Python using a minimal, readable codebase.
Prototype a quick web endpoint that reads form data or query parameters and returns a response.
Bottle is a minimal Python web framework for building web applications and APIs. It is distributed as a single Python file with no external dependencies, meaning you can drop one file into a project directory and start using it immediately without installing anything beyond Python itself. The framework handles the fundamental tasks of a web server. You define URL routes by decorating Python functions, and Bottle calls those functions when a matching request arrives. URLs can include variable parts, so a single route like "/hello/<name>" will match any name and pass it to the function as an argument. Bottle also includes a built-in template engine for generating HTML, though it works with popular third-party engines like Jinja2 and Mako if you prefer those. Other built-in tools cover reading form data, handling file uploads, working with cookies, and accessing HTTP headers. For running the application, Bottle ships a simple development server sufficient for testing, and it supports connecting to production-grade WSGI servers like Gunicorn or CherryPy's Cheroot for real deployments. A working Hello World example is a handful of lines: import a couple of names, decorate a function with a route, and call run. The framework targets situations where a larger, more opinionated framework would be more than the project needs. It does not include a built-in database layer, admin panel, or authentication system. Installation is one pip command. The code and documentation are available under the MIT license.
← bottlepy on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.