Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

simple payload with an easy format for building Python APIs (like Django).

Project description

Payload WTF

simple payload with an easy format for building Python APIs (like Django). As an alternative that frees you to render responses without DRF or something that is full of rules.

Quick Example

You can use this package is easy:

payload = PayloadWTF()
payload.set_state(setter=PayloadWTF.SET_RESULT, data={"data": "Yes this is data from queryset"})
payload.set_state(setter=PayloadWTF.SET_LINKS, next="http://.../?page=1")
payload.set_state(setter=PayloadWTF.SET_META, data={'user_activated': {'username': 'yanzen'}})
print(payload.tojson()) # Or payload.todata() result is dictionary

Result:

{
    "results": {"data": "Yes this is data from queryset"},
    "meta": {"user_activated": {"username": "yanzen"}},
    "links": {"next": "http://.../?page=1", "prev": ""}
}

Project details


Release history Release notifications

This version

0.0.1

Download files

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

Files for payload-wtf, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size payload_wtf-0.0.1-py3-none-any.whl (2.5 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size payload_wtf-0.0.1.tar.gz (2.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page