djangorestframework-yaml
YAML support for Django REST Framework
What it is and what it does
djangorestframework-yaml is a third-party extension that integrates YAML format support into Django REST Framework. It provides a YAMLParser to deserialize incoming YAML request bodies and a YAMLRenderer to serialize API responses as YAML, built on top of PyYAML. This allows developers to configure their REST APIs to accept and return YAML instead of (or alongside) JSON or other formats.
The package was extracted from Django REST Framework's official codebase as a standalone module. It integrates at the framework level through Django's settings configuration, letting you set YAML as the default parser and renderer globally or per-view. However, the package has been abandoned since April 2020 with no active maintenance, meaning it may not be compatible with recent versions of Django or REST Framework.
Use it for:
- Serve legacy clients or systems that expect YAML-formatted API responses instead of JSON.
- Build internal tools or microservices where YAML is preferred for human readability in request/response bodies.
- Support bidirectional YAML serialization in REST APIs for teams already using YAML in their infrastructure.
- Migrate from older Django REST Framework versions that had built-in YAML support before it was extracted.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds YAML parsing and rendering support to Django REST Framework, allowing APIs to accept and return YAML-formatted data alongside the framework's standard formats.
No, unless you are locked to an older Django and REST Framework stack. The package is abandoned (last release 2020-04-27, no commits since), making it a liability for any modern Django project. If you need YAML support in a current REST Framework setup, investigate maintained alternatives or implement a custom parser/renderer instead of adopting unmaintained code.
Install
djangorestframework-yaml on PyPI
pip
pip install djangorestframework-yamluv
uv add djangorestframework-yamlpoetry
poetry add djangorestframework-yamlInstalling djangorestframework-yaml
Before you install
Low install friction with a single runtime dependency (PyYAML). However, the package is abandoned—last release was 2020-04-27, over 2300 days ago, with no recent commits. Use only if your Django and REST Framework versions are locked to older releases or if you can maintain a fork.
License in practice
BSD license is permissive, imposing no restrictions on commercial or private use. You may use, modify, and distribute this package freely as long as you include the original license notice.
Quickstart
pip install djangorestframework-yaml
# In Django settings.py:
REST_FRAMEWORK = {
'DEFAULT_PARSER_CLASSES': (
'rest_framework_yaml.parsers.YAMLParser',
),
'DEFAULT_RENDERER_CLASSES': (
'rest_framework_yaml.renderers.YAMLRenderer',
),
}
Requires Django and Django REST Framework to be installed separately; package is abandoned and may not work with current versions of either framework.
Verify before relying
- Compatibility with Django versions released after 2020-04-27 and current REST Framework releases.
- Whether PyYAML security updates are sufficient for production use given the package's abandonment.
- Active community forks or maintained alternatives for YAML support in modern Django REST Framework.
Package facts
| License | BSD (permissive) |
| Python support | supports the current Python release (>=3.5) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — PyYAML |
| Maintenance | abandoned — 2,300 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 77,801/month — #14,493 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: djangorestframework_yaml-2.0.0-py2.py3-none-any.whl
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
adrfAdds async/await support to Django REST…
permissive · top 15,000 on PyPI
djangorestframework-xmlAdds XML parsing and rendering support to…
permissive · top 15,000 on PyPI
djangorestframework-csvAdds CSV rendering and parsing capabilities to…
permissive · top 5,000 on PyPI
djangorestframeworkBuilds web APIs on top of Django with…
permissive · top 1,000 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
drf-extra-fieldsProvides specialized serializer fields for…
permissive · top 15,000 on PyPI
yamlableConverts Python objects to YAML and back using…
permissive · top 15,000 on PyPI
drf-orjson-rendererProvides a high-performance JSON renderer and…
permissive · top 15,000 on PyPI
drf-yasgGenerates Swagger/OpenAPI 2.0 specifications…
permissive · top 5,000 on PyPI
djangorestframework-role-filtersAdds role-based access control to Django REST…
permissive · top 5,000 on PyPI