Skip to main content

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

  • 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

Example usage

For example usage see test.py file in example folder.

Configuration

  1. RB_DEFAULT_ENCODE: (default: utf-8)

  2. RB_DEFAULT_DUMP_INDENT: (default: None)

  3. RB_BASE64_ALTCHARS: (default: None)

  4. RB_BASE64_CONTENT_TYPE: (default: text/plain)

  5. RB_HTML_DEFAULT_TEMPLATE: (default: None)

  6. RB_YAML_ALLOW_UNICODE: (default: True)

  7. RB_CSV_DEFAULT_NAME: (default: filename)

  8. RB_CSV_QUOTING: (default: False)

  9. RB_CSV_DELIMITER: (default: ;)

  10. RB_CSV_QUOTING_CHAR: (default: “)

  11. RB_CSV_DIALECT: (default: excel-tab)

  12. RB_XML_CDATA: (default: False)

  13. RB_XML_ROOT: (default: root)

  14. RB_DEFAULT_RESPONSE_FORMAT: (default: application/json)

License MIT

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

Flask-ResponseBuilder-1.0.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

Flask_ResponseBuilder-1.0.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file Flask-ResponseBuilder-1.0.0.tar.gz.

File metadata

  • Download URL: Flask-ResponseBuilder-1.0.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.5

File hashes

Hashes for Flask-ResponseBuilder-1.0.0.tar.gz
Algorithm Hash digest
SHA256 906034ae898bd0608f2806714f8c5a5a46516b5a3713861b4736f5e888625967
MD5 f64cfdf86db846ebf280bd0c712a0a48
BLAKE2b-256 3e1ebf704a7665c14715fca8bb87de2d88a467858868ef9574819ae5d10361e2

See more details on using hashes here.

File details

Details for the file Flask_ResponseBuilder-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: Flask_ResponseBuilder-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.5

File hashes

Hashes for Flask_ResponseBuilder-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 74d41ddad7d511a7782489c8eecbbe0cc14e8e37363927bab553165cb775874e
MD5 f2ecca8f77630c4d3f506f7c4669ffa5
BLAKE2b-256 4cb77154f47ceda06606610a0264424a127cd464f9fed5ddf66a4694f925b172

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