drf-pipeline-views


Namedrf-pipeline-views JSON
Version 0.9.1 PyPI version JSON
download
home_pagehttps://github.com/MrThearMan/drf-pipeline-views
SummaryDjango REST framework views using the pipeline pattern.
upload_time2023-07-21 13:14:47
maintainer
docs_urlNone
authorMatti Lamppu
requires_python>=3.9,<4
licenseMIT
keywords django djangorestframework drf pipeline views
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Django REST Framework Pipeline Views

[![Coverage Status][coverage-badge]][coverage]
[![Workflow Status][status-badge]][status]
[![PyPI][pypi-badge]][pypi]
[![Licence][licence-badge]][licence]
[![Last Commit][commit-badge]][repo]
[![Issues][issues-badge]][issues]
[![Downloads][downloads-badge]][pypi]

[![Python Version][version-badge]][pypi]
[![Django Version][django-badge]][pypi]
[![DRF Version][drf-badge]][pypi]

```shell
pip install drf-pipeline-views
```

---

**Documentation**: [https://mrthearman.github.io/drf-pipeline-views/](https://mrthearman.github.io/drf-pipeline-views/)

**Source Code**: [https://github.com/MrThearMan/drf-pipeline-views/](https://github.com/MrThearMan/drf-pipeline-views/)

---

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

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.

```python
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][quickstart] section in the documentation on basic usage.

[clean]: https://archive.org/details/pyvideo_2840___The_Clean_Architecture_in_Python
[drf]: https://www.django-rest-framework.org/
[pipeline]: https://java-design-patterns.com/patterns/pipeline/
[quickstart]: https://mrthearman.github.io/drf-pipeline-views/quickstart

[coverage-badge]: https://coveralls.io/repos/github/MrThearMan/drf-pipeline-views/badge.svg?branch=main
[status-badge]: https://img.shields.io/github/actions/workflow/status/MrThearMan/drf-pipeline-views/test.yml?branch=main
[pypi-badge]: https://img.shields.io/pypi/v/drf-pipeline-views
[licence-badge]: https://img.shields.io/github/license/MrThearMan/drf-pipeline-views
[commit-badge]: https://img.shields.io/github/last-commit/MrThearMan/drf-pipeline-views
[issues-badge]: https://img.shields.io/github/issues-raw/MrThearMan/drf-pipeline-views
[version-badge]: https://img.shields.io/pypi/pyversions/drf-pipeline-views
[downloads-badge]: https://img.shields.io/pypi/dm/drf-pipeline-views
[django-badge]: https://img.shields.io/pypi/djversions/drf-pipeline-views
[drf-badge]: https://img.shields.io/badge/drf%20versions-3.12%20%7C%203.13%20%7C%203.14-blue

[coverage]: https://coveralls.io/github/MrThearMan/drf-pipeline-views?branch=main
[status]: https://github.com/MrThearMan/drf-pipeline-views/actions/workflows/test.yml
[pypi]: https://pypi.org/project/drf-pipeline-views
[licence]: https://github.com/MrThearMan/drf-pipeline-views/blob/main/LICENSE
[repo]: https://github.com/MrThearMan/drf-pipeline-views/commits/main
[issues]: https://github.com/MrThearMan/drf-pipeline-views/issues
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/MrThearMan/drf-pipeline-views",
    "name": "drf-pipeline-views",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<4",
    "maintainer_email": "",
    "keywords": "django,djangorestframework,drf,pipeline,views",
    "author": "Matti Lamppu",
    "author_email": "lamppu.matti.akseli@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/7b/4b/1e4462fcec7ade5f39837cce6bcfedfc48c978c35f4a8ebd60b79f566898/drf_pipeline_views-0.9.1.tar.gz",
    "platform": null,
    "description": "# Django REST Framework Pipeline Views\n\n[![Coverage Status][coverage-badge]][coverage]\n[![Workflow Status][status-badge]][status]\n[![PyPI][pypi-badge]][pypi]\n[![Licence][licence-badge]][licence]\n[![Last Commit][commit-badge]][repo]\n[![Issues][issues-badge]][issues]\n[![Downloads][downloads-badge]][pypi]\n\n[![Python Version][version-badge]][pypi]\n[![Django Version][django-badge]][pypi]\n[![DRF Version][drf-badge]][pypi]\n\n```shell\npip install drf-pipeline-views\n```\n\n---\n\n**Documentation**: [https://mrthearman.github.io/drf-pipeline-views/](https://mrthearman.github.io/drf-pipeline-views/)\n\n**Source Code**: [https://github.com/MrThearMan/drf-pipeline-views/](https://github.com/MrThearMan/drf-pipeline-views/)\n\n---\n\nInspired by a talk on [The Clean Architecture in Python][clean] by Brandon Rhodes,\n**drf-pipeline-views** aims to simplify writing testable API endpoints with\n[Django REST framework][drf] using the *[Pipeline Design Pattern][pipeline]*.\n\nThe main idea behind the pipeline pattern is to process data in steps. Input from the previous step\nis passed to the next, resulting in a collection of \"_data-in, data-out_\" -functions. These functions\ncan be easily unit tested, since none of the functions depend on the state of the objects in the other parts\nof the pipeline. Furthermore, IO can be separated into its own step, making the other parts of the\nlogic simpler and faster to test by not having to mock or do any other special setup around the IO.\nThis also means that the IO block, or in fact any other part of the application, can be replaced as long as the\ndata flowing through the pipeline remains the same.\n\n```python\nfrom pipeline_views import BasePipelineView\n\nfrom .my_serializers import InputSerializer, OutputSerializer\nfrom .my_validators import validator\nfrom .my_services import io_func, logging_func, integration_func\n\n\nclass SomeView(BasePipelineView):\n    pipelines = {\n        \"GET\": [\n            InputSerializer,\n            validator,\n            io_func,\n            integration_func,\n            logging_func,\n            OutputSerializer,\n        ],\n    }\n```\n\nHave a look at the [quickstart][quickstart] section in the documentation on basic usage.\n\n[clean]: https://archive.org/details/pyvideo_2840___The_Clean_Architecture_in_Python\n[drf]: https://www.django-rest-framework.org/\n[pipeline]: https://java-design-patterns.com/patterns/pipeline/\n[quickstart]: https://mrthearman.github.io/drf-pipeline-views/quickstart\n\n[coverage-badge]: https://coveralls.io/repos/github/MrThearMan/drf-pipeline-views/badge.svg?branch=main\n[status-badge]: https://img.shields.io/github/actions/workflow/status/MrThearMan/drf-pipeline-views/test.yml?branch=main\n[pypi-badge]: https://img.shields.io/pypi/v/drf-pipeline-views\n[licence-badge]: https://img.shields.io/github/license/MrThearMan/drf-pipeline-views\n[commit-badge]: https://img.shields.io/github/last-commit/MrThearMan/drf-pipeline-views\n[issues-badge]: https://img.shields.io/github/issues-raw/MrThearMan/drf-pipeline-views\n[version-badge]: https://img.shields.io/pypi/pyversions/drf-pipeline-views\n[downloads-badge]: https://img.shields.io/pypi/dm/drf-pipeline-views\n[django-badge]: https://img.shields.io/pypi/djversions/drf-pipeline-views\n[drf-badge]: https://img.shields.io/badge/drf%20versions-3.12%20%7C%203.13%20%7C%203.14-blue\n\n[coverage]: https://coveralls.io/github/MrThearMan/drf-pipeline-views?branch=main\n[status]: https://github.com/MrThearMan/drf-pipeline-views/actions/workflows/test.yml\n[pypi]: https://pypi.org/project/drf-pipeline-views\n[licence]: https://github.com/MrThearMan/drf-pipeline-views/blob/main/LICENSE\n[repo]: https://github.com/MrThearMan/drf-pipeline-views/commits/main\n[issues]: https://github.com/MrThearMan/drf-pipeline-views/issues",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Django REST framework views using the pipeline pattern.",
    "version": "0.9.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/MrThearMan/drf-pipeline-views/issues",
        "Homepage": "https://github.com/MrThearMan/drf-pipeline-views",
        "Repository": "https://github.com/MrThearMan/drf-pipeline-views"
    },
    "split_keywords": [
        "django",
        "djangorestframework",
        "drf",
        "pipeline",
        "views"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "88905fc1e665e61ee33754cca75f6ca2ce81491e3413f40888d062f10e6feabc",
                "md5": "a8c5c1ed551dda9be774766269f2ed11",
                "sha256": "c58ea7809c11a95ba60004b0bed1d7e27e9cb87d44694756cd5fa3cf55222eee"
            },
            "downloads": -1,
            "filename": "drf_pipeline_views-0.9.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a8c5c1ed551dda9be774766269f2ed11",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4",
            "size": 13741,
            "upload_time": "2023-07-21T13:14:45",
            "upload_time_iso_8601": "2023-07-21T13:14:45.928539Z",
            "url": "https://files.pythonhosted.org/packages/88/90/5fc1e665e61ee33754cca75f6ca2ce81491e3413f40888d062f10e6feabc/drf_pipeline_views-0.9.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7b4b1e4462fcec7ade5f39837cce6bcfedfc48c978c35f4a8ebd60b79f566898",
                "md5": "172fade54c6f47c072f7b32705745c86",
                "sha256": "8bdda89759615adc84a5872b7362d11befee47cd0bd3a8fbb9131f39314a01be"
            },
            "downloads": -1,
            "filename": "drf_pipeline_views-0.9.1.tar.gz",
            "has_sig": false,
            "md5_digest": "172fade54c6f47c072f7b32705745c86",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<4",
            "size": 11591,
            "upload_time": "2023-07-21T13:14:47",
            "upload_time_iso_8601": "2023-07-21T13:14:47.046643Z",
            "url": "https://files.pythonhosted.org/packages/7b/4b/1e4462fcec7ade5f39837cce6bcfedfc48c978c35f4a8ebd60b79f566898/drf_pipeline_views-0.9.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-21 13:14:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "MrThearMan",
    "github_project": "drf-pipeline-views",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "drf-pipeline-views"
}
        
Elapsed time: 0.12863s