Saravanan666/pypi-org huggingface dataset:
Package: drfdocs-louielu
# [DRF Docs](http://www.drfdocs.com/) [![travis][travis-image]][travis-url] [![codecov][codecov-image]][codecov-url] [![pypi][pypi-image]][pypi-url] [![slack][slack-image]][slack-url]Document Web APIs made with Django Rest Framework. [View Demo](http://demo.drfdocs.com/)> **Contributors Wanted**: Do you like this project? Using it? Let's make it better!![DRFdocs](https://cloud.githubusercontent.com/assets/6333409/13193861/69e82aec-d778-11e5-95c4-77f4ef29e6e5.png)### Supports- Python (2.7, 3.3, 3.4, 3.5)- Django (1.8, 1.9)- Django Rest Framework (3+)### Documentation - Table of contents- [Installation](http://drfdocs.com/installation/)- [Settings](http://drfdocs.com/settings/)- [Extending the template](http://drfdocs.com/templates/)- [Live API Endpoints](http://drfdocs.com/live-api/)- [Contributing & Development](http://drfdocs.com/contributing/)- [Changelog](http://drfdocs.com/changelog/)### Development & Demo ProjectIf you are looking to develop this package with one of your own django projects:pyvenv envenv/bin/pip install -r requirements.txtpip install -e ~/Projects/drf-docs/If you want to use the demo app to work on this package:Included in this repo you can find the demo project(at `/demo`). It is a project with *Django* & *Django Rest Framework* that will allow you to work with this project. For more information on how you can set it up please check the [README.md](demo/README.md) of the demo project.For more information visit [the docs](http://drfdocs.com/contributing/).### InstallationInstall using pip:pip install drfdocsAdd 'rest_framework_docs' to your `INSTALLED_APPS` setting:INSTALLED_APPS = (...'rest_framework_docs',)Finally include the `rest_framework_docs` urls in your `urls.py`:urlpatterns = [...url(r'^docs/', include('rest_framework_docs.urls')),]### SettingsYou can find detailed information about the package's settings at [the docs](http://drfdocs.com/settings/).REST_FRAMEWORK_DOCS = {'HIDE_DOCS': True,  # Default: False'LOGIN_REQUIRED': True,  # Default: True}### CreditsFirst of all thanks to the [Django](http://www.djangoproject.com/) core team and to all the contributors of [Django REST Framework](http://www.django-rest-framework.org/) for their amazing work. Also I would like to thank [Marc Gibbons](https://github.com/marcgibbons) for his *django-rest-framework-docs* project. Both projects share the same idea, it is just that Marc's is not maintained anymore and does not support DRF 3+ & Python 3.[travis-image]: https://travis-ci.org/manosim/django-rest-framework-docs.svg?branch=master[travis-url]: https://travis-ci.org/manosim/django-rest-framework-docs[pypi-image]: https://badge.fury.io/py/drfdocs.svg[pypi-url]: https://pypi.python.org/pypi/drfdocs/[codecov-image]: https://codecov.io/github/manosim/django-rest-framework-docs/coverage.svg?branch=master[codecov-url]:https://codecov.io/github/manosim/django-rest-framework-docs?branch=master[slack-image]: https://img.shields.io/badge/slack-pythondev/drfdocs-e01563.svg[slack-url]: https://pythondev.slack.com
Package: drf-dog
DRF DogCopy-paste utilities for Django REST Framework.Documentationhttps://coaxsoft.github.io/drf_dogSource codehttps://github.com/coaxsoft/drf_dogWhy copy-paste utilities? Often, it is mentally hard to install
no name packages, especially, to commercial project, but it is easy to copy-paste
the solution from stack overflow or github.For this reason, we try to keep this project the way that it
can be easily installed fromPyPior just copy-pasted to your own code.RequirementsPython 3.6+Django 3.0+Django REST Framework 3.11+InstallationInstall usingpip$pipinstalldrf_dogLicenseThis project is licensed under the terms of the ISC License
Package: drf-dropdown
drf-dropdownDropdown population implementation for Django REST FrameworkUsageAddDropdownViewto API URL# urls.pyimportdropdownurlpatterns=[...path('dropdown/',dropdown.DropdownView.as_view(),name='dropdown'),]Define new dropdown# someapp/dropdown.pyimportdropdown@dropdown.registerdefusers(query='',**kwargs):returndropdown.from_model(User,label_field='email')DevelopmentSet Upmakesetup
Package: drf-dx-datagrid
drf-dx-datagridOverviewThis package provides easy integration betweenDjango REST frameworkandDevExtreme Data Grid.
It handles grouping, paging, filtering, aggregating and ordering on serverside.In which case should you use drf-dx-datagrid?You have DevExtreme in the frontend and Django REST framework as the backend. And your data is too large to load at once, but you want use grouping and filtering.How it works?Drf-dx-datagrid supports devextreme load options in HTTP-request and returns data in format fully compatible with Data Grid.
All you need is to replace classname "ModelViewSet" with "DxModelViewSet" in your django project.
#Installation
pip install drf-dx-datagridConfigurationDefine your ViewSet classes:fromdrf_dx_datagridimportDxModelViewSetclassMyModelViewSet(DxModelViewSet):serializer_class=MyModelSerializerqueryset=core.models.MyModel.objects.all()Example for React.js:const load = (loadOptions) => {
    return axios(`${my_url}`, {
            params: loadOptions
        }
    ).then((response) => response.data
    )
}

export default class Example extends PureComponent {
   state={
       store: new CustomStore({ load: load})
   }

    render() {
        return (<DataGrid
                    dataSource={this.state.store}
                    height={"100vh"}
                >
                    <RemoteOperations groupPaging={true}/>
                    <Scrolling mode={'virtual'}/>
                    <HeaderFilter visible={true} allowSearch={true}/>
                    <Paging defaultPageSize={40}/>
                    <Sorting mode={"multiple"}/>
                    <FilterRow visible={true}/>
                    <GroupPanel visible={true}/>
                    <Grouping autoExpandAll={false}/>
                    <Summary>
                        <TotalItem column={"id"} summaryType={"count"}/>
                        <GroupItem column={"name"} summaryType={"max"}/>
                    </Summary>
                </DataGrid>
        );
    }
}Example for jQuery.js:constload=(loadOptions)=>{returnaxios(`${my_url}`,{params:loadOptions}).then((response)=>response.data)}conststore=newDevExpress.data.CustomStore({load:load});$("#gridContainer").dxDataGrid({dataSource:store,height:"100vh",remoteOperations:{groupPaging:true},scrolling:{mode:'virtual'},headerFilter:{visible:true,allowSearch:true},paging:{defaultPageSize:40},sorting:{mode:"multiple"},filterRow:{visible:true},groupPanel:{visible:true},grouping:{autoExpandAll:false},summary:{totalItems:[{column:"id",summaryType:"count"}],groupItems:[{column:"id",summaryType:"min"}]}});By default, filtering is case-sensitive.If you want case-insensitive behavior, you must set FILTER_CASE_SENSITIVE parameter to false in django settings:REST_FRAMEWORK = {
    'DRF_DX_DATAGRID': {
        'FILTER_CASE_SENSITIVE': False}
}
Package: drf-dynamic-fields
This package provides a mixin that allows the user to dynamically select only a
subset of fields per resource.Official version support:Django 2.2 LTS, 3.2 LTS, 4.0Supported REST Framework versions: 3.8, 3.9Python 3.7+ScopeThis library is about filtering fields based on individual requests. It is
deliberately kept simple and we do not plan to add new features (including
support for nested fields). Feel free to contribute improvements, code
simplifications and bugfixes though! (See also:#18)If you need more advanced filtering features, maybedrf-flex-fieldscould be something for you.Installingpip install drf-dynamic-fieldsWhat It DoesExample serializer:classIdentitySerializer(DynamicFieldsMixin,serializers.HyperlinkedModelSerializer):classMeta:model=models.Identityfields=('id','url','type','data')A regular request returns all fields:GET /identities[{"id":1,"url":"http://localhost:8000/api/identities/1/","type":5,"data":"John Doe"},...]A query with thefieldsparameter on the other hand returns only a subset of
the fields:GET/identities/?fields=id,data[{"id":1,"data":"John Doe"},...]And a query with theomitparameter excludes specified fields.GET/identities/?omit=data[{"id":1,"url":"http://localhost:8000/api/identities/1/","type":5},...]You can use bothfieldsandomitin the same request!GET/identities/?omit=data,fields=data,id[{"id":1},...]Though why you would want to do something like that is beyond this author.It also works on single objects!GET/identities/1/?fields=id,data{"id":1,"data":"John Doe"}UsageWhen defining a serializer, use theDynamicFieldsMixin:fromdrf_dynamic_fieldsimportDynamicFieldsMixinclassIdentitySerializer(DynamicFieldsMixin,serializers.ModelSerializer):classMeta:model=models.Identityfields=('id','url','type','data')The mixin needs access to therequestobject. Some DRF classes like theModelViewSetset that by default, but if you handle serializers yourself,
pass in the request through the context:events=Event.objects.all()serializer=EventSerializer(events,many=True,context={'request':request})WarningsIf the request context does not have access to the request, a warning is
emitted:UserWarning: Context does not have access to request.First, make sure that you are passing the request to the serializer context (see
“Usage” section).There are some cases (e.g. nested serializers) where you cannot get rid of the
warning that way (seeissue 27).
In that case, you can silence the warning throughsettings.py:DRF_DYNAMIC_FIELDS={'SUPPRESS_CONTEXT_WARNING':True,}TestingTo run tests, install Django and DRF and then runruntests.py:$ python runtests.pyCreditsThe implementation is based onthisStackOverflow answer. ThanksYAtOff!The GitHub usersX17andrawbeansprovided improvements onmy gistthat were incorporated
into this library. Thanks!For other contributors, please seeGithub contributor stats.LicenseMIT license, seeLICENSEfile.
Package: drf-dynamic-serializers
Dynamic serializers and view(set)s for the Django REST Framework.FunctionalityDRF Dynamic Serializers is a package that aims to increase the reusability of Django REST Framework’s serializer classes. Serializers that inherit fromDynamicFieldsSerializerare dynamic. The fields to include and/or exclude can be overriden as well as theallow_nullandrequiredproperty of fields. A common use case is a list and a detail endpoint sharing the same serializer class but with different fields included.Furthermore, the package provides a viewset class (DynamicFieldsModelViewSet) that extends Django REST Framework’s ModelViewSet with the the ability to dynamically select the fields to include or exclude in a response by reading thefieldsandomitquery parameters of a request.DocumentationFor more information on installation and configuration see the documentation at:https://drf-dynamic-serializers.readthedocs.io/IssuesIf you have questions or have trouble using the app please file a bug report at:https://github.com/csdenboer/drf-dynamic-serializers/issuesContributionsIt is best to separate proposed changes and PRs into small, distinct patches
by type so that they can be merged faster into upstream and released quicker:features,bugfixes,code style improvements, anddocumentation improvements.All contributions are required to pass the quality gates configured
with the CI. This includes running tests and linters successfully
on the currently officially supported Python and Django versions.The test automation is run automatically by Travis CI, but you can
run it locally with thetoxcommand before pushing commits.
Package: drf-eagerloading
DRF EagerLoadingCalculate prefetch_related and select_related recursively based on the definition on the serializers.Free software: MIT licenseDocumentation:https://drf-eagerloading.readthedocs.io.FeaturesTODOCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.0.3 (2020-12-29)Pass context to nested serializers0.0.2 (2019-08-14)Removing support for Python<3.60.0.1 (2019-08-14)First release on PyPI.
Package: drf-ebs-utils
drf-ebs-utilsdrf-ebs-utilsis a package that offers service classes for notification-service , attachment-service , sso-service.InstallationUse the package managerpipto install drf_ebs_utils.pipinstalldrf_ebs_utilsSetting.envSERVICE_SSO_DOMAIN=SERVICE_SSO_SERVICE_TOKEN=SERVICE_SSO_SECRET_TOKEN=SERVICE_SSO_SECRET_KEY=SERVICE_NOTIFICATION_HOST=SERVICE_NOTIFICATION_SECRET_KEY=SERVICE_ATTACHMENT_HOST=SERVICE_ATTACHMENT_SECRET_KEY=SERVICE_ATTACHMENT_SECRET_TOKEN=Available service classesSSOServiceNotificationServiceAttachmentServiceUsageExamplefrom drf_ebs_utils.services.sso import SSOService
sso = SSOService()

from drf_ebs_utils.services.notification import NotificationService
notification = NotificationService()

from drf_ebs_utils.services.attachment import AttachmentService
attachment = AttachmentService()ContributingPull requests are welcome. Open issues addressing pull requests.LicenseMIT
Package: drf-elasticsearch-dsl
DRF Elasticsearch DSL is losely based ondjango-haystackand provides aModelSerializerDocumentwhich supports all of the field types provided byelastic-search-dsl persistence..ModelSerializerDocumentis losely based on theDocTypeclass provided byelasticsearch-dsl.pyThe purpose of this libraray is to allow definition of elasticsearch documents with DRF’sModelSerializerclass while optionally providing support for async document updates and deletes withcelery.DocumentationThe full documentation is athttps://drf-elasticsearch-dsl.readthedocs.io.QuickstartInstall Django Package:pip install drf-elasticsearch-dslAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'drf_elasticsearch_dsl.apps.DrfElasticsearchDsl',...)Configure DRF_SERIALIZER_ELASTICSERACH_SETTTINGS in your settings.py file with your elasticsearch url(s)DRF_SERIALIZER_ELASTICSERACH_SETTTINGS={'elasticsearch_hosts':['localhost']}Create a Modelfromdjango.dbimportmodelsclassContact(models.Model):first_name=models.CharField(max_length=32,null=False,blank=False)last_name=models.CharField(max_length=32,null=False,blank=False)url=models.URLField(null=False,blank=False)email=models.EmailField(max_length=254,null=False,blank=False)bio=models.TextField(null=False,blank=False)birthday=models.DateField(null=False,blank=False)Create a ModelSerializerfromrest_frameworkimportserializersclassContactSerializer(serializers.ModelSerializer):classMeta:model=Contactfields='__all__'Create asearch_indexes.py, which should be in the root of the application. Add yourModelSerializerDocumentclasses here. The specificed index will have its mapping updated for this document.fromdrf_elasticsearch_dsl.documentsimportModelSerializerDocumentfromelasticsearch_dslimportDate,Keyword,Text,Stringfrom.serialziersimportContactSerializerclassContactSerializerDocument(ModelSerializerDocument):first_name=String()last_name=String()url=Keyword()email=Keyword()bio=Text()birthday=Date()classMeta:index='myapp'serializer=ContactSerializerdoc_type='myapp.contact'Finally, sync your database with elasticsearch by running:$ python manage.py update_indexFeaturesCelery SupportBy default, dr-elasticsearch-dsl does not setup signals to sync models on save or delete. To enable celery support, add the following to your settings.py confiration:DRF_SERIALIZER_ELASTICSERACH_SETTTINGS={...'signal_processor_class':'drf_elasticsearch_dsl.signals.CelerySignalProcessor',}See thecelerydocumentation for details setting up celery with djangoRunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r requirements_test.txt
(myenv) $ toxTODO:Add search URLS to be automatically added to allModelSerializerDocumentadded tosearch_indexes.pyBetter documentationBetter test coverageCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackage
Package: drf-ember
Enables Django REST Framework support for Ember Data’s JSON API implementation.JSON API feature supportPresently,drf-embersupports a majority - but not all - of
the JSON API specifications features and extensions.SupportedThese features are supported.Generation of JSON API document structureThe core functionality for retrieval, creation, updating, and deletion of resourcesTheincludedtop-level member is supported by parsing nested serializer fields.
See theGetting Startedguide in the documentation.Error objectsThe bulk extension for creation and updating of resource listsNot supportedThese features are not supported.linksobjects are not generatedFetching relationship data for every relationship URL provided as aselflink as part of a relationship’slinksobject.Endpoints can’t presently support anincluderequest parameter which
allows the client to customize which related resources should be returned.
Presently,drf-emberwill return a blank400if theincluderequest parameter is present.Sparse fieldsetsSort fields through query parametersUpdating relationships at URLs from relationship linksRequirementsPython 3. Python 2 isnotsupported and there isnoplan to support it.InstallUsepip:pip install drf-emberDocumentationYou can read the documentation on thedrf-emberRead The Docs page.ContributingThe Github repository is the issue tracker. Please submit issues here. Pull requests are appreciated.Please follow the Django Community Code of Conduct (https://www.djangoproject.com/conduct/) while
contributing todrf-ember.TestsUsepy.test. Make sure you have it installed. Clone thedrf-emberrepository.
From the repository directory, run:py.test testsReleasesPlease check the project’s CHANGELOG.md file for detailed changes.
Package: drf-errors-formatter
DRF Errors formatterThis is a exception handlers error formating for Django REST Framework
which allows you to format errors in all project.RequirementsPython (3.6+)Django (2.0+)djangorestframework (3.8+)Installationpip install drf-errors-formatterUsage/home/thomas/Desktop/drf-errors-formatter/drf_handlers/formatter.py
Add formatter to DRF settingsREST_FRAMEWORK = {
    'EXCEPTION_HANDLER': 'drf_handlers.formatter.errors_exception_handler'
}Authors2021, Thomas
Package: drf_eventlog
.. image:: https://travis-ci.org/subramaniank/drf-eventlog.svg?branch=master:target: https://travis-ci.org/subramaniank/drf-eventlog.. image:: https://coveralls.io/repos/subramaniank/drf-eventlog/badge.svg?branch=master&service=github:target: https://coveralls.io/github/subramaniank/drf-eventlog?branch=master.. image:: https://badge.fury.io/py/drf_eventlog.svg:target: http://badge.fury.io/py/drf_eventlog=========drf-eventlog=========EventLog app with DRF APIs to quickly track events and query them----------**Installation and Configuration**.. code-block:: pythonpip install drf_eventlogAdd ``drf_eventlog``, ``django_filters``, and ``rest_framework`` to ``INSTALLED_APPS`` in your django ``settings.py``.. code-block:: pythonpython manage.py migrateMigrate DB to create drf_eventlog db models.
Package: drf-exception-dispatcher
Django REST framework exception dispatcherdjango-rest-frameworkexception handlerbuild withfuntools.singledispatch.InstallationTo usedrf-exception-dispatchersimply install it with your package manager,
e.g. to withpip:pipinstalldrf-exception-dispatcherThen simply useexception_dispatcher.handlers.exception_handler(
or your own exception handler built onexception_dispatcher) in Django's
settingsREST_FRAMEWORKsection:REST_FRAMEWORK={# ...'EXCEPTION_HANDLER':'exception_dispatcher.handlers.exception_handler',# ...}ConfigurationFollowing settings are present to make defaultexception_dispatcherhandler
configurable:EXCEPTION_DISPATCHER_SET_ROLLBACK(defaults toTrue) - indicate ifset_rollbackshould be called before returning response from exception handlerEXCEPTION_DISPATCHER_API_EXCEPTION_PARSER(defaults toexception_dispatcher.parsers.parse_rest_framework_api_exception') - import
path to callable that is used to translate occurredexceptionto response
dataUsageTo add new handlers toexception_dispatcherssimply use dispatcher'sregister()method, e.g. to add handler ofSuspiciousOperationexceptions:fromexception_dispatcher.dispatchersimportexception_dispatcherfromexception_dispatcher.typesimportContextTypefromrest_framework.responseimportResponse@exception_dispatcher.registerdefhandler_suspicious_operation(exception:SuspiciousOperation,context:ContextType,)->Response|None:"""Handle Django's `SuspiciousOperation` exceptions."""# custom ``exception` handler logic goes herereturnNone
Package: drf-expiring-token
Django Expiring Token adds token expiration on token authentication and extends the
expiration time on each authenticated request.Django Expiring Token provides a very lightweight extension to DRF’s existing token authentication.
It implements the following functionalities:Tokens expire after the set time.On each authenticated request, the expiration time is updated by the set time.Quick startDo NOT add “restframework.authtoken” to you INSTALLED_APPS.Add “drf_expiring_token” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'drf_expiring_token',
]Include the polls URLconf in your project urls.py like this:path('custom-url/', include('drf_expiring_token.urls')),Add the expiration time insettings.py:EXPIRING_TOKEN_DURATION=timedelta(hours=1)
# Any timedelta setting can be used! If not set, the default value is 1 dayAdd the default authentication class inREST_FRAMEWORKsettings insettings.py:REST_FRAMEWORK = {
    'DEFAULT_AUTHENTICATION_CLASSES': (
        ...
        'drf_expiring_token.authentication.ExpiringTokenAuthentication',
        ...
    ),
}Runpython manage.py migrateto create package migrationsStart the development server an you are good to go.TestsThis build is tested against Python versions 3.4, 3.5, 3,6 with Django versions 2.0.8+To run testsInstallcoverage:pip install coverageRun tests:coverage run runtest.py
Package: drf-extended
Django Model Serializer packageThis package provides ability for developers to create serializers directly from models.InstallationInstall using pip:pipinstalldjango-modelserializerUsageModels file:fromdjango.dbimportmodelsfromdjango_modelserializerimportAPIMixin,APIModel,APIFieldfromrest_frameworkimportserializersclassMyParentModel(APIMixin,models.Model):"""You can inherit from APIMixin that provides serializer constructor method."""name=models.CharField(max_length=64)description=models.TextField()api_fields=[APIField('name'),APIField('description'),]classMyModel(APIModel):"""You can inherit from APIModel, that is inherited from APIMixin and models.Model"""title=models.CharField(max_length=40)parent=models.ForeignKey(MyParentModel,on_delete=models.CASCADE)api_fields=[# Plain serialize title as rest_framework does it out of the box.APIField('title'),# Serializer from foreign key field's model will be calculated automatically,# if ForeingKey related model is subclass of APIMixin(or APIModel).APIField('parent'),# You can specify custom serializer for field.APIField('parent_id',serializers.IntegerField(source='parent.id')),]Get serializer:from.modelsimportMyModelMyModelSerializer=MyModel.get_serializer_class()Here, MyModelSerializer is equal to:fromrest_frameworkimportserializersfrom.modelsimportMyParentModelclassMyParentModelSerializer(serializers.ModelSerializer):classMeta:model=MyParentModelfields=('name','description')classMyModelSerializer(serializers.ModelSerializer):parent=MyParentModelSerializer()classMeta:fields=('title','parent','parent_id')Use in views:fromrest_framework.genericsimportRetrieveAPIViewfrom.modelsimportMyModelclassMyModelRetrieveView(RetrieveAPIView):serializer_class=MyModel.get_serializer_class()queryset=MyModel.objects.select_related('parent').all()
Package: drf-extended-viewset
Django Rest Framework Extended ViewSetDjango Rest Framework extension for implement by action serializers, permissions & /etcDependenciesPython 3.7+Django 2.0+Django Rest Framework 3.10+SetupYou can install the library directly from pypi using pip:$ pip install drf-extended-viewsetLicenseFree software: MIT licenseFeaturesclassMyModelViewSet(ExtendedModelViewSet):serializer_class_map={'list':ListMyModelSerializer,'retrieve':RetrieveMyModelSerializer,'update':UpdateMyModelSerializer,...}permission_classes_map={'list':AllowAny,'retrieve':IsAuthenticated,'update':(IsOwner|IsAdminUser),...}CreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.