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 201 CREATED
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 in example folder.
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)
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.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 064c5a0a3255dcc2f2a234009258b17389941ec255e5890ff6951ce1c1607266 |
|
MD5 | e25789a0b5e59b6e267d9cc3278ac794 |
|
BLAKE2b-256 | aebeee76cbb0400d8921866758f66275284945224f9e29627cf866c3283828f0 |
Hashes for Flask_ResponseBuilder-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddd95e0e8de1c6bff1f08558ee71515b086a30b06b1fc5140648887b9560c214 |
|
MD5 | 0f38a48accc219324c32c96c7acbb08c |
|
BLAKE2b-256 | 3f9a0224a250cd870d71b9efe2bc6d29d4873056a6d919f6c22fd8ee5b752b5a |