Saravanan666/pypi-org huggingface dataset:
Package: drf-shop-api
FeaturesFeatures:Productsproducts (multiple images + main image, title, description, etc.)products categories (parent/child categories)product dynamic statsproduct commentssearch for products/categoriesfilter for products in the categoryCustomerswish listscartcompare listsbonuses walletcustomer support requestSettingstaxescurrenciesOrdersordersorder reports (view and generation of pdf)shippingstatuses of order / payment / shipmentInstallationInstall librarypipinstalldrf-shop-apiAdd to installed appsINSTALLED_APPS=[...'drf_shop_api']Add api path to you root urls.pyurlpatterns=[...path("shop/",include("drf_shop_api.urls")),]Usecreate_shop_profiledecorator on create_user method of your UserManagerfromdjango.contrib.auth.base_userimportBaseUserManagerfromdrf_shop_api.decoratorsimportcreate_shop_profileclassUserManager(BaseUserManager):@create_shop_profiledefcreate_user(self,email,password=None):ifnotemail:raiseValueError("Enter the email")user=self.model(email=self.normalize_email(email))user.set_password(password)user.save(using=self._db)returnuserSetupAUTH_USER_MODELin settings.pyRunpython manage.py makemigrationsandpython manage.py migrate(Due to optional Payment model from root project)Optional settings:DRF_SHOP_PAGE_SIZEon will be default 10DRF_SHOP_PAYMENT_MODEL= "projects.payments.models.Payment"DRF_SHOP_PAYMENT_STATUS_CHOICES= "project.payments.choices.PaymentStatus"DRF_SHOP_BONUS_RATE= percentage value for each order that will go to bonus walletDependenciesdjango
drf
drf-yasg 1.21.5
rest_framework_simplejwt
mixer
django-filterTODOAdd DB indexesTask for currency rate updateReview permissions
Package: drf_shortcuts
DRF ShortcutsShortcuts for speeding up your development based on Django REST Framework (DRF).OverviewDRF shortcuts library allows you to:Expose your Django model class using a one-linerregister_standard_endpoint(your_router, YourModel). Exposed API endpoint will support search & ordering of items for suitable fields (backed up bySearchFilter&OrderingFilterfilter backends) and will be nicely documented in both Browseable API & upon issuingOPTIONSrequests against it.Createrest_framework.viewsets.ModelViewSetbased viewset class for your Django model using a one-linercreate_standard_viewset_class(YourModel). Viewset capabilities will be similar to the one registered usingregister_standard_endpointshortcut.Create JS-based clients friendly serializer class for your Django model using a one-linercreate_standard_serializer_class(YourModel).Use library classes & helper functions to tailor your own DRF shortcuts.RequirementsPython 3.6+Django 2.0+Django REST Framework 3.8+InstallationInstall using pip:pip install drf-shortcutsExamplesExposing a Django model:# in urls.py

from rest_framework.routers import DefaultRouter
from drf_shortcuts.urls import register_standard_endpoint

from my_fancy_app.models import MyModel


router = DefaultRouter()

register_standard_endpoint(router, MyModel)

# ... more URL configuration code here ...

urlpatterns = router.urlsCreating a viewset class:# in views.py

from drf_shortcuts.views import create_standard_viewset_class

from my_fancy_app.models import MyModel

MyModelViewSet = create_standard_viewset_class(MyModel)Creating a serializer class:# in serializers.py

from drf_shortcuts.serializers import create_standard_serializer_class

from my_fancy_app.models import MyModel

MyModelSerializer = create_standard_serializer_class(MyModel)Customizing a view using helpers:# in views.py

from rest_framework.viewsets import ReadOnlyModelViewSet
from drf_shortcuts.views import append_search_info_to_docstring
from drf_shortcuts.serializers import create_standard_serializer_class

from my_fancy_app.models import MyModel


@append_search_info_to_docstring
class MyModelViewSet(ReadOnlyModelViewSet):
    serializer_class = create_standard_serializer_class(MyModel)

    # ... rest of the view code ...DocumentationVisitproject's GitHub Pages.
Package: drf-simple-access-key
DRF Simple Access KeyA library that provides a simple token authorization for Django REST framework.InstallationWith acorrectly configuredpipenvtoolchain:pipenvinstalldrf-simple-access-keyYou may also use classicpipto install the package:pipinstalldrf-simple-access-keyGetting startedConfiguration optionsHTTP_AUTHORIZATION_HEADER: strDefault:'x-authorization'Name of the HTTP request header used for authorization.HTTP_AUTHORIZATION_SCHEME: strDefault:'bearer'Name of the HTTP authorization scheme.AUTHORIZATION_KEYS: list[str]Default:[]List of valid authorization keys. Note that any request is allowed if this configuration option is empty!Example configuration for Django settingsSIMPLE_ACCESS_KEY_SETTINGS={'HTTP_AUTHORIZATION_HEADER':'x-authorization','HTTP_AUTHORIZATION_SCHEME':'bearer','AUTHORIZATION_KEYS':['example-token-1234',],}REST_FRAMEWORK={# ...'DEFAULT_PERMISSION_CLASSES':['drf_simple_access_key.SimpleAccessKey',# ...],# ...}How to useAll API endpoints that use the permission class are protected by the simple access key authorization.GET http://my.tld/api/v1/resource/
x-authorization: bearer example-token-1234Supported versionsDjango REST framework 3.10Django REST framework 3.11Django REST framework 3.12Python 3.6✓✓✓Python 3.7✓✓✓Python 3.8✓✓✓Python 3.9✓✓✓Python 3.10✓✓✓PyPy3✓✓✓List of developersAndreas StockerAStocker@anexia-it.comHarald NezbedaHNezbeda@anexia-it.com
Package: drf-simple-api-signing
DRF Simple API Signing (SASigning) IntroductionSTATUSFirst Release (29 July 2018)API Signing BenefitsIdentity Verification: You are sure that the request is coming from who you are expecting.You are sure that the message is not altered in communication channels.You can prevent relay attack (optional).API Signing WorkflowPseudo code explaining steps of API Signing Check in API:1. Read a signature from header.
2. Construct the message. It may consist of
   * Secret Key
   * Request Method (PUT, GET, POST, ..)
   * URL Endpoint.
   * Request Body.
   * other arguments
those parameters are concatenated and separated by **delimeter** symbol.
3. Hash it with SHA256 using the Secret Key.What SASigning Do?SASigning provides an easy way to configure your API to accept, check and define signatures.
It allows you to review plugin the signature checking in your flow.SASIGNING DOCUMENTATIONVisitDocs.
Package: drf-simple-invite
Django Rest User InvitationThe primary aim of this python package is to provides a simple user invitation strategy for django rest framework, where users can be invited using invitation tokens (by sending email to the provided e-mail address).This package provides a REST endpoint that verifies an token and set the password for that particular user.Quick StartInstall the package from pypi using pip:pipinstalldrf-simple-inviteAdddrf_simple_inviteto yourINSTALLED_APPS(afterrest_framework) within your Django settings file:INSTALLED_APPS=['django.contrib.admin','django.contrib.auth','django.contrib.contenttypes','django.contrib.sessions','django.contrib.messages','django.contrib.staticfiles',# Third party apps'rest_framework',# utilities for rest apis'rest_framework.authtoken',# token# Simple Invite'drf_simple_invite',# Custom User Model'users',]This package provides an endpoint, which can be included by includingdrf_simple_invite.urlsin yoururls.pyas follows:fromdjango.urlsimportre_pathasurl,includeurlpatterns=[url(r'api/v1/invite/',include('drf_simple_invite.urls',namespace='drf_simple_invite')),]Note: You can adapt the api-url to your needs.EndpointsThe following endpoints are provided:POST ${API_URL}/- invite the user by sending the email as parameterPOST ${API_URL}/{invitation_token}-  set password token by using theinvitation_tokenparameterwhere${API_URL}/is the url specified in yoururls.py(e.g.,api/v1/invite/)
and{invitation_token}isbase64.urlsafeencoded uuid token. Since it is unsafe to use plain uuid, always make sure that the{invitation_token}isbase64.urlsafeencodedSignalsinvitation_token_created- Fired when a reset password token is generatedpre_password_creation- fired just before a password is being setpost_password_creation- fired after a password has been setTODO: Configuration / Settings / Management CommandThe following settings can be set in Djangosettings.pyfile:DJANGO_REST_INVITATION_TOKEN_EXPIRY_TIME- time in hours about how long the token is active (Default: 24)Please note: expired tokens are automatically cleared based on this setting in every call ofpostmethod on this endpoint.
Package: drf-simplejwt-additions
DRF SimpleJWT additionsAdditional features fordjango-rest-framework-simplejwt.FeaturesFull user info in TokenObtainPairSerializerFull user info in TokenObtainPairViewAuto creation of user from tokenInstallationpipinstalldrf-simplejwt-additionsUsageNote: for all these features you need to set sameSECRET_KEYandSIMPLE_JWT['ALGORITHM']in all services.Full user info in TokenObtainPairSerializerInsettings.py:INSTALLED_APPS=[...'drf_simplejwt_additions',...]...SIMPLE_JWT={..."TOKEN_OBTAIN_SERIALIZER":"drf_simplejwt_additions.serializers.TokenObtainPairWithFullUserSerializer",...}From now on, the response of theTokenObtainPairViewwill contain the full user info.Serializer get all fields from the user model.Then theses fields are added to the response in theuserfield.User's password is also added to the response. But it's encrypted twice:First time by Django itselfSecond: JWT encryptionAuto creation of user from tokenThis feature is useful in microservices architecture.
Token, obtained from one service, can be used in another service to get user info.
So, if the user doesn't exist in the second service, it will be created automatically.Insettings.py:INSTALLED_APPS=[...'drf_simplejwt_additions',...]...MIDDLEWARE=[...'drf_simplejwt_additions.middleware.AutoCreateUserFromTokenMiddleware',...]...REST_FRAMEWORK={...'DEFAULT_AUTHENTICATION_CLASSES':(...'rest_framework_simplejwt.authentication.JWTAuthentication',...),...}django-rest-framework-simplejwt has great feature:TokenUserAuthentication.
But it doesn't create user automatically.Full user info in TokenObtainPairViewInurls.py:fromdrf_simplejwt_additions.viewsimportTokenObtainPairWithFullUserViewurlpatterns=[...path('api/token/',TokenObtainPairWithFullUserView.as_view(),name='token_obtain_pair'),...]TheTokenObtainPairWithFullUserViewis a subclass ofTokenObtainPairViewwith theTokenObtainPairWithFullUserSerializerserializer.LicenseMIT
Package: drf-smart-filters
drf-smart-filtersSkeleton project created by Cookiecutter PyPackageDocumentation:https://wccdev.github.io/drf-smart-filtersGitHub:https://github.com/wccdev/drf-smart-filtersPyPI:https://pypi.org/project/drf-smart-filters/Free software: MITFeaturesTODOCreditsThis package was created withCookiecutterand thewccdev/cookiecutter-pypackageproject template.
Package: drf-social-auth
drf_social_authdrf_social_auth is an ultra-lightweight solution for social authentication support in Django REST Framework.
And it supports Google Authentication out-of-box.Source codehttps://github.com/coaxsoft/drf-social-auth/RequirementsPython 3.6+Django 3.0+Django REST Framework 3.11+Installationpip install drf-social-authUsageUse built-in Google AuthenticationYou must specify the following Google settings in yoursettings.py:GOOGLE_CLIENT_ID= 
GOOGLE_CLIENT_SECRET=
GOOGLE_REDIRECT_URI=Add the following to yoururls.py.from rest_framework_social_auth.google import GoogleLogin

urlpatterns = [
    path('google/', GoogleLogin.as_view(), name='google-login')
]It's done! You can send yourcode,grant_typeandscope(if any) to this endpoint to retrieve profile info from Google Account.Create your own solution for other social authentication providerYou need to create an adapter for your provider.This can be done by inheriting fromAdapterabstract class and overridingget_access_token_dataandget_profile_datamethods.You should also specifyaccess_token_urlandprofile_urlendpoints.It is better to useGoogleAdapterinrest_framework_social_auth.googleas an example.from rest_framework_social_auth.adapter import Adapter

class YourProviderAdapter(Adapter):
    passNow you need to create a View and specify your adapter.from rest_framework_social_auth.views import SocialLoginView

class YourProviderLogin(SocialLoginView):
    adapter = YourProviderAdapter()Create an endpoint inurls.pyusing your View and you are good to go.TestingtoxLicenseThis project is licensed under the terms of the ISC License
Package: drf-social-oauth2
InstallationThis framework is published at the PyPI, install it with pip:pip install drf_social_oauth2Link to documentationYou can read the whole drf-social-oauth2’s documentation at:https://drf-social-oauth2.readthedocs.io/en/latest/.ContributingDetailshereWhat Am I Working Next?I will be working on the issues below. Anyone is welcome to contribute.Investigating Issues.
Package: drf_spectacular_extensions
drf_spectacular_extensionsInstallationUsing pippip install drf_spectacular_extensionsUsing pipenvpipenv install drf_spectacular_extensionsQuick startIn your project’ssettings.py.SPECTACULAR_SETTINGS: Dict[str, Any] = {
    ...
    "POSTPROCESSING_HOOKS": [
        "drf_spectacular_extensions.postprocessing_hooks.add_servers",
    ]
}
Package: drf-spectacular-jsonapi
open api 3 schema generator fordrf-json-apipackage based ondrf-spectacularpackage.Tested with various dependency versionTested for versions in combination:pythondjangodrf-spectacular3.84.00.25.x3.94.10.26.x3.104.20.27.x3.115.0InstallationNoteInstalldjango-rest-framework,django-rest-framework-json-apianddrf-spectacularas described by them first.Install usingpip…$pipinstalldrf-spectacular-jsonapithen configure the rest framework and drf-spectacular with the following settings inside your projectsettings.pyREST_FRAMEWORK={# YOUR SETTINGS"DEFAULT_SCHEMA_CLASS":"drf_spectacular_jsonapi.schemas.openapi.JsonApiAutoSchema","DEFAULT_PAGINATION_CLASS":"drf_spectacular_jsonapi.schemas.pagination.JsonApiPageNumberPagination",}SPECTACULAR_SETTINGS={# To provide different schema components for patch and post"COMPONENT_SPLIT_REQUEST":True# to fix path parameter names for nested routes https://chibisov.github.io/drf-extensions/docs/#nested-routes"PREPROCESSING_HOOKS":["drf_spectacular_jsonapi.hooks.fix_nested_path_parameters"],}Release managementSame as the baseddrf-spectacularpackage, we provide versions below sem version1.x.xto signal that every new version may potentially break you.
Package: drf-spectacular-sidecar
Serve self-contained distribution builds ofSwagger UIandRedocwithDjangoeither viarunserverorcollectstatic.This Django app is an optional addition todrf-spectacular, but does not depend on it. It may also be used independently.Swagger UIversion5.11.2(npm)Redocversion2.1.3(npm)This is a self-updating and self-publishing repository that looks for updates once a week.
The distribution files are sourced from npm viajsdelivr, validated, packaged and uploaded toPyPI.Installation$pipinstalldrf-spectacular-sidecarThe package needs to be registered to allow Django to discover the static files.INSTALLED_APPS=[# ALL YOUR APPS'drf_spectacular_sidecar',]RequirementsDjango >= 2.2LicensesProvided byT. Franzel.Licensed under 3-Clause BSD.This package includes distribution builds ofSwagger UI: Theoriginal license (Apache 2.0)and copyright apply to those files.Redoc: Theoriginal license (MIT)and copyright apply to those files.
Package: drf-spirit
# DRF-SpiritA pluggable django forum application build with Django Rest Framework inspired from [Spirit](https://github.com/nitely/Spirit).---# Requirements* Python (2.7.x)* Django (1.8, 1.9, 1.10)* Django Rest Framework (3.5+)# InstallationAdd `'drf_spirit'` to your `INSTALLED_APPS` setting.INSTALLED_APPS = (...'drf_spirit',)# SettingsAdding ``USER_SLUG_FIELD`` configuration in the settings will allow you to use user slug instead of pk for user relationship. You can do like following:DRF_SPIRIT = {'USER_SLUG_FIELD': 'slug'}
Package: drf-spreadsheets
Django REST Spreadsheets rendererThis project pulls work fromdrf-renderer-xlsxanddjango-rest-framework-csvaiming to combine these renderers
into a single package while fixing some of their individual quirks.DifferencesAn important use case for file export in a RESTful API is to allow the user to manipulate data using their own tools.
While pagination is useful for endpoints where you don't need to see all the data, they don't make sense for these types
of file export. This project will handle pagination by ignoring it, serializing the entire queryset.In addition, to enable CSV/XLSX on an endpoint, all that needs to be done is adding a single mixin like such:from drf_spreadsheets.mixins import SpreadsheetMixIn

class YourViewSet(SpreadsheetMixIn, ModelViewSet):
    ...This instead of manually overridingrenderer_classes, or adding the renderer to the defaults. The former is clunky and
can lead to unwanted behavior, and the latter is rarely necessary since there will be many endpoints that don't need
spreadsheet exports in most projects.One regression is in XLSX styling. For the initial version of this package, no styling can be applied to generated
XLSX files. Since this is not an essential feature for most export use-cases, it has been left as a potential future featureUsageTo use this package, simply add theSpreadsheetMixInto a ViewSet! By default, both CSV and XLSX formats will be
available on that view. There are six fields provided bySpreadsheetMixIn:fielddefaultuseenable_csvTrueAllows CSV format to be accessed on that particular ViewSetenable_xlsxTrueAllows XLSX format to be accessed on that particular ViewSetenable_spreadsheets_on_detailsFalseAllows the CSV and/or XLSX renderers to be used on detail views (ie not list views)enable_renderer_defaultsTrueAllows the default renderers found in api_settings to also be used. If set to false, exclusively the spreadsheet renderers will be usedfilenameNoneOverrides the auto-generated filename of the form "<Model name> Report" or "<View name> Report" if no model is availablespreadsheet_headersNoneOverrides the auto-generated columns with either a list or a dictionary. If it is set to be a dictionary, the keys will be columns to include and the values will be their names/labels.compact_columnsFalseRenders secondary data structures as json strings instead of creating new columns for their childrenAn alternative to providingspreadsheet_headersas a field throughSpreadsheetMixInis providing it via overriding
theget_renderer_context()method. For exampledef get_renderer_context(self):
        context = super(MyViewSet, self).get_renderer_context()
        if 'headers' in self.request.GET:
            context["spreadsheet_headers"] = self.request.GET['headers'].split(',')
        return context
Package: drf-spreadsheets-jpaavola
Django REST Spreadsheets rendererThis project pulls work fromdrf-renderer-xlsxanddjango-rest-framework-csvaiming to combine these renders into
a single package while fixing some of their individual quirks.DifferencesAn important use case for file export in a RESTful API is to allow the user to manipulate data using their own tools.
While pagination is useful for endpoints where you don't need to see all the data, they don't make sense for these types
of file export. This project will handle pagination by ignoring it, serializing the entire queryset.In addition, to enable CSV/XLSX on an endpoint, all that needs to be done is adding a single mixin like such:from drf_spreadsheets.mixins import SpreadsheetMixIn

class YourViewSet(SpreadsheetMixIn, ModelViewSet):
    ...This instead of manually overriding renderer_classes, or adding the renderer to the defaults. The former is clunky and
can lead to unwanted behavior and the latter is rarely necessary since there will be many endpoints that don't need
spreadsheet exports in most projects.One regression is in XLSX styling. For the initial version of this package, no styling can be applied to generated
XLSX files. Since this is not an essential feature for most export use-cases, it has been left as a potential future feature
Package: drf-standardized-errors
DRF Standardized ErrorsStandardize yourDRFAPI error responses.By default, the package will convert all API error responses (4xx and 5xx) to the following standardized format:{"type":"validation_error","errors":[{"code":"required","detail":"This field is required.","attr":"name"},{"code":"max_length","detail":"Ensure this value has at most 100 characters.","attr":"title"}]}{"type":"client_error","errors":[{"code":"authentication_failed","detail":"Incorrect authentication credentials.","attr":null}]}{"type":"server_error","errors":[{"code":"error","detail":"A server error occurred.","attr":null}]}FeaturesHighly customizable: gives you flexibility to define your own standardized error responses and override
specific aspects the exception handling process without having to rewrite everything.Supports nested serializers and ListSerializer errorsPlays nicely with error monitoring tools (like Sentry, ...)Requirementspython >= 3.8Django >= 3.2DRF >= 3.12QuickstartInstall withpippipinstalldrf-standardized-errorsAdd drf-standardized-errors to your installed appsINSTALLED_APPS=[# other apps"drf_standardized_errors",]Register the exception handlerREST_FRAMEWORK={# other settings"EXCEPTION_HANDLER":"drf_standardized_errors.handler.exception_handler"}NotesThis package is a DRF exception handler, so it standardizes errors that reach a DRF API view. That means it cannot
handle errors that happen at the middleware level for example. To handle those as well, you can customize
the necessarydjango error views.
You can find more about that inthis issue.Standardized error responses whenDEBUG=Trueforunhandled exceptionsare disabled by default. That is
to allow you to get more information out of the traceback. You can enable standardized errors instead with:DRF_STANDARDIZED_ERRORS={"ENABLE_IN_DEBUG_FOR_UNHANDLED_EXCEPTIONS":True}Integration with DRF spectacularIf you plan to usedrf-spectacularto generate an OpenAPI 3 schema,
install withpip install drf-standardized-errors[openapi]. After that, check thedoc pagefor configuring the integration.LinksDocumentation:https://drf-standardized-errors.readthedocs.io/en/latest/Changelog:https://github.com/ghazi-git/drf-standardized-errors/releasesCode & issues:https://github.com/ghazi-git/drf-standardized-errorsPyPI:https://pypi.org/project/drf-standardized-errors/LicenseThis project isMIT licensed.
Package: drf-stripe
Django REST Framework wrapper of the payments Django app for StripeInstallpip install drf-stripeAdd ‘payments’ to INSTALLED_APPSAdd to urls.py:url(r"^api/stripe/",include("payments.api.urls"))Endpointscurrent-user/ (GET)subscription/ (GET/POST)change-card/  (GET/POST)charges/      (GET)invoices/     (GET)plans/        (GET)events/       (GET)webhook/      (POST)cancel/       (POST)Plans“premium”: {“name”: “Premium”, “stripe_plan_id”: “price_1L6TduCWdky3mdpH4wCEdKvf”},
Package: drf-swagger-extras
drf-swagger-extrasThis package provides OpenAPI documentation Python decorators for Django
REST Framework APIViews.This module provides a patched SchemaGenerator that enhances current
CoreAPI-based data that is grabbed by REST Framework with documentation
provided by decorators found in this package.We allow documenting different response types and formats, and each HTTP
status code along with a schema and examples of the expected outcome.We also provide optional API comments based on the function’s
docstrings.Usage~ to be filled ~ContributingThis project uses the GitHub Flow approach for contributing, meaning
that we would really appreciate it if you would send patches as Pull
Requests in GitHub. If for any reason you prefer to send patches by
email, they are also welcome and will end up integrated here.LicenseThis code is released under a MIT License.