Bottle is a fast and simple micro-framework for small web applications. It offers request dispatching (Routes) with url parameter support, templates, a built-in HTTP Server and adapters for many third party WSGI/HTTP-server and template engines - all in a single file and with no dependencies other than the Python Standard Library. Homepage and documentation: http://bottlepy.org/ Copyright (c) 2016, Marcel Hellkamp. License: MIT (see LICENSE for details)
Class |
|
Adapter for Google App Engine. |
Class |
|
A stack-like list. Calling it returns the head of the stack. |
Class |
|
Untested. |
Class |
|
A wrapper for WSGI environment dictionaries that adds a lot of convenient access methods and properties. Most of them are read-only. |
Class |
|
Storage class for a response body as well as headers and cookies. |
Class |
|
Base class and minimal API for template adapters |
Class |
|
Fast server written in C: https://github.com/jonashaag/bjoern |
Class |
|
Each Bottle object represents a single, distinct web application and consists of routes, callbacks, plugins, resources and configuration. Instances are callable WSGI applications. |
Class | cached |
A property that is only computed once per instance and then replaces itself with an ordinary attribute. Deleting the attribute resets the property. |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
A dict-like configuration storage with additional support for namespaces, validators, meta-data, on_change listeners and more. |
Class |
|
Property that maps to a key in a local dict-like attribute. |
Class |
|
Untested. |
Class |
|
Untested |
Class |
|
Extremely fast webserver using libev. See https://github.com/william-os4y/fapws3 |
Class |
|
Interrupt main-thread as soon as a changed module file is detected, the lockfile gets deleted or gets to old. |
Class |
|
No class docstring; 1/1 property, 0/4 instance variable, 0/2 class variable, 3/4 methods documented |
Class |
|
Undocumented |
Class |
|
This :class:`MultiDict` subclass is used to store request form data. Additionally to the normal dict-like item access methods (which return unmodified data as native strings), this container also supports attribute-like access to its values... |
Class |
|
Untested. Options: |
Class |
|
Undocumented |
Class |
|
Untested. See http://gunicorn.org/configure.html for options. |
Class |
|
A case-insensitive version of :class:`MultiDict` that defaults to replace the old value instead of appending it. |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class | lazy |
A property that caches itself to the class object. |
Class |
|
A thread-local subclass of :class:`BaseRequest` with a different set of attributes for each thread. There is usually only one global instance of this class (:data:`request`). If accessed during a request/response cycle, this instance always refers to the *current* request (even on a multithreaded server)... |
Class |
|
A thread-local subclass of :class:`BaseResponse` with a different set of attributes for each thread. There is usually only one global instance of this class (:data:`response`). Its attributes are used to build the HTTP response at the end of the request/response cycle. |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
This dict stores multiple values per key, but behaves exactly like a normal dict in that it returns only the newest value for any given key. There are special methods available to access the full list of values. |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
This class manages a list of search paths and helps to find and open application-bound resources (files). |
Class |
|
Untested. |
Class |
|
This class wraps a route callback along with route specific metadata and configuration and applies Plugins on demand. It is also responsible for turing an URL path rule into a regular expression usable by the Router. |
Class |
|
A Router is an ordered collection of route->target pairs. It is used to efficiently match WSGI requests against a number of routes and return the first target that satisfies the request. The target may be anything, usually a string, ID or callable object... |
Class |
|
Undocumented |
Class |
|
No class docstring; 0/2 property, 0/4 instance variable, 1/5 method documented |
Class |
|
Parser for stpl templates. |
Class |
|
This plugin applies the :func:`view` decorator to all routes with a `template` config parameter. If the parameter is a tuple, the second element must be a dict with additional options (e.g. `template_engine`) or default variables for the template... |
Class |
|
The super hyped asynchronous server by facebook. Untested. |
Class |
|
Untested. |
Class |
|
Undocumented |
Class |
|
Undocumented |
Class |
|
This dict-like class wraps a WSGI environ dict and provides convenient access to HTTP_* fields. Keys and values are native strings (2.x bytes or 3.x unicode) and keys are case-insensitive. If the WSGI environment contains non-native string values, these are de- or encoded using a lossless 'latin1' character set. |
Class |
|
Undocumented |
Exception |
|
A base class for exceptions used by bottle. |
Exception |
|
Undocumented |
Exception |
|
Undocumented |
Exception |
|
Undocumented |
Exception |
|
The route could not be built. |
Exception |
|
This is a base class for all routing related exceptions |
Exception |
|
If raised by a plugin or request handler, the route is reset and all plugins are re-applied. |
Exception |
|
Undocumented |
Exception |
|
The route parser found something not supported by this router. |
Exception |
|
Undocumented |
Exception |
|
Undocumented |
Function | abort |
Aborts execution and causes a HTTP error. |
Function | auth |
Callback decorator to require HTTP auth (basic). TODO: Add route(check_auth=...) parameter. |
Function | cookie |
Verify and decode an encoded string. Return an object or None. |
Function | cookie |
Encode and sign a pickle-able object. Return a (byte) string |
Function | cookie |
Return True if the argument looks like a encoded cookie. |
Function | debug |
Change the debug level. There is only one debug level supported at the moment. |
Function | depr |
Undocumented |
Function | getargspec |
Undocumented |
Function | html |
Escape HTML special characters ``&<>`` and quotes ``'"``. |
Function | html |
Escape and quote a string to be used as an HTTP attribute. |
Function | http |
Undocumented |
Function | load |
Import a module or fetch an object from a module. |
Function | load |
Load a bottle application from a module and make sure that the import does not affect the current default application, but returns a separate application object. See :func:`load` for the target parameter... |
Function | local |
Undocumented |
Function | make |
Return a callable that relays calls to the current default app. |
Function | makelist |
Undocumented |
Function | parse |
Parse rfc2617 HTTP authentication header string (basic) and return (user,pass) tuple or None |
Function | parse |
Parse rfc1123, rfc850 and asctime timestamps and return UTC epoch. |
Function | parse |
Yield (start, end) ranges parsed from a HTTP Range header. Skip unsatisfiable ranges. The end index is non-inclusive. |
Function | path |
Shift path fragments from PATH_INFO to SCRIPT_NAME and vice versa. |
Function | redirect |
Aborts execution and causes a 303 or 302 redirect, depending on the HTTP protocol version. |
Function | run |
Start a server instance. This method blocks until the server terminates. |
Function | static |
Open a file in a safe way and return :exc:`HTTPResponse` with status code 200, 305, 403 or 404. The ``Content-Type``, ``Content-Encoding``, ``Content-Length`` and ``Last-Modified`` headers are set if possible... |
Function | template |
Get a rendered template as a string iterator. You can use a name, a filename or a template string as first parameter. Template rendering arguments can be passed as dictionaries or directly (as keyword arguments). |
Function | tob |
Undocumented |
Function | touni |
Undocumented |
Function | update |
Undocumented |
Function | view |
Decorator: renders a template for a handler. The handler can control its behavior like that: |
Function | yieldroutes |
Return a generator for routes that match the signature (name, args) of the func parameter. This may yield more than one route if the function takes optional keyword arguments. The output is best described by example::... |
Constant | DEBUG |
Undocumented |
Constant | ERROR |
Undocumented |
Constant | NORUN |
Undocumented |
Constant | TEMPLATE |
Undocumented |
Constant | TEMPLATES |
Undocumented |
Variable | __author__ |
Undocumented |
Variable | __license__ |
Undocumented |
Variable | __version__ |
Undocumented |
Variable | app |
Undocumented |
Variable | callable |
Undocumented |
Variable | cheetah |
Undocumented |
Variable | cheetah |
Undocumented |
Variable | default |
Undocumented |
Variable | delete |
Undocumented |
Variable | error |
Undocumented |
Variable | ext |
Undocumented |
Variable | get |
Undocumented |
Variable | hook |
Undocumented |
Variable | install |
Undocumented |
Variable | jinja2 |
Undocumented |
Variable | jinja2 |
Undocumented |
Variable | json |
Undocumented |
Variable | local |
Undocumented |
Variable | mako |
Undocumented |
Variable | mako |
Undocumented |
Variable | mount |
Undocumented |
Variable | post |
Undocumented |
Variable | put |
Undocumented |
Variable | py25 |
Undocumented |
Variable | py31 |
Undocumented |
Variable | py3k |
Undocumented |
Variable | request |
Undocumented |
Variable | response |
Undocumented |
Variable | route |
Undocumented |
Variable | server |
Undocumented |
Variable | tonat |
Undocumented |
Variable | uninstall |
Undocumented |
Variable | url |
Undocumented |
Variable | urlunquote |
Undocumented |
Class | _closeiter |
This only exists to be able to attach a .close method to iterators that do not support attribute assignment (most of itertools). |
Class | _ |
No class docstring; 0/3 instance variable, 1/3 method documented |
Function | _e |
Undocumented |
Function | _file |
Yield chunks from a range in a file. No chunk is bigger than maxread. |
Function | _hkey |
Undocumented |
Function | _hval |
Undocumented |
Function | _lscmp |
Compares two strings in a cryptographically safe way: Runtime is not affected by length of common prefix. |
Function | _parse |
Undocumented |
Function | _raise |
Undocumented |
Function | _re |
Turn all capturing groups in a regular expression pattern into non-capturing groups. |
Constant | _HTTP |
Undocumented |
Variable | _stderr |
Undocumented |
Variable | _stdout |
Undocumented |
Import a module or fetch an object from a module. * ``package.module`` returns `module` as a module object. * ``pack.mod:name`` returns the module variable `name` from `pack.mod`. * ``pack.mod:func()`` calls `pack.mod.func()` and returns the result. The last form accepts not only function calls, but any type of expression. Keyword arguments passed to this function are available as local variables. Example: ``import_string('re:compile(x)', x='[a-z]')``
Load a bottle application from a module and make sure that the import does not affect the current default application, but returns a separate application object. See :func:`load` for the target parameter.
Yield (start, end) ranges parsed from a HTTP Range header. Skip unsatisfiable ranges. The end index is non-inclusive.
Shift path fragments from PATH_INFO to SCRIPT_NAME and vice versa. :return: The modified paths. :param script_name: The SCRIPT_NAME path. :param script_name: The PATH_INFO path. :param shift: The number of path fragments to shift. May be negative to change the shift direction. (default: 1)
Start a server instance. This method blocks until the server terminates. :param app: WSGI application or target string supported by :func:`load_app`. (default: :func:`default_app`) :param server: Server adapter to use. See :data:`server_names` keys for valid names or pass a :class:`ServerAdapter` subclass. (default: `wsgiref`) :param host: Server address to bind to. Pass ``0.0.0.0`` to listens on all interfaces including the external one. (default: 127.0.0.1) :param port: Server port to bind to. Values below 1024 require root privileges. (default: 8080) :param reloader: Start auto-reloading server? (default: False) :param interval: Auto-reloader interval in seconds (default: 1) :param quiet: Suppress output to stdout and stderr? (default: False) :param options: Options passed to the server adapter.
Open a file in a safe way and return :exc:`HTTPResponse` with status code 200, 305, 403 or 404. The ``Content-Type``, ``Content-Encoding``, ``Content-Length`` and ``Last-Modified`` headers are set if possible. Special support for ``If-Modified-Since``, ``Range`` and ``HEAD`` requests. :param filename: Name or path of the file to send. :param root: Root path for file lookups. Should be an absolute directory path. :param mimetype: Defines the content-type header (default: guess from file extension) :param download: If True, ask the browser to open a `Save as...` dialog instead of opening the file with the associated program. You can specify a custom filename as a string. If not specified, the original filename is used (default: False). :param charset: The charset to use for files with a ``text/*`` mime-type. (default: UTF-8)
Get a rendered template as a string iterator. You can use a name, a filename or a template string as first parameter. Template rendering arguments can be passed as dictionaries or directly (as keyword arguments).
Decorator: renders a template for a handler. The handler can control its behavior like that: - return a dict of template vars to fill out the template - return something other than a dict and the view decorator will not process the template, but return the handler result as is. This includes returning a HTTPResponse(dict) to get, for instance, JSON with autojson or other castfilters.
Return a generator for routes that match the signature (name, args) of the func parameter. This may yield more than one route if the function takes optional keyword arguments. The output is best described by example:: a() -> '/a' b(x, y) -> '/b/<x>/<y>' c(x, y=5) -> '/c/<x>' and '/c/<x>/<y>' d(x=5, y=6) -> '/d' and '/d/<x>' and '/d/<x>/<y>'
Undocumented
Value |
|
Compares two strings in a cryptographically safe way: Runtime is not affected by length of common prefix.