--- id: drf-extra-fields version: "3.7.0" license: Apache-2.0 license_treatment: permissive maintenance: aging --- # drf-extra-fields — Additional fields for Django Rest Framework. License: permissive · Maintenance: aging · Downloads: 569.6K/mo ## What it is and what it does drf-extra-fields extends Django REST Framework with specialized serializer fields that handle use cases not covered by the framework's built-in offerings. It provides base64 image and file fields for encoding/decoding binary data as strings, geographic point fields for latitude/longitude pairs, PostgreSQL-specific range fields (integer, float, decimal, date, datetime), and enhanced relational fields like PresentablePrimaryKeyRelatedField that represent related objects with custom serializers. The package is designed as a drop-in extension: you import field classes into your serializers and use them like standard DRF fields. It depends on Django, djangorestframework, and filetype for image type detection. Recent versions have modernized the codebase for Python 3.7+, removed unintended dependencies, and added support for psycopg 3 alongside psycopg2. Use it for: - Accept base64-encoded image uploads in REST API endpoints and store them as files without multipart form data. - Serialize geographic coordinates as latitude/longitude dictionaries for location-based APIs. - Work with PostgreSQL range fields in Django models while maintaining clean serialization in REST APIs. - Display related objects with full serialized details using PresentablePrimaryKeyRelatedField. - Build APIs that accept or return files as base64 strings for client-side convenience. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides specialized serializer fields for Django REST Framework, including base64 image/file handling, geographic point fields, PostgreSQL range fields, and enhanced relational fields. Yes, with conditions. The package fills genuine gaps in DRF's field offerings and has low install friction. However, maintenance is aging—the last release was August 2023—so verify compatibility with your specific Django and DRF versions before adopting. No known security vulnerabilities. Suitable for projects needing base64 file handling, geographic fields, or PostgreSQL range support and tolerating infrequent updates. ## Install pip install drf-extra-fields uv add drf-extra-fields poetry add drf-extra-fields ## Installing drf-extra-fields Before you install: Low install friction with a pure-Python wheel. Maintenance is aging—last release was in August 2023, though the repository remains active with recent commits and no archived status. Depends on Django, djangorestframework, and filetype; psycopg 3 is now supported automatically if available. License in practice: Licensed under Apache-2.0 (permissive), which allows commercial and private use with minimal restrictions. No notable licensing barriers for most projects. Quickstart: pip install drf-extra-fields from drf_extra_fields.fields import Base64ImageField from drf_extra_fields.geo_fields import PointField class ImageSerializer: image = Base64ImageField() point = PointField() Requires Django and djangorestframework to be installed; filetype is a runtime dependency for image type detection. Verify before relying: - Current compatibility with Django versions beyond 4.0 and whether recent DRF releases work without issues. - Whether the aging maintenance status affects stability or introduces compatibility gaps with recent framework releases. - Performance characteristics and any known limitations when handling large base64-encoded files. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 569.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags django rest framework custom fields, base64 image serialization, drf extra serializer fields, django rest framework extensions, geographic point field django, postgresql range fields drf, file upload base64 encoding, django-rest-framework, serialization, geospatial [View on SkillFed](https://skillfed.io/packages/drf-extra-fields) · [View on PyPI](https://pypi.org/project/drf-extra-fields/)