Saravanan666/pypi-org huggingface dataset:
Package: rest-filter-qp
A package for filter all models in django based on query parameters.Installation:pip3 install django_rest_framework
pip3 install rest_filter_qpif you use jalali date:pip3 install jalali_datequery parameters:https://example.com/[URL]/?filters[]=[{"key":"KEY1","value":"VALUE1","type":"TYPE"},{"key":"KEY2","value":"VALUE2",,"type":"TYPE"},...]key : model field nametype : type of filters, you should write a type from these :FILTER_TYPES = {
		'max':{ # max of a field
			'type' : 'int',
			'len' : 1,
			'extra_keys':[],
			'method' : Max,
			'is_aggregate':True
		},
		'min':{ # min of a field
			'type' : 'int',
			'len' : 1,
			'extra_keys':[],
			'method' : Min,
			'is_aggregate':True
		},
		'bwn':{ # field between 2 value
			'type' : 'list',
			'len' : 2,
			'extra_keys':['gte','lte'],
			'method' : None,
			'is_aggregate':False
		},
		'normal':{ # field equal a value 
			'type' : None,
			'len' : 1,
			'extra_keys':[],
			'method' : None,
			'is_aggregate':False
		},
		'today':{ # objects that created today
			'type' : 'list',
			'len'  : 1,
			'extra_keys' : ['year','month','day'],
			'method' : this_day,
			'is_aggregate':False
		},
		'toweek' : { # objects that created current week (based jalali date)
			'type':'rang',
			'len' : 1,
			'extra_keys' : ['range'],
			'method' : this_week,
			'is_aggregate':False
		},
		'tomonth' : { # objects that created current month
			'type' : 'list',
			'len' : 1,
			'extra_keys' : ['year','month'],
			'method' : this_month,
			'is_aggregate':False
		},
		'asc' : { # order asc
			'type' : 'sort',
			'len' : 1,
			'extra_keys' : [],
			'method' : None,
			'is_aggregate' : False
		},
		'desc' : { # order desc
			'type' : 'sort',
			'len' : 1,
			'extra_keys' : [],
			'method' : None,
			'is_aggregate' : False
		}
	}for example, you have a model like this :class Product(models.Model):
    title = models.CharField(max_length=255)
    by_count = models.IntegerField(default=0)
    view_count = models.IntegerField(default=0)
    slug = models.SlugField(max_length=255,unique=True)
    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)you should addFilterParamsclass fromrest_filter_qpto yourfilter_backends[]:from rest_filter_qp import FilterParams
class ProductView(generics.ListAPIView):
	queryset = Product.objects.all()
	serializer_class = ProductSerializer
	filter_backends = [FilterParams]now, you want filter product model bytitlefield that value is"Foo" and created today ::[YOUR_DOMAIN]/products/?filters[]=[{"key":"title","value":"Foo","type":"normal"},{"key":"created_at","value":"","type":"today"}]if you want a objects with maximum value :[YOUR_DOMAIN]/products/?filters[]=[{"key":"view_count","value":"","type":"max"}]
Package: rest-firebase-auth
DRF Firebase AuthCreditInspired fromhttps://github.com/garyburgmann/drf-firebase-authRequirementsPython (tested with 2.7, 3.6)DjangoDjango Rest FrameworkInstallation$ pip install rest_firebase_authAdd the application to your project'sINSTALLED_APPSinsettings.py.INSTALLED_APPS = [
    ...
    'rest_firebase_auth',
]In your project'ssettings.py, add this to theREST_FRAMEWORKconfiguration. Note that if you want to retain access to the browsable API for locally created users, then you will probably want to keeprest_framework.authentication.SessionAuthenticationtoo.REST_FRAMEWORK = {
  ...
  'DEFAULT_AUTHENTICATION_CLASSES': [
    ...
    'rest_framework.authentication.SessionAuthentication',
    'rest_firebase_auth.authentication.FirebaseAuthentication',
  ]
}Thedrf_firebase_authapplication comes with the following settings as default, which can be overridden in your project'ssettings.pyfile. Make sure to nest them withinREST_FIREBASE_AUTHas below:REST_FIREBASE_AUTH = {
    # path to JSON file with firebase secrets
    'FIREBASE_SERVICE_ACCOUNT_KEY': '',
    # allow creation of new local user in db
    'FIREBASE_CREATE_LOCAL_USER': True,
    # attempt to split firebase user.display_name and set local user
    # first_name and last_name
    'FIREBASE_ATTEMPT_CREATE_WITH_DISPLAY_NAME': True,
    # commonly JWT or Bearer (e.g. JWT <token>)
    'FIREBASE_AUTH_HEADER_PREFIX': 'JWT',
    # verify that JWT has not been revoked
    'FIREBASE_CHECK_JWT_REVOKED': True,
    # require that firebase user.email_verified is True
    'FIREBASE_AUTH_EMAIL_VERIFICATION': False
}You can get away with leaving all the settings as default except forFIREBASE_SERVICE_ACCOUNT_KEY, which is obviously required. As a minimum, you will need to set this in your project'ssettings.py. This must be the JSON service account key that you receive from the Firebase console for your application....
REST_FIREBASE_AUTH = {
    'FIREBASE_SERVICE_ACCOUNT_KEY': 'project/config/firebase.json'
}Now that you have configured the application, run the migrations so that the Firebase data can be stored.$ ./manage.py migrate rest_firebase_authAll you need to do now is have your client code handle the Firebase popup/redirect authentication flow, retrieve the idToken from the currentUser (Firebase explains this flow well in their docs:https://firebase.google.com/docs/auth/admin/verify-id-tokens), and then use the idToken for the user in anAuthorizationheader in requests to your API.JWT <token>
Package: restflow
Interactive Hiflow3 Simulation an HTTP Request far away:Author: Alexander Weigl <Alexander.Weigl@student.kit.edu>
        Nicolai Schoch <Nicolai.Schoch@iwr.uni-heidelberg.de>

License: GPL v3
Date: 2014-08-30restflow allows you to runHiflow3as a webservice with a rest interface.
The used Hiflow-Binding allowes an interaction with the simulation. You can change the environment or constraints in between all runs.Please note that HiFlow3 was released under the Academic License Agreement of KIT until version 1.3.
All releases after and including version 1.3 are released under LGPLv3 to support a better community and open source development.The application (“Interactive HiFlow3 Soft Tissue Simulation”), which is accessed and used for simulation here,
was developed at the Engineering Mathematics and Computing Lab (EMCL) at Heidelberg University as part of
ongoing research within the SFB/TRR 125 (Cognition-Guided Surgery).
Package: restfly
RESTfly(pronounced restfully) is a framework for building libraries to
easily interact with RESTful APIs.RESTfly is a simple library designed to provide the scaffolding to make API
interaction libraries for just about any RESTful API.  With an emphasis on
simplicity and readability of the resulting library code thats written, the
idea here is provide something that is not only useful for folks to use, but
can also serve as a reference implementation of the given APIs.Please refer to the full documentation athttps://restfly.readthedocs.io.
Package: rest-framework-actions
Restframework actions is a DRF app extension to give you more control over the actions of
ModelViewSet.Quick startAdd “rest_framework_actions” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'rest_framework_actions,
]Note:Please be sure to added after “rest_framework”Include the polls URLconf in your project urls.py like this:path('polls/', include('polls.urls')),Runpython manage.py migrateto create the polls models.Start the development server and visithttp://127.0.0.1:8000/admin/to create a poll (you’ll need the Admin app enabled).Visithttp://127.0.0.1:8000/polls/to participate in the poll.
Package: rest-framework-apicontrol
djangorestframework-apicontrolThis is an App intended to control Clients Apps access over REST APIs.NoticePlease be carefull with the use of this package, and remember to backup your database before apply each migration.Permission Usage (APIKey)you only has to import the permission and use it in your rest_framework views, or in your settings.py file, as you prefer. e.g:"""Contact views."""fromrest_frameworkimportviewsetsfromrest_framework_apicontrol.permissionsimportHasApiKeyPermissionfrom.modelsimport(ContactInfo)from.serializersimport(ContactInfoSerializer)classContactInfoViewSet(viewsets.ModelViewSet):queryset=ContactInfo.objects.all()serializer_class=ContactInfoSerializerpermission_classes=[HasApiKeyPermission]authentication_classes=[]All the calls to this endpointMUST HAVEa header calledApi-Keywith the value of an App(App model in Django admin site)ModelsThis app comes with several models & mixins which provide useful common fields & functions, the models it provides are the following:To add those models to your app the only you need to do is addrest_framework_apicontrolto your projectINSTALLED_APPSsetting & then migrate your app.INSTALLED_APPS=[# Django default modules'django.contrib.admin','django.contrib.auth','django.contrib.contenttypes','django.contrib.sessions','django.contrib.messages','django.contrib.staticfiles',# Security & multi-app management'rest_framework_apicontrol',# Your project apps'...',]Notice:This project's models needs PostgreSQL as database because the use of JSONField in some of it's model fields.DonateIf this project is useful for you, please donate some dollars to help me improve this & others projects.My Paypal -http://paypal.me/mcuetodeveloper
Package: rest-framework-auth0
djangorestframework-auth0This library let you toauthenticatean specific user on DRF based on the JWT Token returned by Auth0 Javascript libraries.InstallationUsingpipto install current release:pipinstallrest_framework_auth0Usingpipto install development version:pipinstallgit+https://github.com/mcueto/djangorestframework-auth0/Quick startMake suredjango.contrib.authin on INSTALLED_APPS setting, otherwise add it by your own:INSTALLED_APPS=[...'django.contrib.auth',...]This will allow us to login as an specific user as well as auto-creating users when they don't existAddrest_framework_auth0to yourINSTALLED_APPSsetting:INSTALLED_APPS=[...,'rest_framework_auth0',]AddAuth0JSONWebTokenAuthenticationin your DEFAULT_AUTHENTICATION_CLASSES located at settings.py from your project:REST_FRAMEWORK={...,'DEFAULT_AUTHENTICATION_CLASSES':(...,'rest_framework_auth0.authentication.Auth0JSONWebTokenAuthentication',),}Add yourCLIENTS&MANAGEMENT_APIsettings in your settings.py file:# Import cryptography librariesfromcryptography.x509importload_pem_x509_certificatefromcryptography.hazmat.backendsimportdefault_backend# Read the your Auth0 client PEM certificatecertificate_text=open('rsa_certificates/certificate.pem','rb').read()certificate=load_pem_x509_certificate(certificate_text,default_backend())# Get your PEM certificate public_keycertificate_publickey=certificate.public_key()### AUTH0 SETTINGSAUTH0={'CLIENTS':{'default':{'AUTH0_CLIENT_ID':'<YOUR_AUTH0_CLIENT_ID>','AUTH0_AUDIENCE':'<YOUR_AUTH0_CLIENT_AUDIENCE>','AUTH0_ALGORITHM':'RS256',# default used in Auth0 apps'PUBLIC_KEY':certificate_publickey',}},# Management API - For roles and permissions validation'MANAGEMENT_API':{'AUTH0_DOMAIN':'<YOUR_AUTH0_DOMAIN>','AUTH0_CLIENT_ID':'<YOUR_AUTH0_M2M_API_MANAGEMENT_CLIENT_ID>','AUTH0_CLIENT_SECRET':'<YOUR_AUTH0_M2M_API_MANAGEMENT_CLIENT_SECRET>'},}Add theAuthorizationHeader to all of your REST API request, prefixingBearerto your token(default in common REST clients & Postman):Authorization: Bearer <AUTH0_GIVEN_TOKEN>That's it, now only your Auth0 users can request data to your DRF endpointsNOTE: In order to get the token authentication, the 'django.contrib.auth' app models migrations must be applied(python manage.py migrate).Use casesUse cases can be found hereSample ProjectA sample project can be foundhere
Package: rest_framework_custom_viewsets
=============================Rest Framework Custom ViewSets=============================.. image:: https://badge.fury.io/py/rest_framework_custom_viewsets.png:target: https://badge.fury.io/py/rest_framework_custom_viewsets.. image:: https://travis-ci.org/Darwesh27/rest_framework_custom_viewsets.png?branch=master:target: https://travis-ci.org/Darwesh27/rest_framework_custom_viewsetsDjango ModelViewSet extended for per view base extensions like Serializer Classes etc.Documentation-------------The full documentation is at https://rest_framework_custom_viewsets.readthedocs.org.Quickstart----------Install Rest Framework Custom ViewSets::pip install rest_framework_custom_viewsetsAdd it to the INSTALLED_APPS setting::INSTALLED_APPS += ('drf_custom_viewsets')Example::from drf_custom_viewsets.viewsets.CustomSerializerViewSetfrom myapp.serializers import CustomSerializer1, CustomSerializer2class MyViewSet(CustomSerializerViewSet):custom_serializer_class = {'GET':  CustomSerializer1,'POST': CustomSerializer2,}Then import it in a project::import drf_custom_viewsetsFeatures--------* TODORunning Tests--------------Does the code actually work?::source <YOURVIRTUALENV>/bin/activate(myenv) $ pip install -r requirements-test.txt(myenv) $ python runtests.pyCredits---------Tools used in rendering this package:*  Cookiecutter_*  `cookiecutter-djangopackage`_.. _Cookiecutter: https://github.com/audreyr/cookiecutter.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackageHistory-------0.0.1 (2016-05-25)++++++++++++++++++* First release on PyPI.
Package: restframework-definable-serializer
restframework-definable-serializerrestframework-definable-serializer is definable serializer by JSON or YAML format.FeatureIt can define restframework serializer by JSON or YAMLIt can write and modify serializer by django admin pages.Dependenciespython 3django>=1.11 or django>=2.2.7djangorestframework>=3.7.0django-codemirror2>=0.2django-jsonfield>=1.0.1django-yamlfield>=1.0.3PyYAML>=5.2ruamel.yaml>=0.13.5simplejson>=3.11.1six>=1.13.0Quick startInstall restframework-definable-serializerpip install restframework-definable-serializerAdd "definable_serializer" and "codemirror2" to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'definable_serializer',
    'codemirror2',
]DocumentationFor extensive Japanese documentation see the docs read it onReadthedocsTranslationTransifex(https://www.transifex.com/restframework-definable-serializer/restframework-definable-serializer-documentation/dashboard/)is used to manage translations.Feel free to improve translations.Currently supported languages are:JapaneseYou can request to add your own language directly on Transifex.Sample codeYou can try restframework-definable-serializer.
Seeexample_project
Package: rest-framework-factory
Rest Framework Factory (DRFF)A factory for creating Django Rest Framework APIsDocumentation:https://rest-framework-factory.readthedocs.io.FeaturesCreate a DRF API painlessly, without needing to repeat boilerplate codeInstallationpip install rest_framework_factoryRequirementsA Django project with at least one app’ from which you wish to build an DRF API included in INSTALLED_APPS, and with at least one model defined in models.pyHow it WorksThe Factory works because a model itself contains all the information required in order to generate an API for it, including a Serializer, a Viewset, URL(s) and other optional (e.g. Forms, Filters) contentTemplate files contain variable placeholders referencing the name and attributes of a modelTODOsWEB UI interface to generate factory apis interactivelyConfiguration files (YML?) to allow fine-grained control of the factory API, e.g. by including/excluding individual models and/or fields, setting allowed methods, etc.SwaggerSphinxUsageBasic Usage - Manual CreationIt is not necessary to add rest_framework_factory to INSTALLED_APPSOne common use case is to build a factory using all the models defined in an app:from rest_framework_factory import factory
drff = factory.Factory()
drff.build_from_app('my_app')
content = drff.apis['app']['my_app']
with open('/tmp/drff_api.py')), 'w') as f:
    f.write(data)Once the factory file is built, it should be placed into the apps’ folder, added to INSTALLED_APPS, and have its urls wired into the project:mkdir my_app/drff; touch my_app/drff/__init__.py; cp /tmp/drff_api.py ./my_app/drff/api.pysettings.py:INSTALLED_APPS += 'my_app.drff'urls.py:from my_app.drff.api import urlpatterns as drff_urls
urlpatterns += drff_urlsUsing the Factory UITODOScan all the apps, the models therein, and their fieldsBuild forms for each model/appToggle desired models/fields on-offSelect serializer type (ie ModelSerializer vs ReadOnlyModelSerializerSelect allowed API endpoint methos (ie GET, POST)Configuring the factory via YMLTODOInitiallize:  Scan all apps, the models therein, and their fields; write structure to fileManually edit file, comment out undesired fields and models, change permissions, etcImplement: Read yml file, generate factoryCreditsDjangoPackage created withCookiecutter.History0.1.0 (2019-01-22)First release on PyPI.
Package: rest-framework-material
rest-framework-materialMaterial Design for Django REST Framework API.The project aims to improve the look and feel of the API.Get startedInstall the package:pipinstallrest-framework-materialAddrest_framework_materialtoINSTALLED_APPSsetting, make sure that it's beforerest_framework# settings.pyINSTALLED_APPS=[...'rest_framework_material','rest_framework',...]I hope you find this useful.
Package: rest_framework_mixins
rest-framework-mixinsInstallationpip install rest_framework_mixinsUsageThis package provides all combinations of the mixins provided by rest_framework.All combinations follow the same format: `{initials}Mixin.The initials correspond to the following methods, in this specific order:L:list()R:retrieve()C:create()U:update()P:partial_update()D:delete()So for example, to import a mixin that gives us list, retrieve and create,
we can do the following:from rest_framework_mixins import LRCMixin

class CreateListRetrieveViewSet(LRCMixin, viewsets.GenericViewSet):
    """
    A viewset that provides `retrieve`, `create`, and `list` actions.

    To use it, override the class and set the `.queryset` and
    `.serializer_class` attributes.
    """
    passAdapted fromDRF's documentation
Package: rest-framework-money-field
Money field for Django REST frameworkAn serializer field implementation forDjango REST frameworkthat serializes
monetary types provided bypy-moneyedlibrary. Serialized data is compatible
withDinero.jsJavaScript library.Usage exampleFor example, if you would have an serializer like this:fromrest_framework.serializersimportSerializerfromrest_framework_money_fieldimportMoneyFieldclassProductSerializer(Serializer):price=MoneyField()And you would use the serializer with data like this:frommoneyedimportMoneyfromrest_framework.renderersimportJSONRendererserializer=ProductSerializer({"price":Money(50,"EUR")})json=JSONRenderer().render(serializer.data)You would end up with JSON like this:{"price":{"amount":5000,"currency":"EUR"}}
Package: rest-framework-nested
**This is a work in progress. It "works for me" at www.apiregistro.com.br,but I cannot warranty that it fully "works everywhere" yet.**drf-nested-routers=====================This package provides routers and relations to create nested resources in the [Django Rest Framework](http://django-rest-framework.org/)Nested resources are needed for full REST URL structure, if one resource lives inside another.The following example is about Domains and DNS Nameservers.There are many domains, and each domain has many nameservers. The "nameserver" resource does notexist without a domain, so you need it "nested" inside the domain.Installation------------You can install this library using pip:```pip install drf-nested-routers```Quickstart----------The desired URL signatures are:```\domain\ <- Domains list\domain\{pk}\ <- One domain, from {pk]\domain\{domain_pk}\nameservers\ <- Nameservers of domain from {domain_pk}\domain\{domain_pk}\nameservers\{pk} <- Specific nameserver from {pk}, of domain from {domain_pk}```How to do it (example):```python# urls.pyfrom rest_framework_nested import routersfrom views import DomainViewSet, NameserverViewSet(...)router = routers.SimpleRouter()router.register(r'domains', DomainViewSet)domains_router = routers.NestedSimpleRouter(router, r'domains', lookup='domain')domains_router.register(r'nameservers', NameserverViewSet)urlpatterns = patterns('',url(r'^', include(router.urls)),url(r'^', include(domains_router.urls)),)``````python# views.pyclass NameserverViewSet(viewsets.ViewSet):def list(self, request, domain_pk=None):nameservers = self.queryset.filter(domain=domain_pk)(...)return Response([...])def retrieve(self, request, pk=None, domain_pk=None):nameservers = self.queryset.get(pk=pk, domain=domain_pk)(...)return Response(serializer.data)```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: rest-framework-pagination
Django Rest Framework Multiple Queryset PaginationThis is django rest framework pagination based on LimitOffsetPagination with
multiple queryset supportInstallationInstall the package with pip:$pipinstallrest_framework_paginationUsagefromrest_framework.viewsetsimportGenericViewSetfromrest_framework.mixinsimportListModelMixinfromrest_framework_pagination.paginationimportMultiQuerysetPaginationclassMainPageView(ListModelMixin,GenericViewSet):serializer_class=serializers.MainPageSerializerpagination_class=MultiQuerysetPaginationquerysets=[models.Person.objects.all(),models.Order.objects.all(),models.Address.objects.all()]defget_queryset(self):returnself.querysetsdefpaginate_querysets(self,querysets):returnself.paginator.paginate(querysets,self.request,view=self)deflist(self,request,*args,**kwargs):page=self.paginate_querysets(self.get_queryset())serializer=self.get_serializer_class()(page,many=True)returnself.get_paginated_response(serializer.data)
Package: rest-framework-redesign
rest-framework-redesignRedesign of the browsable API of Django REST Framework using Bootstrap 5.This project is aimed at enhancing the user experience of the browsable API of Django REST Framework.
With a sleek and modern design, the API is now more user-friendly than ever before.
One of the most exciting features of the project is the support for dark mode.
This means that users can now switch to a darker color scheme, which is not only easier on the eyes but also looks incredibly cool.Our goal with rest-framework-redesign has always been to make it easier for developers to work with Django REST Framework.
We believe that by improving the user experience, we can help developers save time and be more productive.So if you're looking for a better way to work with Django REST Framework, be sure to check out rest-framework-redesign.
We're confident that you'll love it as much as we do!Get startedInstall the package:pipinstallrest-framework-redesignAddrest_framework_redesigntoINSTALLED_APPSsetting, make sure that it's beforerest_framework# settings.pyINSTALLED_APPS=[...'rest_framework_redesign','rest_framework',...]I hope you find this useful.