Implementations of flask response in many formats
Project description
Implementations of flask response in many formats: base64, csv, json, xml, html, yaml.
Based on PyYAML, xmltodict, dicttoxml. See their documentation for other options.
Decorator for http response status 204 NO_CONTENT
Response based on Accept header of request
Response based on format parameter (query string)
template_or_json: response based on xhr request
Support for case notation checker and converter. See Case class
Quickstart
Install flask_response_builder using pip:
$ pip install Flask-ResponseBuilder
Then import it into your project:
$ from flask_response_builder import FlaskResponseBuilder
Example usage
For example usage see test.py file.
Configuration
RB_DEFAULT_RESPONSE_FORMAT: (default: application/json)
RB_DEFAULT_ENCODE: (default: utf-8)
RB_DEFAULT_DUMP_INDENT: (default: None)
RB_BASE64_ALTCHARS: (default: None)
RB_HTML_DEFAULT_TEMPLATE: (default: None)
RB_YAML_ALLOW_UNICODE: (default: True)
RB_CSV_DEFAULT_NAME: (default: filename)
RB_CSV_QUOTING: (default: False)
RB_CSV_DELIMITER: (default: ;)
RB_CSV_QUOTING_CHAR: (default: “)
RB_CSV_DIALECT: (default: excel-tab)
RB_XML_CDATA: (default: False)
RB_XML_ROOT: (default: ROOT)
RB_FLATTEN_PREFIX: (default: ‘’)
RB_FLATTEN_SEPARATOR: (default: ‘_’)
License MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for Flask-ResponseBuilder-1.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01f687b367a5ef383c3d69af6390c274a349f50f46fba7f5be55aab2517ec5ff |
|
MD5 | 26fb5c366dba15f43818f2acd9e2b54f |
|
BLAKE2b-256 | 9486d2957d64b56ffa7eaea6395ac672db099ff594796d513313c148dcc628fa |
Hashes for Flask_ResponseBuilder-1.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 078dfe376b8d417ceba21ecc83635955f4433f5fc4959d1098f57b8ff40727c3 |
|
MD5 | dd0aca735239d79ca476d680b550effd |
|
BLAKE2b-256 | b13f8ef7b7b4393a80838cf2af09133e7749104b6c2d8d2d4d9fc7879e58eeb5 |