Saravanan666/pypi-org huggingface dataset:
Package: django-ninja-fsbr
django-ninja-fsbrFile-System Based Routing for django-ninjaWhyTo enforce an opinionated project structure, that does not make me think.To enable easily mapping routes/endpoints to files.For fun. :)UsageThe usage is most easily explained using an example.
Let's say you want to have the following API:/products/ GET, POST
/products/<product_id>/ GET
/products/<product_id>/stock/ GET, PUTYou can achieve this using the following directory layout:├── root.py
└── views
    └── products
        ├── index.py
        ├── __init__.py
        └── product_id
            ├── index.py
            ├── __init__.py
            └── stock.pyTherootmodule contains the definition of a router which specifies the base directory, that your automatic routes
will be relative to:fromninja_fsbrimportFilesystemBasedRouterapi=NinjaApi(...)router=FilesystemBasedRouter(views_module="root.views")router.auto_discover()api.add_router("api/",router)To define an "auto" route, just use the@router.auto_routedecorator instead django-ninja's@router.<method>decorators:fromrootimportrouter@router.auto_route(methods=["GET"],# optional, if method name starts with get_ (or any other HTTP method name)...# other django-ninja arguments here)defget_stock(request,product_id):...ConventionsAny directory with the ending_idwill be treated as a path parameter in the generated route.Theindex.pywill resolve to the path itself.The supported HTTP method can be set by either passing amethodsargument toauto_routeor by prefixing the view function with the verbs i.e. get_put_stock (to support both GET and PUT requests)Routes are sorted by name
Package: django-ninja-keycloak
django-ninja-keycloakFor review- seehttps://gitlab.com/django-ninja/django-ninja-keycloakdjango-ninja-keycloakis a not official Django Ninja package to providing easy to use bearer token or basic auth  authentication with django ninja flowInstallationVia Pypi Package:$ pip install django-ninja-keycloakor$ pipenv install django-ninja-keycloakDependenciesdjango-ninja-keycloak depends on:Python 3python-keycloakdjango-ninjaBug reportsPlease report bugs and feature requests athttps://gitlab.com/django-ninja/django-ninja-keycloak/issuesUsageBearer Authkeycloak_bearer_auth = KeycloakAuthBearer('https://keyclaokhost/auth/',
                                         'client_id',
                                         'realm_name',
                                         'client_secret_key',
                                         'algorithm',            # optionnal  default='RS256'
                                         options,                # optionnal  default= {"verify_signature": True, "verify_aud": True, "verify_exp": True}
                                         roles)                  # optionnal  default= []

@api.get("/bearer", auth=keycloak_bearer_auth)
def bearer(request):
    return {"token": request.auth}`Basic Authkeycloak_basic_auth = KeycloakBasicAuth('https://keyclaokhost/auth/',
                                         'client_id',
                                         'realm_name',
                                         'client_secret_key',
                                         'algorithm',            # optionnal  default='RS256'
                                         options,                # optionnal  default= {"verify_signature": True, "verify_aud": True, "verify_exp": True}
                                         roles)                  # optionnal  default= []

@api.get("/basic", auth=keycloak_basic_auth)
def bearer(request):
    return {"token": request.auth}`Request.auth payload{
        "userInfo": {
            "email_verified": '',
            "preferred_username": '',
            "name": '',
            "given_name": '',
            "family_name": '',
            "email": '',
            "sub": '',
        },
        "roles": []
    }
Package: django-nlf
Django Natural Language FilterDjango NLF provides a simple and easy way to express complex filtering criteria with a filtering language as close to natural language as possible, while providing APIs to further customize the user experience.InstallationInstall usingpip,pip install django-nlfAnd adddjango_nlfto yourINSTALLED_APPS.INSTALLED_APPS=[..."django_nlf",]Then you can use theDjangoNLFilterwith a queryset and a string, containing the filter expression. Please see theLanguage Referencefor more details.fromdjango_nlf.filtersimportDjangoNLFilterfrom.modelsimportArticlenl_filter=DjangoNLFilter()qs=Article.objects.all()q="author.username is john or title contains news"# equivalent to Article.objects.filter(Q(author__username="john") | Q(title__icontains="news"))articles=nl_filter.filter(qs,q)# Nested logical operators are also supported:q="author.username is john and (title contains news or created_at <= 2020-06-05)"# equivalent to# Article.objects.filter(#   Q(author__username="john") & (Q(title__icontains="news") | Q(created_at__lte="2020-06-05"))# )articles=nl_filter.filter(qs,q)Django REST framework integrationSimply add the natural language filter backend to your filter backends list.REST_FRAMEWORK={"DEFAULT_FILTER_BACKENDS":("django_nlf.rest_framework.DjangoNLFilterBackend",),}
Package: django-nmb
django-nmbA Django application which assist on integration of your web application with NMB BANK Merchant payment gateway with easy step.docsPrerequisitesPython 3.6+Pip or PipenvIt will CoverGenerate sessionID to initiate paymentCover Hosted Checkout and Hosted Session on "example" module found on githubhereDirect paymentBatch paymentInstallationThis package is available inPython Package Indexand can be installed usingpiporpipenvRunpip install django-nmbAddnmbtoINSTALLED_APPSRunpip install requestsUsageRegister account on NMB Ecommerce merchant by visit on NMB Branch near you and your will get the following credentials for testingMERCHANT IDMERCHANT API PASSWORDOpen "settings.py" on your project, set the following variablesMERCHANT_ID = "your merchant id"API_USERNAME = "merchant.merchant_id"API_PASSWORD = "your api password"API_ADDRESS = "https://test-nmbbank.mtf.gateway.mastercard.com/api/rest/version/60/merchant/{merchant_id}/session"After setting above,Then on your views.py file.fromdjango.confimportsettingsfromnmb.paymentimportAPIContext,APIMethodType,APIRequestdefget_sessionID(request):merchant_id=settings.MERCHANT_IDapi_password=settings.API_PASSWORDapi_username=settings.API_USERNAMEaddress=settings.API_ADDRESS# Create Context with API to request a Session IDapi_context=APIContext()# API USERNAMEapi_context.api_username=api_username# API Passwordapi_context.api_password=api_password# API addressapi_context.address=address# Method type (can be GET/POST)api_context.method_type=APIMethodType.POST# Define your purchaces parametersparameters={'apiOperation':'CREATE_CHECKOUT_SESSION','interaction':{'operation':'PURCHASE',},'order':{'id':"2",'amount':100.0,'currency':'TZS','reference':'99676542','description':'A pair of shoes'}}# add parameters on request sessionapi_context.parameters=parameters#Do the API call and put result in a response packetapi_request=APIRequest(api_context)result=Nonetry:result=api_request.execute()exceptExceptionase:print('Call Failed:',e)ifresultisNone:raiseException('Call failed to get result. Please check.')print(result.headers)print(result.body)returnJsonResponse(data=result.body,safe=False)sample response{"merchant":"993755100084","result":"SUCCESS","session":{"id":"SESSION0002323910607J44443070E2","updateStatus":"SUCCESS","version":"f7f4198201"},"successIndicator":"6d7323cd979444f2"}For full example on how to integrate please visit the github repo on example folder you will find all source codeshereGive it a starIf you found this repository useful, give it a star so as the whole community of Tanzania developers can get to know it.Bug bounty?If you encounter issue with the usage of the package, feel free raise an issue so as we can fix it as soon as possible(ASAP).Pull RequestsIf you have something to add I welcome pull requests on improvement , you're helpful contribution will be merged as soon as possible
Package: django-nmrpro
The App provides a web interface to the python package, effectively compressing and reformatting NMR spectra into JSON formats. The App also stores users’ spectra in a database along with their processing history. Also, the App collects all plugins from the python package and transfers them to the client-side, where they are rendered as GUI.InstalltionInstallpython 2.7and pip package manager.From the terminal console, install NMRPro python package using the command:pip install nmrproOn Windows, from the command prompt:python -m pip install nmrproInstall the django-nmrpro App using the command:pip install django-nmrproOn Windows:python -m pip install django-nmrpropip command automatically installs all necessary package dependencies.There is no need to install SpecdrawJS separately since it is included in the Django App.Runnig NMRPro serverOnce the Django App is installed, the user can integrate it into an existing Django project. To summarize the integration process, briefly:If you do not have an existing Django project, first create one by followingthis tutorial.Insettings.py, add django_nmpro to yourINSTALLED_APPS.Inurls.py, add the following patternurl(r'^',include('django_nmrpro.urls')),.From the terminal console (command prompt on Windows), navigate to the project home directory and run the web server using the command:python manage.py migrateRun the server using the command:python manage.py runserverTo make sure that installation is successful, visit the URLhttp://127.0.0.1:8000/nmrpro_test/, which should display 5 spectra from the Coffees dataset.
Package: django-nocaptcha-recaptcha
[![Build Status](https://travis-ci.org/ImaginaryLandscape/django-nocaptcha-recaptcha.svg?branch=master)](https://travis-ci.org/ImaginaryLandscape/django-nocaptcha-recaptcha)# SUMMARYAdd new-style Google ReCaptcha widgets to your Django forms simply by adding aNoReCaptchaField field to said forms.# ABOUTIn late 2014, Google updated their ReCaptcha service, changing its API.  The update significantlychanges the appearance and function of ReCaptcha.  This has been referred to asReCaptcha 2 or "nocaptcha recaptcha".This module is intended to be a successor to django-recaptcha to support the new styleGoogle Recaptcha.  It borrows a lot of the logic from the django-recaptcha, but has beenupdated to support the Google change.For the Google documentation for this service, visit the following:https://developers.google.com/recaptcha/introThe original django-recaptcha project is located at the following location:https://github.com/praekelt/django-recaptcha# FEATURES- Implements Google's New "NoCaptcha ReCaptcha Field"- Uses the fallback option for browsers without JavaScript- Easy to add to a Form via a FormField- Works similar to django-recaptcha- Working demo projects- Works with Python 2.7 and 3.4# INSTALLpip install django-nocaptcha-recaptcha# CONFIGUREAdd nocaptcha_recaptcha to your INSTALLED_APPS settingAdd the following to settings.pyRequired settings:NORECAPTCHA_SITE_KEY  (string) = the Google provided site_keyNORECAPTCHA_SECRET_KEY (string) = the Google provided secret_keyOptional Settings:NORECAPTCHA_VERIFY_URL (string) = reCaptcha api endpoint for verification.Best to leave this as the default setting.Default is https://www.google.com/recaptcha/api/siteverifyNORECAPTCHA_WIDGET_TEMPLATE (string) = location for the widget template.Default is nocaptcha_recaptcha/widget.htmlAdd the field to a form that you want to protect.from nocaptcha_recaptcha.fields import NoReCaptchaFieldclass DemoForm(forms.Form):.....captcha = NoReCaptchaField()Add Google's JavaScript library to your base template or elsewhere, so it isavailable on the page containing the django form.<script src="https://www.google.com/recaptcha/api.js" async defer></script>(optional)You can customize the field.- You can add attributes to the g-recaptcha div tag through the followingcaptcha = NoReCaptchaField(gtag_attrs={'data-theme':'dark'}))- You can override the template for the widget like you would anyother django template.# DEMO PROJECTThe demo project includes a fully working example of this module.To use it, run the following:cd demoexport NORECAPTCHA_SITE_KEY="<your site key>"export NORECAPTCHA_SECRET_KEY="<your secret key>"./manage.py runserver# in a browser, visit http://localhost:8000# TESTINGpython setup.py test
Package: django-node-assets
The Django application that allows to install and to serve static assets via Node.js package manager infrastructure.
The application exposes management command to install dependencies from yourpackage.jsonand several static files
finders to find files from installed node packages and exclude metadata of node packages and unwanted files when
static files will be collected via Django`scollectstaticmanagement command execution.FeaturesAvoiding vendoring static assets in your repository like jQuery plugins, Bootstrap toolkit, etcAvoiding mess inSTATIC_ROOTthrough exclusion node packages` metatadata and unwanted filesInstalling dependencies by Django`s management commandInstallation$pipinstalldjango-node-assetsConfigurationAdd ‘django_node_assets’ to your INSTALLED_APPS:INSTALLED_APPS=[...'django_node_assets',]Add NodeModulesFinder to STATICFILES_FINDERS:STATICFILES_FINDERS=['django.contrib.staticfiles.finders.FileSystemFinder','django.contrib.staticfiles.finders.AppDirectoriesFinder','django_node_assets.finders.NodeModulesFinder',]Specify absolute path to the package.json file:NODE_PACKAGE_JSON='/var/assets/package.json'NoteA package.json must have the “dependencies” section and look like:{"dependencies":{"jquery":"^3.2.1","bootstrap":"^3.3.5",}}Details here:https://docs.npmjs.com/files/package.json#dependenciesSpecify the absolute path to a directory where thenmpinstallmanagement command will install assets:NODE_MODULES_ROOT='/var/assets/node_modules'NoteA base dir must be callednode_modules.Override path to the node package manager executable (optional)NODE_PACKAGE_MANAGER_EXECUTABLE='/usr/local/bin/npm'NoteThe node package manager must be already installed in your system.UsageCall thenmpinstallmanagement command to install dependencies specified in the package.json$pythonmanage.pynpminstallUse Django`s static template tag to link installed assets{% load static %}<linkrel="stylesheet"type="text/css"href="{% static 'bootstrap/dist/css/bootstrap.min.css' %}"><!-- Some amazing markup --><scriptsrc="{% static 'jquery/dist/jquery.min.js' %}"></script><scriptsrc="{% static 'bootstrap/dist/js/bootstrap.js' %}"></script>
Package: django-nofloc
django-noflocdjango-nofloc is a simple Django app that provides a middleware to let
Google Chrome know that your website should not be included in the
Google FLoC program. Essentially you’re opting out of this privacy
invading program that is default for all Chrome users.Version:0.1.0Project Links:Mailing
List-ContributingAuthor:Peter Sanchez (https://netlandish.com)Because this is a simple middleware we have no issue tracker for it. If
there are any issues please send an email to themailing
list.Python / Django SupportPython 3.6+ for Django versions 2.2+InstallationPIP:pip install django-noflocBasic Manual Install:$ python setup.py build
$ sudo python setup.py installThen just add thenofloc.middleware.NoFLoCMiddlewareto yourMIDDLEWAREsetting. The placement order shouldn’t matter.MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'nofloc.middleware.NoFLoCMiddleware',
]This will set thePermissions-Policyheader to a value ofinterest-cohort=()for every request served by Django.If you need to alter this header within a view or some other case, this
app may not be a good tool for you to use in it’s current state. It’s
set specifically to disable FLoC. Review your use case before installing
this app. You can also submit a patch to make this more configurable if
you’d like :)Why?Because we’re tired of big tech spying on us. For more info see:https://plausible.io/blog/google-flocContributingWe accept patches submitted viahg emailwhich is thepatchbombextension included with Mercurial.The mailing list where you submit your patches is~netlandish/public-inbox@lists.code.netlandish.com. You can also
view the archives on the web here:https://lists.code.netlandish.com/~netlandish/public-inboxTo quickly setup your clone ofdjango-noflocto submit to the
mailing list just edit your.hg/hgrcfile and add the following:[email]
to = ~netlandish/public-inbox@lists.code.netlandish.com

[patchbomb]
flagtemplate = "django-nofloc"

[diff]
git = 1We have more information on the topic here:ContributingUsing email with
MercurialMailing list
etiquetteCopyright & WarrantyAll documentation, libraries, and sample code are Copyright 2021
Netlandish Inc. <hello@netlandish.com>. The library and sample code are
made available to you under the terms of the BSD license which is
contained in the included file, LICENSE.
Package: django-no-floc
Middleware to opt out of Google’s FLoC cohort tracking.DocumentationThe full documentation is athttps://django-no-floc.readthedocs.io.QuickstartInstall django-no-floc:pip install django-no-flocAdd it to yourINSTALLED_APPS:MIDDLEWARE=(...'no_floc.middleware.NoFLoCMiddleware',...)Running TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxDevelopment commandspip install -r requirements_dev.txt
invoke -lCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.0 (2021-04-09)First release on PyPI.
Package: django-nojs
Simple application to plug to manage “javascript disabled” eventsInstallationAddnojsto yourINSTALLED_APPS:INSTALLED_APPS = (
        ...,
        ...,
        'nojs',
    )Adddjango.core.context_processors.requestanddjango.core.context_processors.staticto yourTEMPLATE_CONTEXT_PROCESSORS:TEMPLATE_CONTEXT_PROCESSORS = ("django.contrib.auth.context_processors.auth",
                           "django.core.context_processors.debug",
                           "django.core.context_processors.i18n",
                           "django.core.context_processors.media",
                           "django.core.context_processors.static",
                           "django.core.context_processors.request",
                           "django.contrib.messages.context_processors.messages")Into your templates:<link href="{{ STATIC_URL }}nojs/nojs.css" rel="stylesheet" type="text/css" media="screen" />

<body>
{% checkjs %}
</body>
Package: django-nokia
[![Build Status](https://travis-ci.org/orcasgit/django-nokia.svg?branch=master)](https://travis-ci.org/orcasgit/django-nokia) [![Coverage Status](https://coveralls.io/repos/orcasgit/django-nokia/badge.png)](https://coveralls.io/r/orcasgit/django-nokia) [![Requirements Status](https://requires.io/github/orcasgit/django-nokia/requirements.png?branch=master)](https://requires.io/github/orcasgit/django-nokia/requirements/?branch=master)Django-nokia is a Django app for integrating a user’s Nokia data into your
site.It handles the details of getting your app authorized to access your user’s
Nokia data via the Nokia Health API.NOTE: If you are coming from django-withings, there are some
[extra steps](docs/migrate_from_withings.rst) needed to migrate.Documentation is hosted on <http://django-nokia.readthedocs.org>.
Package: django-no-last-login
=====django-no-last-login=====This is a extremely simple way to disable Django's behavior of updating a user last_login field on login.You could use this to connect a Django app to a read-only database, such as a replica, and still having a more or less functional application.Quick start-----------1. Add "nolastlogin" to your INSTALLED_APPS setting like this:::INSTALLED_APPS = [...'nolastlogin',]2. Add this to the settings:::NO_UPDATE_LAST_LOGIN = True
Package: django-no-lazy-queries
A decorator to help remind you to use select_related.Only use this while in development. Leaving it in production is a bad idea.fromnolazyqueriesimportno_lazy_queries@no_lazy_queries()defsome_view(request):# Will raise an exceptionFoo.objects.first().bar# Will not raise an exceptionFoo.objects.select_related('bar').first().bar
Package: django-nomadblog
This is a basic Django application implementing the simplest form of a
blogging system. It’s able to handle multible blogs and users.
It has been written with an eye put on keeping modularity and flexibility as
much as possible, so you won’t find lots of goodies in the code (tagging,
related posts, blogroll), but just a couple of features to help you start
hacking it to your needs.Read the latest documentation on the fineRead the docsproject for install,
configuration and customization instructions.
Package: django-nomad-blog
This is a basic Django application implementing the simplest form of a
blogging system. It’s able to handle multible blogs and users.
It has been written with an eye put on keeping modularity and flexibility as
much as possible, so you won’t find lots of goodies in the code (tagging,
related posts, blogroll), but just a couple of features to help you start
hacking it to your needs.Read the latest documentation on the fineRead the docsproject for install,
configuration and customization instructions.
Package: django-nomad-notifier
This Django app provides a way to implement a system of notifications for
the users of web apps that tipically must receive updates from the site activity
through channels such as emails (they call them “transactional emails” nowadays)
and displayed/listed on UI (“ala” social apps such as Facebook or Google+).By itself, this plugin cannot be used. You must tipically subclass itsNotificationmodel, and mix it withNotificationMixin.Read the latest documentation onRead the docsfor installation,
configuration and customization instructions.
Package: django-nomnom
django-nomnom=============A generic importing tool for the Django admin site.Developed with--------------* Python 2.7.x* Django 1.4.xInstallation & Setup--------------------pip install django-nomnomAfter installation add 'nomnom' to your INSTALLED_APPS setting:INSTALLED_APPS = (...'nomnom', # before the admin app'django.contrib.admin',...)Set up the project URLConf like so:urlpatterns = patterns('',...url(r'^admin/', include('nomnom.urls')), # before admin url patternsurl(r'^admin/', include(admin.site.urls)),...)Settings--------NomNom has the following settings available. You can set them in your project `settings.py`. If you don't set them it will assume the default values:### NOMNOM\_DATA\_DIRSaved files will be stored on this directory.**Default:** `settings.MEDIA_ROOT + 'nomnom'`Configure Export----------------from nomnom.actions import export_as_csvclass MyAdmin(admin.ModelAdmin):actions = [export_as_csv_action()]