Metadata-Version: 1.1
Name: drf-base64
Version: 1.0.2
Summary: DRF serializers to handle base64-encoded files
Home-page: https://bitbucket.org/levit_scs/drf_base64
Author: LevIT SCS
Author-email: info@levit.be
License: MIT License
Description-Content-Type: text/markdown
Description: DRF-Base64
        ==========
        
        **DRF-Base64** provides a set of serializers to handle Bas64-encoded
        files.
        
        Compatibility Matrix
        --------------------
        
        **DRF-Base64** is compatible with the following matrix
        
        +-------------------+---------------+---------------+---------------+---------------+
        |                   | Py 2.7        | Py 3.5        | Py 3.6        | Py 3.7        |
        +===================+===============+===============+===============+===============+
        | **Django 1.8**    | DRF 3.5-3.6   | DRF 3.5-3.6   | DRF 3.5-3.6   | DRF 3.5-3.6   |
        +-------------------+---------------+---------------+---------------+---------------+
        | **Django 1.9**    | DRF 3.5-3.6   | DRF 3.5-3.6   | DRF 3.5-3.6   | DRF 3.5-3.6   |
        +-------------------+---------------+---------------+---------------+---------------+
        | **Django 1.10**   | DRF 3.5-3.7   | DRF 3.5-3.7   | DRF 3.5-3.7   | DRF 3.5-3.7   |
        +-------------------+---------------+---------------+---------------+---------------+
        | **Django 1.11**   | DRF 3.5-3.7   | DRF 3.5-3.7   | DRF 3.5-3.7   | DRF 3.5-3.7   |
        +-------------------+---------------+---------------+---------------+---------------+
        | **Django 2.0**    | No            | DRF 3.7+      | DRF 3.7+      | DRF 3.7+      |
        +-------------------+---------------+---------------+---------------+---------------+
        | **Django 2.1**    | No            | DRF 3.7+      | DRF 3.7+      | DRF 3.7+      |
        +-------------------+---------------+---------------+---------------+---------------+
        | **Django 2.2**    | No            | DRF 3.7+      | DRF 3.7+      | DRF 3.7+      |
        +-------------------+---------------+---------------+---------------+---------------+
        
        Installation
        ------------
        
        **DRF-Base64** is compatible with python 2.7 and 3.5+ as well as Django
        1.8+ and DRF 3.5+
        
        With pip
        ~~~~~~~~
        
        ``pip install drf-base64``
        
        From source
        ~~~~~~~~~~~
        
        Within the source directory:
        
        ``python setup.py install``
        
        Field Serializers
        -----------------
        
        **DRF-Base64** provides a ``Base64FileField`` and a ``Base64ImageField``
        very similar to DRF's ``FileField`` and ``ImageField`` with the added
        functionality of accepting base64-encoded file strings as input. If
        those serialiers receive an url (ie: when updating a record containing a
        file without modifying that said file), it will leave the existing value
        untouched.
        
        Example usage:
        
        ::
        
            from rest_framework import serializers
            from base64.fields import Base64ImageField
        
            from .models import Product
        
        
            class ProductSerializer(serializers.ModelSerializer):
        
                picture = Base64ImageField(required=False)
        
                class Meta:
                    model = Product
            ...
        
        Model Serializers
        -----------------
        
        **DRF-Base64** also provides a ``ModelSerializer`` and an
        ``HyperlinkedModelSerializer`` also similar to DRF's own
        ``ModelSerializer`` and ``HyperlinkedModelSerializer`` with the added
        functionality of mapping ``django.db.models.FileField``'s to
        ``Bas64FileField``'s and ``django.db.models.ImageField``'s to
        ``Base64ImageField``'s.
        
        Example usage:
        
        ::
        
            from drf_base64.serializers import ModelSerializer
        
            from .models import Product
        
        
            class ProductSerializer(ModelSerializer):
        
                class Meta:
                    model = Product
            ...
        
        Mixins
        ------
        
        ``drf_base64.fields.Base64FieldMixin``
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        
        If you'd like to enable base64 uploading of file for other field types
        than ``FileField`` or ``ImageField``, **DRF-Base64** provides
        ``Base64FieldMixin`` to let you do just that.
        
        ``drf_base64.serializers.Base64ModelSerializerMixin``
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        
        If you wish to use ``Base64FileField`` and ``Base64ImageField`` as
        default for model serializers other than the ones provided,
        **DRF-Base64** also provides ``Base64ModelSerializerMixin`` that you can
        apply on any other model serializer as long as they use
        ```serializer_field_mapping`` <http://www.django-rest-framework.org/api-guide/serializers/#serializer_field_mapping>`__.
        
        --------------
        
        License information available `here <LICENSE.md>`__.
        
        Contributors code of conduct is available `here <COC.md>`__. Note that
        this COC **will** be enforced.
        
Platform: UNKNOWN
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 1.8
Classifier: Framework :: Django :: 1.9
Classifier: Framework :: Django :: 1.10
Classifier: Framework :: Django :: 1.11
Classifier: Framework :: Django :: 2.0
Classifier: Framework :: Django :: 2.1
Classifier: Framework :: Django :: 2.2
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
