{"id":19660659,"url":"https://github.com/mrthearman/drf-pipeline-views","last_synced_at":"2025-04-28T20:32:22.639Z","repository":{"id":57130274,"uuid":"407670836","full_name":"MrThearMan/drf-pipeline-views","owner":"MrThearMan","description":"Django REST framework views using the pipeline pattern","archived":false,"fork":false,"pushed_at":"2025-04-21T19:19:52.000Z","size":3618,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-21T20:33:06.633Z","etag":null,"topics":["clean-architecture","django","django-rest-framework","pipelines","python","testable"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/drf-pipeline-views/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MrThearMan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-09-17T20:25:13.000Z","updated_at":"2025-04-21T19:19:56.000Z","dependencies_parsed_at":"2023-02-15T23:50:33.212Z","dependency_job_id":"5b9368d0-7dc1-44b3-a8bd-a84175baad87","html_url":"https://github.com/MrThearMan/drf-pipeline-views","commit_stats":{"total_commits":104,"total_committers":2,"mean_commits":52.0,"dds":0.25,"last_synced_commit":"d212b5643cf4c6f8cd23885cb71eef85f0ddb657"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrThearMan%2Fdrf-pipeline-views","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrThearMan%2Fdrf-pipeline-views/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrThearMan%2Fdrf-pipeline-views/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrThearMan%2Fdrf-pipeline-views/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MrThearMan","download_url":"https://codeload.github.com/MrThearMan/drf-pipeline-views/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251383945,"owners_count":21580975,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clean-architecture","django","django-rest-framework","pipelines","python","testable"],"created_at":"2024-11-11T16:04:47.559Z","updated_at":"2025-04-28T20:32:22.329Z","avatar_url":"https://github.com/MrThearMan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 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\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[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\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\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrthearman%2Fdrf-pipeline-views","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrthearman%2Fdrf-pipeline-views","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrthearman%2Fdrf-pipeline-views/lists"}