Skip to main content

PyPI version Travis CI Coverage Status Code Health Python Versions Implementation

Quick start

examples:

curl -X POST \
  http://127.0.0.1:8000/batch/ \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -d '{"batch": [
    {
        "method": "get",
        "relative_url": "/test/",
        "name": "yolo"
    },
    {
        "method": "post",
        "relative_url": "/test/?id={result=yolo:$.id}&ids={result=yolo:$.data.*.id}",
        "body": {"data": {"id": "{result=yolo:$.id}", "ids": "{result=yolo:$.data.*.id}"}, "test": "yolo"}
    },
    {
        "method": "post",
        "relative_url": "/test/",
        "body": "{\"data\": 42}",
        "omit_response_on_success": true
    },
    {
        "method": "options",
        "relative_url": "/test/"
    }
]
}'

using file uploading

curl -X POST \
  http://127.0.0.1:8000/batch/ \
  -H 'cache-control: no-cache' \
  -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
  -F 'batch=[
    {
        "method": "get",
        "relative_url": "/test/",
        "name": "yolo"
    },
    {
        "method": "post",
        "relative_url": "/test/?id={result=yolo:$.id}&ids={result=yolo:$.data.*.id}",
        "body": {"data": "{result=yolo:$.data.*.id}", "test": "yolo"},
        "attached_files":{"file": "a.jpg"}
    },
    {
        "method": "post",
        "relative_url": "/test/",
        "body": "{\"data\": 42}",
        "omit_response_on_success": true,
        "attached_files":["a.jpg", "b.png"]
    },
    {
        "method": "options",
        "relative_url": "/test/"
    }
]' \
  -F b.png=@2476.png \
  -F a.jpg=@check_133.pdf

Future features:

  • add support for requests pipelining. use responses as arguments to next requests (done)

  • build graph based on requests dependencies & run simultaneously independent.

  • [STRIKEOUT:switchable atomic support. true - all fails if something wrong. else - fail only dependent (can be very hard to support on front-end side, but for now seems as good feature)] run all requests in single transaction. (done)

  • [STRIKEOUT:use native django. we don’t use complicated things that require drf for work. all can be done with “naked” django.] (since we validate requests with drf serializers, it’s better to leave as it is).

  • support files uploading (done)

Dependencies:

  • Django starting from 2.2

  • Django rest framework

Metadata

Release files for drf-batch-requests 0.9.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for drf-batch-requests 0.9.5
File Size Uploaded
drf-batch-requests-0.9.5.tar.gz 31.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for drf-batch-requests 0.9.5
File Interpreter ABI Platform
drf_batch_requests-0.9.5-py3-none-any.whl Python 3 none any Details

Total release size: 108.0 kB

Release files / drf-batch-requests-0.9.5.tar.gz

Download URL drf-batch-requests-0.9.5.tar.gz
Size 31.8 kB
Tags Source
SHA-256 checksum
How to use checksums
15549cf7ed280923cd7db1eb13be99ca58c20f4bdf9b967811b0f4e9a3ca45be
BLAKE2b-256 checksum
How to use checksums
9c1b481afe804cdaeff9d219ab015e590003359280b9036d1e58c5007b5cf5a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.9

Release files / drf_batch_requests-0.9.5-py3-none-any.whl

Download URL drf_batch_requests-0.9.5-py3-none-any.whl
Size 76.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8f4324abab4575a88163c63a878218599ac02d88cafb7122463d5527164c1353
BLAKE2b-256 checksum
How to use checksums
5c7294428a198cfc7a0928ca4f0692507ae2e96e91102e8ffe74a839b03b6a92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.9

Release history Release notifications | RSS feed

This release

0.9.5 This release

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.10

2 release files

0.8.9

2 release files

0.8.8

2 release files

0.8.6

2 release files

0.8.5

2 release files

0.8.4

2 release files

0.8.3

1 release file

0.8.2

1 release file

0.8.1

1 release file

0.8.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page