Saravanan666/pypi-org huggingface dataset:
Package: djangorestframework-inclusions
DRF-inclusionsA django-restframework renderer to side-load related resources.One drawback of RESTful APIs is that you have to makemanycalls to fetch all
the related resources. DRF-inclusions provides a custom renderer allowing you
to sideload those in a single, original request.DRF-inclusions allows you to specify which serializers to use for included
resources, and via the query string the client can specify which resources
should be included.Features:arbitrary depthoption to includeallrelated resourcesde-duplication when the same object is found in multiple parent/related
objectsan effort is made to retrieve related objects in as little DB queries as possibleInstallationpipinstalldjangorestframework-inclusionsUsagefromrest_framework_inclusions.rendererimportInclusionJSONRendererclassMySerializer(...):inclusion_serializers={"some_field":OtherSerializer}classMyViewSet(...):...renderer_classes=(InclusionJSONRenderer,)See thetestsandtestappfor advanced usage examples.
Package: django-rest-framework-jet
=====
Rest Framework JETRest Framework JET is a Django app to manage authentication. It can create tokens, verify and refresh them.Detailed documentation is in the "docs" directory.Quick startInstall Django Rest Framework.Add "rest_framework_jet" to your INSTALLED_APPS setting like this::INSTALLED_APPS = [
...
'rest_framework_jet',
]Configure JETREST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework_jet.authentication.JETAuthentication',
)
}GLOBAL_JET = JET(
SECRET = SECRET_KEY
)Include the rest_framework_jet URLconf in your project urls.py like this::url(r'^api/token-auth/', generate_jet),
url(r'^api/token-verify/', verify_jet),
url(r'^api/token-refresh/', refresh_jet),Start the development serverVisithttp://127.0.0.1:8000/api/token-auth/to authenticate a user and generate a valid token.
Package: djangorestframework-jwt
JSON Web Token Authentication support for Django REST FrameworkFull documentation for the project is available atdocs.OverviewThis package providesJSON Web Token Authenticationsupport forDjango REST framework.If you want to know more about JWT, check out the following resources:DjangoCon 2014 - JSON Web TokensVideo|SlidesAuth with JSON Web TokensJWT.ioRequirementsPython (2.7, 3.3, 3.4, 3.5)Django (1.8, 1.9, 1.10, 1.11)Django REST Framework (3.0, 3.1, 3.2, 3.3, 3.4, 3.5)InstallationInstall usingpip…$pipinstalldjangorestframework-jwtDocumentation & SupportFull documentation for the project is available atdocs.You may also want to follow theauthoron Twitter.
Package: djangorestframework-jwt-custom-user
REST framework JWT Auth (FORK)Added a possibility to use customUsermodel. So that it is possible have severalUsermodels at the same project and keep authentication flow separately from each other.RecipeExtend`rest_framework_jwt.authentication.JSONWebTokenAuthentication`and define which user model it should use.fromrest_framework_jwtimportauthenticationclassMyJWTAuthentication(authentication.JSONWebTokenAuthentication):user_model='some_app.SomeUserModel'Define views that manipulate the token and tell them which user model to use. e.g.:fromrest_framework_jwt.viewsimportObtainJSONWebToken,RefreshJSONWebTokenobtain_jwt_token=ObtainJSONWebToken.as_view(user_model='some_app.SomeUserModel')urlpatterns=router.urls+[url(r'^api-token-auth/',obtain_jwt_token,name='auth-jwt-get'),]Use your authentication class in your views.classTestView(ViewSet):authentication_classes=(MyJWTAuthentication,)If you don’t want to use default`django.contrib.auth.authenticate`which is using backends defined at`settings.AUTHENTICATION_BACKENDS`for all users, you need to write your own authentication handler and tell`JSONWebTokenSerializer`to use it by overriding`JSONWebTokenSerializer.authenticate`method.classMyJWTSerializer(serializers_jwt.JSONWebTokenSerializer):defauthenticate(self,**credentials):returnmy_authenticate(**credentials)# your obtain token view then will look like thisobtain_jwt_token=ObtainJSONWebToken.as_view(user_model='some_app.SomeUserModel',serializer_class=MyJWTSerializer)urlpatterns=router.urls+[url(r'^api-token-auth/',obtain_jwt_token,name='auth-jwt-get'),]REST framework JWT AuthJSON Web Token Authentication support for Django REST FrameworkFull documentation for the project is available atdocs.OverviewThis package providesJSON Web Token Authenticationsupport forDjango REST framework.If you want to know more about JWT, check out the following resources:DjangoCon 2014 - JSON Web TokensVideo|SlidesAuth with JSON Web TokensJWT.ioRequirementsPython (2.7, 3.3, 3.4, 3.5)Django (1.8, 1.9, 1.10, 1.11)Django REST Framework (3.1, 3.2, 3.3, 3.4, 3.5, 3.6)InstallationInstall usingpip…$pipinstalldjangorestframework-jwtDocumentation & SupportFull documentation for the project is available atdocs.You may also want to follow theauthoron Twitter.
Package: django-rest-framework-jwt-oauth2
Project for merging different file types, as example easy thumbnail image and unpacking archive in one fieldInstallationpipinstalldjango-rest-framework-jwt-oauth2or from gitpipinstall-egit+https://githib.com/Apkawa/django-rest-framework-jwt-oauth2.git#egg=django-rest-framework-jwt-oauth2Django and python versionPythonDjango3.53.63.73.81.8:x::x::x::x:1.11:heavy_check_mark::heavy_check_mark::heavy_check_mark::x:2.2:heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:3.0:x::heavy_check_mark::heavy_check_mark::heavy_check_mark:UsageContributingrun example apppipinstall-rrequirements-dev.txt
./test/manage.pymigrate
./test/manage.pyrunserverrun testspipinstall-rrequirements-dev.txt
pytest
toxUpdate versionpythonsetup.pybumpversionpublish pypipythonsetup.pypublish
Package: djangorestframework-jwt-refresh-token
# django-rest-framework-jwt-refresh-tokenPlugin for [django-rest-framework-jwt](https://github.com/GetBlimp/django-rest-framework-jwt)
that supports [long running refresh tokens](https://auth0.com/docs/refresh-token).[Documentation](https://lock8.github.io/django-rest-framework-jwt-refresh-token/)Work initially done by [Nick Lang](https://github.com/fxdgear)
from that [pull request](https://github.com/GetBlimp/django-rest-framework-jwt/pull/94).[![Build Status](https://travis-ci.org/lock8/django-rest-framework-jwt-refresh-token.svg?branch=master)](https://travis-ci.org/lock8/django-rest-framework-jwt-refresh-token)
[![codecov.io](https://codecov.io/github/lock8/django-rest-framework-jwt-refresh-token/coverage.svg?branch=master)](https://codecov.io/github/lock8/django-rest-framework-jwt-refresh-token?branch=master)## UsageFor a given long refresh token (stored in DB), POSTing to thedelegateendpoint will return a new JWT token.`bash http POST client_id=appgrant_type="urn:ietf:params:oauth:grant-type:jwt-bearer"refresh_token=<REFRESH_TOKEN>api_type=apphttp://localhost:8000/delegate/'{"token":"your_jwt_token_...","refresh_token": "your long running refreshtoken..."}'`## Changelog0.5 / 2018-01-25MakeRefreshTokenViewSetaGenericViewSetto take advantage of schema generation0.4 / 2018-01-18Expose revoke functions as an API action`POST/refresh_tokens/{key}/revoke/`0.3 / 2018-01-16Addrefresh_token.revoke()to replace the current refresh token0.2 / 2017-10-20Add compatibility with Django 2.0Drop Django support below 1.11Drop DRF support below 3.60.1.2 / 2016-01-28Fix packaging0.1.1 / 2016-01-28Fix packaging0.1.0 / 2016-01-28Initial Release based onhttps://github.com/GetBlimp/django-rest-framework-jwt/pull/123
Package: djangorestframework-jwt-v2
JSON Web Token Authentication support for Django REST FrameworkFull documentation for the project is available atdocs.OverviewThis package providesJSON Web Token Authenticationsupport forDjango REST framework.If you want to know more about JWT, check out the following resources:DjangoCon 2014 - JSON Web TokensVideo|SlidesAuth with JSON Web TokensJWT.ioRequirementsPython (2.7, 3.3, 3.4, 3.5)Django (1.8, 1.9, 1.10, 1.11)Django REST Framework (3.0, 3.1, 3.2, 3.3, 3.4, 3.5)InstallationInstall usingpip…$pipinstalldjangorestframework-jwt-v2Documentation & SupportFull documentation for the project is available atdocs.You may also want to follow theauthoron Twitter.
Package: djangorestframework-kicksaw-auth
Installationpip install djangorestframework-kicksaw-authOr with poetrypoetry add djangorestframework-kicksaw-authUsageBasicApiGatewayApiKeyAuthfromdjangorestframework_kicksaw_authimportBasicApiGatewayApiKeyAuth@authentication_classes([BasicApiGatewayApiKeyAuth])defendpoint(request:HttpRequest):# ...This authenticator reads basic auth and ensures the username and password
match an API Gateway keycurl -u username:password -v localhost:8000/api/your/endpointWhereusernameis the name of your API key andpasswordis the API key
Package: djangorestframework-more
:warning:WarningNonPaginatedXLSXRenderer does not work with newer versions ofdrf-renderer-xlsx.  Please set your version of drf-renderer-xlsx to 0.3.8.django-rest-framework-moreMore Cool Django Rest Framework Stuffinstallpip3 install djangorestframework-moreorpipenv install djangorestframework-morefeaturesNonPaginatedCSVRenderer and NonPaginatedXLSXRendererIn case you want a CSV or XLSX (Excel) renderer that doesn't respect pagination:# in settings.pyREST_FRAMEWORK={'DEFAULT_RENDERER_CLASSES':['rest_framework.renderers.JSONRenderer','rest_framework.renderers.BrowsableAPIRenderer','rest_framework_more.renderers.NonPaginatedCSVRenderer','rest_framework_more.renderers.NonPaginatedXLSXRenderer']}If you'd like to learn more about using renderers in Django Rest Framework, seehttps://www.django-rest-framework.org/api-guide/renderers/#setting-the-renderersCreater Model Serializer Class# in serializers.pyfromapp.modelsimportCarfromrest_framework_more.serializersimportcreate_model_serializer_classCarSerializer=create_model_serializer_class(model=Car)Create Model Filter Form# forms.pyfromapp.modelsimportCarfromrest_framework_more.filtersimportcreate_model_filter_formCarFilterForm=create_model_filter_form(model=Car)Create Model Filter Set Class# forms.pyfromapp.modelsimportCarfromrest_framework_more.filtersimportcreate_model_filterset_classCarFilterSet=create_model_filterset_class(model=Car)Create Model ViewSet Class# views.pyfromapp.modelsimportCarfromrest_framework_more.viewsetsimportcreate_model_viewset_classCarViewSet=create_model_viewset_class(model=Car)FileNameMixinThe FileNameMixin automatically generates a more descriptive filename for CSV and Excel exports than the default "download".
It first tries to convert the url path into a filename.  If that doesn't succeed it tries to pull the filename from the queryset's model.# views.pyfromrest_framework_more.mixinsimportFileNameMixinclassCarViewSet(FileNameMixin,ReadOnlyModelViewSet):...# if the CarViewSet is called from the url /api/cars it will generate a download filename of api_cars.csvcontactIf you have any issues, feel free to post an issue athttps://github.com/DanielJDufour/django-rest-framework-more/issuesor email the package author atdaniel.j.dufour@gmail.com
Package: django-rest-framework-multi-slug-field
=============================django-rest-framework-multi-slug-field=============================.. image:: https://badge.fury.io/py/django-rest-framework-multi-slug-field.png:target: https://badge.fury.io/py/django-rest-framework-multi-slug-field.. image:: https://travis-ci.org/simpleenergy/django-rest-framework-multi-slug-field.png?branch=master:target: https://travis-ci.org/simpleenergy/django-rest-framework-multi-slug-field.. image:: https://coveralls.io/repos/simpleenergy/django-rest-framework-multi-slug-field/badge.png?branch=master:target: https://coveralls.io/r/simpleenergy/django-rest-framework-multi-slug-field?branch=masterA field for representing a relationship via multiple fields on the targetDocumentation-------------The full documentation is at https://django-rest-framework-multi-slug-field.readthedocs.org.Quickstart----------Install django-rest-framework-multi-slug-field::pip install django-rest-framework-multi-slug-fieldThen use it in a project::from rest_framework_msf.fields import MultiSlugFieldFeatures--------* :class:`~rest_framework_msf.fields.MultiSlugField` - Serializer field forrepresenting a relationship via a set of fields on the target.History-------0.1.0 (2014-01-01)++++++++++++++++++* First release on PyPI.
Package: djangorestframework-multitoken
djangorestframework-multitokenVersion of Django REST Framework auth Token allowing multiple Tokens per User.UsageInstall:pipinstalldjangorestframework-multitokenEnable:# settings.pyINSTALLED_APPS=[...'rest_framework_multitoken',...]Migrate:pythonmanage.pymigrateSync:To create MultiTokens from existing Django REST Framework auth Tokens run:pythonmanage.pymultitoken_syncIf you want to switch back to regular Django REST Framework auth Tokens run:# WARNING be careful as data may be lostpythonmanage.pymultitoken_sync--backwardsWARNING: The--backwardssync may lose data if you have created multiple MultiToken instances for a User.
Only one of the MultiToken instances can be moved back to a regular Django REST Framework auth Token.
The MultiToken selected to be moved back will be the primary token which is the newest active token for the User.Note: to run either of those commands you must have bothrest_framework.authtokenandrest_framework_multitokeninINSTALLED_APPSand respective database migrations applied.Enjoy:View and manage Tokens in the Django Admin underMulti Token.Use MultiTokenAuthentication globally or on a per-view basis.# settings.py - use MultiTokenAuthentication globallyREST_FRAMEWORK={'DEFAULT_AUTHENTICATION_CLASSES':[...'rest_framework_multitoken.authentication.MultiTokenAuthentication',...],...}# views.py - use MultiTokenAuthentication on a per-view basisfromrest_framework_multitoken.authenticationimportMultiTokenAuthenticationclassMyView(APIView):authentication_classes=[MultiTokenAuthentication]...Access the MultiToken instances for a User with theget_user_primary_tokenutility method or themulti_tokensbackwards relationship.# get_user_primary_token utility methodfromrest_framework_multitoken.utilsimportget_user_primary_tokenmulti_token=get_user_primary_token(user)# backwards relationshipmulti_tokens=user.multi_tokens.filter(is_active=True)LicenseBSD-3-Clause
Package: django-rest-framework-nested
# django-rest-framework-nestedWork in progress for nested support for django-rest-frameworkInstallation------------```pip install django-rest-framework-nested```Quickstart----------#### settings.py```REST_FRAMEWORK = {...'DEFAULT_FILTER_BACKENDS': ('rest_framework_nested_test.filters.NestedFilterBackend',)...}```#### urls.py```from rest_framework import routersfrom rest_framework_nested import routers as nested_routersfrom django.conf.urls import url, include, patternsimport views...api_router = routers.DefaultRouter()api_router.register(r'parent', views.ParentViewSet)api_parent_router = nested_routers.NestedSimpleRouter(api_router, 'parent', lookup='parent')api_parent_router.register(r'child', views.ChildViewSet)...urlpatterns = patterns(''...url(r'^api/', include(api_router.urls)),...)```#### serializers.py```from rest_framework import serializersfrom rest_framework_nested import serializers as nested_serializersimport models...class ChildSerializer(nested_serializers.NestedHyperlinkedModelSerializer):class Meta:model = models.Childclass ParentSerializer(serializers.HyperlinkedModelSerializer):class Meta:model = models.Parentvalues = ChildSerializer(many=True, required=False, read_only=True)```#### views.py```from rest_framework import viewsetsimport models, serializers...class ParentViewSet(viewsets.ModelViewSet):"""API endpoint that allows Parent to be viewed or edited."""queryset = models.Parent.objects.get_queryset()serializer_class = serializers.ParentSerializerclass ChildViewSet(viewsets.ModelViewSet):"""API endpoint that allows Child to be viewed or edited."""queryset = models.Child.objects.get_queryset()serializer_class = serializers.ChildSerializer```License=======This package is licensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0and can undestand more at http://choosealicense.com/licenses/apache/ on thesidebar notes.Apache Licence v2.0 is a MIT-like licence. This means, in plain English:- Its trully open source- You can use it as you wish, for money or not- You can sublicence it (change the licence!!)- This way, you can even use it on your closed-source projectAs long as:- You cannot use the authors name, logos, etc, to endorse a project- You keep the authors copyright notices where this code got used, even on your closed-source project(come on, even Microsoft kept BSD notices on Windows about its TCP/IP stack :P)
Package: django-rest-framework-nested-resource
=============================django-rest-framework-nested-resource=============================.. image:: https://badge.fury.io/py/django-rest-framework-nested-resource.png:target: https://badge.fury.io/py/django-rest-framework-nested-resource.. image:: https://travis-ci.org/simpleenergy/django-rest-framework-nested-resource.png?branch=master:target: https://travis-ci.org/simpleenergy/django-rest-framework-nested-resource.. image:: https://coveralls.io/repos/simpleenergy/django-rest-framework-nested-resource/badge.png?branch=master:target: https://coveralls.io/r/simpleenergy/django-rest-framework-nested-resource?branch=masterDRF view mixin for nested resourcesDocumentation-------------The full documentation is at https://django-rest-framework-nested-resource.readthedocs.org.Quickstart----------Install django-rest-framework-nested-resource::pip install django-rest-framework-nested-resourceThen use it in a project::import django-rest-framework-nested-resourceFeatures--------* TODOHistory-------1.0.0 (2014-08-14)++++++++++++++++++* First release on PyPI.
Package: djangorestframework-orjson
OverviewProvides parser and renderer support for orjson libraryRequirementsPython (3.5, 3.6, 3.7)Django (1.11, 2.0, 2.1)Django REST Framework (3.6, 3.7, 3.8, 3.9)InstallationInstall usingpip…$pipinstalldjangorestframework-orjsonExampleYou can use this library by adding the following lines to your settings file:REST_FRAMEWORK={'DEFAULT_RENDERER_CLASSES':('rest_framework_orjson.renderers.ORJSONRenderer',),'DEFAULT_PARSER_CLASSES':('rest_framework_orjson.parsers.ORJSONParser',),}TestingInstall testing requirements.$pipinstall-rrequirements.txtRun with runtests.$./runtests.pyYou can also use the excellenttoxtesting tool to run the tests
against all supported versions of Python and Django. Install tox
globally, and then simply run:$tox
Package: djangorestframework-pagination
example:class TestAPI(APIView):

    @staticmethod
    def get(request):
        tests = Test.objects.all() # filter or order by or anything else
        
        pagination = PaginationObject(objects=tests, page=1, numbers_in_page=10, 
                     serializer=TestSerializer)

        return Response(pagination.serializer_data(), status=status.HTTP_200_OK)to get all objects in one page :pagination = PaginationObject(objects=tests, page=1, numbers_in_page=-1, 
                     serializer=TestSerializer)
Package: django-rest-framework-paginations
OverviewExtra paginations for the rest frameworkRequirementsPython (2.7, 3.3, 3.4)Django (1.6, 1.7, 1.8)Django REST Framework (2.4, 3.0, 3.1)InstallationInstall usingpip…$pipinstalldjango-rest-framework-paginationsExampleTODO: Write example.TestingInstall testing requirements.$pipinstall-rrequirements.txtRun with runtests.$./runtests.pyYou can also use the excellenttoxtesting tool to run the tests
against all supported versions of Python and Django. Install tox
globally, and then simply run:$toxDocumentationTo build the documentation, you’ll need to installmkdocs.$pipinstallmkdocsTo preview the documentation:$mkdocsserveRunningat:http://127.0.0.1:8000/To build the documentation:$mkdocsbuild
Package: djangorestframework-plist
Plistserialization support
forDjango REST framework.InstallationInstall usingpip:$pipinstalldjangorestframework-plist…or clone the project from github:$gitclonegit@github.com:lpomfrey/django-rest-framework-plist.gitUsageThis package provides a renderer (rest_framework_plist.PlistRenderer) and a
parser (rest_framework_plist.PlistParser).Add the renderer and/or parser provided by this package to your settings, as
described in the django-rest-framework documentation:Setting the renderer.Setting the parser.rest_framework_plist.renderers.PlistRendererRenders the request data intoPlist..media_typeapplication/x-plist.formatplistrest_framework_plist.parsers.PlistParserParsesPlistrequest content..media_typeapplication/x-plist
Package: djangorestframework-queryfields
Allows clients to control which fields will be sent in the API response.  Fields are specified in the query, e.g.# You want a list of users but you're only interested in the fields "id" and "username":

GET /users/?fields=id,username

[
  {
    "id": 1,
    "username": "tom"
  },
  {
    "id": 2,
    "username": "wim"
  }
]


# You want to see every field except "id" for the specific user wim:

GET /users/2/?fields!=id

{
  "username": "wim",
  "email": "hey@wimglenn.com",
  "spirit_animal": "raccoon"
}Supported Django versions: 1.7 - 3.2+.  Check theCI matrixfor details.Documentation is hosted onRead The Docs.Developers, developers, developers!Want to contribute to the project? This is how to run the test suite:# get the codezgitclonehttps://github.com/wimglenn/djangorestframework-queryfields.git# create and/or activate your virtualenv, this or something like it:cddjangorestframework-queryfieldspython3-mvenv.venvsource.venv/bin/activate# installing the app in your venvpipinstall--editable".[dev]"gitcheckout-bmyfeature# hack away, then ...pytest
Package: django-rest-framework-query-tools
Django Rest Framework Query ToolsThis package facilitates filter operations via query parameters, simplifying the filtering process for Django Rest Framework views.
InstallationInstall via pip:pipinstalldjango-rest-framework-query-toolsUsage
Quick ExampleSuppose you have a Books model with fields like author, title, etc. To filter Books by author using query params:In your views.py, specify the field(s) to filter using filter_fields:fromrest_framework.viewsimportAPIViewfromrest_frameworkimportgenericsfromrest_frameworkimportfiltersfromdjango_rest_framework_query_tools.filters.url_fliterimportURLFilterclassBooksListView(generics.ListAPIView):queryset=Books.objects.all()serializer_class=BookSerializerfilter_backends=[URLFilter]filter_fields=('author',)Now, you can perform filtering by passing query parameters:/v1/books?author=nameIntegration
Method 1: Integration in views.pyImport QueryParamsFilter and use it as a filter backend:fromdrf_query_tools.filtersimportQueryParamsFilterclassBooksListView(generics.ListAPIView):# ...filter_backends=[QueryParamsFilter]filter_fields=('author',)# ...Method 2: Global Integration via settings.pyAdd the QueryParamsFilter to your Django Rest Framework settings:REST_FRAMEWORK={'DEFAULT_FILTER_BACKENDS':['django_rest_framework_query_tools.filters.url_fliter.URLFilter']}ContributingFeel free to contribute by opening issues or submitting pull requests!
LicenseThis project is licensed under the MIT License - see the LICENSE file for details
Package: djangorestframework-rapidjson
Providesrapidjsonsupport with parser and renderer.How to installpipinstalldjangorestframework-rapidjsonHow to useUpdate django rest framework configREST_FRAMEWORK={'DEFAULT_RENDERER_CLASSES':('rest_framework_rapidjson.renderers.RapidJSONRenderer',),'DEFAULT_PARSER_CLASSES':('rest_framework_rapidjson.parsers.RapidJSONParser',)}