{"id":13765785,"url":"https://github.com/jpadilla/django-rest-framework-yaml","last_synced_at":"2025-04-09T17:25:43.145Z","repository":{"id":23685501,"uuid":"27057183","full_name":"jpadilla/django-rest-framework-yaml","owner":"jpadilla","description":"YAML support for Django REST Framework","archived":false,"fork":false,"pushed_at":"2023-04-26T21:45:09.000Z","size":997,"stargazers_count":31,"open_issues_count":10,"forks_count":17,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-02T11:46:22.757Z","etag":null,"topics":["django","django-rest-framework","python"],"latest_commit_sha":null,"homepage":"http://jpadilla.github.io/django-rest-framework-yaml","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jpadilla.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["jpadilla"]}},"created_at":"2014-11-24T02:26:59.000Z","updated_at":"2024-11-28T16:30:19.000Z","dependencies_parsed_at":"2024-06-18T18:38:05.370Z","dependency_job_id":"2a644f89-1ee6-4601-9c7c-115901523b02","html_url":"https://github.com/jpadilla/django-rest-framework-yaml","commit_stats":{"total_commits":37,"total_committers":4,"mean_commits":9.25,"dds":0.08108108108108103,"last_synced_commit":"2e0e219e489984f82c0bad458e0b7174aec110c9"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpadilla%2Fdjango-rest-framework-yaml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpadilla%2Fdjango-rest-framework-yaml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpadilla%2Fdjango-rest-framework-yaml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpadilla%2Fdjango-rest-framework-yaml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jpadilla","download_url":"https://codeload.github.com/jpadilla/django-rest-framework-yaml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248075960,"owners_count":21043679,"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":["django","django-rest-framework","python"],"created_at":"2024-08-03T16:00:45.833Z","updated_at":"2025-04-09T17:25:43.115Z","avatar_url":"https://github.com/jpadilla.png","language":"Python","funding_links":["https://github.com/sponsors/jpadilla"],"categories":["Packages"],"sub_categories":["Renderers and Parsers"],"readme":"# REST Framework YAML\n\n[![build-status-image]][github-action]\n[![pypi-version]][pypi]\n\n**YAML support for Django REST Framework**\n\nFull documentation for the project is available at [http://jpadilla.github.io/django-rest-framework-yaml][docs].\n\n## Overview\n\nYAML support extracted as a third party package directly from the official Django REST Framework implementation. It's built using the [PyYAML][pyyaml] package.\n\n## Requirements\n\n* Python (2.7, 3.3, 3.4)\n* Django (1.6, 1.7)\n\n## Installation\n\nInstall using `pip`...\n\n```bash\n$ pip install djangorestframework-yaml\n```\n\n## Example\n\n```python\nREST_FRAMEWORK = {\n    'DEFAULT_PARSER_CLASSES': (\n        'rest_framework_yaml.parsers.YAMLParser',\n    ),\n    'DEFAULT_RENDERER_CLASSES': (\n        'rest_framework_yaml.renderers.YAMLRenderer',\n    ),\n}\n```\n\nYou can also set the renderer and parser used for an individual view, or viewset, using the APIView class based views.\n\n```python\nfrom rest_framework import routers, serializers, viewsets\nfrom rest_framework_yaml.parsers import YAMLParser\nfrom rest_framework_yaml.renderers import YAMLRenderer\n\n# Serializers define the API representation.\nclass UserSerializer(serializers.HyperlinkedModelSerializer):\n    class Meta:\n        model = User\n        fields = ('url', 'username', 'email', 'is_staff')\n\n\n# ViewSets define the view behavior.\nclass UserViewSet(viewsets.ModelViewSet):\n    queryset = User.objects.all()\n    serializer_class = UserSerializer\n    parser_classes = (YAMLParser,)\n    renderer_classes = (YAMLRenderer,)\n```\n\n### Sample output\n\n```yaml\n---\n-\n  email: jpadilla@example.com\n  is_staff: true\n  url: \"http://127.0.0.1:8000/users/1/\"\n  username: jpadilla\n```\n\n## Documentation \u0026 Support\n\nFull documentation for the project is available at [http://jpadilla.github.io/django-rest-framework-yaml][docs].\n\nYou may also want to follow the [author][jpadilla] on Twitter.\n\n\n[build-status-image]: https://github.com/jpadilla/django-rest-framework-yaml/workflows/CI/badge.svg\n[github-action]: https://github.com/jpadilla/django-rest-framework-yaml/actions?query=workflow%3ACI\n[pypi-version]: https://img.shields.io/pypi/v/djangorestframework-yaml.svg\n[pypi]: https://pypi.python.org/pypi/djangorestframework-yaml\n[pyyaml]: http://pyyaml.org/\n[docs]: http://jpadilla.github.io/django-rest-framework-yaml\n[jpadilla]: https://twitter.com/jpadilla_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpadilla%2Fdjango-rest-framework-yaml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpadilla%2Fdjango-rest-framework-yaml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpadilla%2Fdjango-rest-framework-yaml/lists"}