Skip to main content

No project description provided

Project description

EResponse

This is a simple package to form json response easily.

Usage

from eresponse import new_success_message, new_error_message

def example():
    try:
        res = {
            "key": 1
        }
        return new_success_message("Success text", test=res)
    except Exception as e:
        return new_error_message("Error text")

What it looks like in response

Success

{
  "ok": true,
  "message": "Success text",
  "test": {
    "key": 1
  }
}

Error

{
  "ok": false,
  "error": "Error text"
}

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eresponses-1.0.tar.gz (1.9 kB view hashes)

Uploaded Source

Built Distribution

eresponses-1.0-py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 3

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