Skip to main content

Django REST Framework Pipeline Views

Coverage Status Workflow Status PyPI Licence Last Commit Issues Downloads

Python Version Django Version

pip install drf-pipeline-views

Documentation: https://mrthearman.github.io/drf-pipeline-views/

Source Code: https://github.com/MrThearMan/drf-pipeline-views/


Inspired by a talk on The Clean Architecture in Python by Brandon Rhodes, drf-pipeline-views aims to simplify writing testable API endpoints with [Django REST framework][drf] using the Pipeline Design Pattern.

The main idea behind the pipeline pattern is to process data in steps. Input from the previous step is passed to the next, resulting in a collection of "data-in, data-out" -functions. These functions can be easily unit tested, since none of the functions depend on the state of the objects in the other parts of the pipeline. Furthermore, IO can be separated into its own step, making the other parts of the logic simpler and faster to test by not having to mock or do any other special setup around the IO. This also means that the IO block, or in fact any other part of the application, can be replaced as long as the data flowing through the pipeline remains the same.

from pipeline_views import BasePipelineView

from .my_serializers import InputSerializer, OutputSerializer
from .my_validators import validator
from .my_services import io_func, logging_func, integration_func


class SomeView(BasePipelineView):
    pipelines = {
        "GET": [
            InputSerializer,
            validator,
            io_func,
            integration_func,
            logging_func,
            OutputSerializer,
        ],
    }

Have a look at the quickstart section in the documentation on basic usage.

Metadata

Release files for drf-pipeline-views 0.9.2

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-pipeline-views 0.9.2
File Size Uploaded
drf_pipeline_views-0.9.2.tar.gz 11.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for drf-pipeline-views 0.9.2
File Interpreter ABI Platform
drf_pipeline_views-0.9.2-py3-none-any.whl Python 3 none any Details

Total release size: 22.5 kB

Release files / drf_pipeline_views-0.9.2.tar.gz

Download URL drf_pipeline_views-0.9.2.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ef94a334ae24ec05e5118fd6f5380a8b15bba58bd08bb45ec1d56543e078c17e
BLAKE2b-256 checksum
How to use checksums
ad8ea48cd76bff5e9f71dba10cdae999fb18e91a60743578365dfb65e763aca4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.0 CPython/3.13.2 Linux/6.8.0-1021-azure

Release files / drf_pipeline_views-0.9.2-py3-none-any.whl

Download URL drf_pipeline_views-0.9.2-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
438f68a43b9935385c1a25a61fcf39fc444f0a35e4ba6c55b0c503c631d8b2e6
BLAKE2b-256 checksum
How to use checksums
42bbb938d60e4ed5bd99b7c91c92d01a6dbfeaebeda6621955b1e43a73d9764a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.0 CPython/3.13.2 Linux/6.8.0-1021-azure

Release history Release notifications | RSS feed

This release

0.9.2 This release

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.5

2 release files

0.8.4

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.6

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.8

2 release files

0.5.7

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

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