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 | 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
payload_wtf-0.0.1.tar.gz
(2.0 kB
view details)
Built Distribution
File details
Details for the file payload_wtf-0.0.1.tar.gz
.
File metadata
- Download URL: payload_wtf-0.0.1.tar.gz
- Upload date:
- Size: 2.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25f3da4ac8f13e05bd6a865e99f6760cee944c431a94956cdd3865c124ab202b |
|
MD5 | b419c3d5974d3a7744b4d258ac34dedf |
|
BLAKE2b-256 | ef589bd4a9c3f659fca46bfc87e2d734baefefd3f1620a8a4d8ae526db3acf50 |
File details
Details for the file payload_wtf-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: payload_wtf-0.0.1-py3-none-any.whl
- Upload date:
- Size: 2.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77eed379ed27e3cc4b73d18a21418da09da8220f2ddcaa9bc382cc23391373ee |
|
MD5 | 9d89869132dce2975f8eb30fc4ce0707 |
|
BLAKE2b-256 | 93b741ade846bc0374485bfa35185315a7c4d7e0d3fd66ba6a8e5b8e67964329 |