Saravanan666/pypi-org huggingface dataset:
Package: django-nsa
# NSA app for Django![](nsa-eagle.png)An easy way for the NSA to see what’s going on in our Django projects.
Let’s ~~destroy the right to privacy~~ fight terrorism together!## Freedom matters.This particular app was written to join the forces of @goshakkk’s [nsa_panel](https://github.com/goshakkk/nsa_panel) for Ruby on Rails and
@plausibility’s [flask-nsa](https://github.com/plausibility/flask-nsa) for Flask.## Enforce.Addnsato yourINSTALLED_APPSto your project’ssettings.pyfile.
And this to your project’surls.pyfile:url(r’^nsa/’, include(‘nsa.urls’))Test if everything is free as it should be: [http://localhost:8000/nsa](http://localhost:8000/nsa) (Use nsa/nsa as credentials).## Enjoy.Share the ~~end of privacy~~ good news (or don’t, after all users shouldn’t know too much):> Dear X users,> You may be aware of reports alleging that X and several other Internet
> companies have joined a secret U.S. government program called PRISM to
> give the National Security Agency direct access to our servers. We would
> like to respond to the press reports, and give you the facts.> X is not and has never been part of any program to give the US or any
> other government direct access to our servers. We have never received a
> blanket request or court order from any government agency asking for
> information or metadata in bulk, like the one Verizon reportedly
> received. We hadn’t even heard of PRISM before yesterday.> When governments ask X for data, we review each request carefully to
> make sure they always follow the correct processes and all applicable
> laws, and then only provide the information if is required by law. We
> will continue fighting aggressively to keep your information safe and
> secure. Any suggestion that X is disclosing information about our users’
> Internet activity on such a scale is completely false.> We strongly encourage all governments to be much more transparent about
> all programs aimed at keeping the public safe. It’s the only way to
> protect everyone’s civil liberties and create the safe and free society
> we all want over the long term. We here at X understand that the U.S.
> and other governments need to take action to protect their citizens’
> safety—including sometimes by using surveillance. But the level of
> secrecy around the current legal procedures undermines the freedoms we
> all cherish.o/ yay.## How it looks like.![Confirm they have a warrant](0-confirm-warrant.png)![Dashboard](1-dashboard.png)![User details](2-user-details.png)![User’s secrets](3-users-secrets.png)![User’s secret](4-users-secrets.png)## Inspiration.[flask-nsa](https://github.com/plausibility/flask-nsa) by @plausibility.[nsa_panel](https://github.com/goshakkk/nsa_panel) by @goshakkk.## Pypi.[django-nsa](https://pypi.python.org/pypi/django-nsa)## License.[MIT](LICENSE).NSA Eagle Logo credit [EFF](https://www.eff.org/pages/eff-nsa-graphics).
CSS and base Templates [flask-nsa](https://github.com/plausibility/flask-nsa) and [960 Grid System](http://960.gs/).icon-yes.gifandicon-no.gif[Django Project](https://www.djangoproject.com/).
Package: django-ns-ratelimit
DJANGO-NS-RATELIMITProject descriptiondjango-ns-ratelimit is django app for limit requests using rate limit class, decorators and middleware.UsagePeriods in format:S: For seconds
    M: For minutes
    H: For hour
    D: For Day

    e.g: "10S" "1M" "1D"Decoratorsuser_method_ratelimit:Used for user specific request rate limiting for class base apisclass SampleView(APIView):
    @user_method_ratelimit(5, "1M")
    def get(self, request):
        passanon_method_ratelimit:Used for Anonymous user requests rate limiting for class base apisclass SampleView(APIView):
    @anon_method_ratelimit(5, "1M")
    def get(self, request):
        passuser_func_ratelimit:Used for user specific request rate limiting for function base apisclass SampleView(APIView):
    @user_func_ratelimit(5, "1M")
    def get(self, request):
        passanon_func_ratelimit:Used for Anonymous user requests rate limiting for function base apisclass SampleView(APIView):
    @anon_func_ratelimit(5, "1M")
    def get(self, request):
        passMiddlewaresUserRateLimitMiddlewareAdd this django settings Middlewares for User rate limitingMIDDLEWARE = [
    .
    .
    .
    .
    "ratelimit.middleware.UserRateLimitMiddleware",
]AnonRateLimitMiddlewareAdd this django settings Middlewares for Anonymous rate limitingMIDDLEWARE = [
    .
    .
    .
    .
    "ratelimit.middleware.AnonRateLimitMiddleware",
]
Package: django-nsync
Django NSync provides a simple way to keep your Django Model data ‘n-sync with N external systems.FeaturesIncludes:Synchronise models with data from external systemsCreate, update or delete model objectsModify relational fieldsAllow multiple systems to modify the same model objectCSV file support out of the boxShips with commands to process a single CSV file or multiple CSV filesNo need for more codeNsync does not require you to inherit from special classes, add ‘model mapping’ objects or really define anything in PythonNot-included:Export (to CSV or anything else for that matter)There are other packages that can do thisWhy do you want the data out? Isn’t that what your application is for? ;-)Admin integrationThere isn’t much to this package, if you want to add the models to your admin pages it is probably better if you do it (that’s what I’ve done in my use case)Not-yet included:Other file formats out of the boxLove it or hate it, CSV is ubiquitous and simple (its limitations also force simplicity)The CSV handling part is separated from the true NSync part, so feel free to write your own lyrics-from-wav-file importer.Intricate data format handlingE.g. parsing date times etcThis can be side-stepped by creating@propertyannotated handlers though (see the examples from more info)DocumentationThe full documentation is athttps://django-nsync.readthedocs.org.CreditsTools used in rendering this package:CookiecutterUsed to create the initial repotcookiecutter-pypackageUsed byCookiecutterto create the initial repoFor helping me make sense of the python pacakging world (and the bad practices codified in some of the tools/blogs out there):Hynek SchlawackWhose blog posts on packaging Python apps etc were indispensibleIonel Cristian Maries(sorry, too lazy for unicode) Whose blog post on python packaging was also indispensible
Package: django-nuages-tag
What is it ?A simple Django TemplateTag (named compute_tag_cloud) to help in the
creation of tag clouds.Tiny tutorialInstall the app in your Django projectThis should be as simple aspip install django-nuages-tagand adding ‘django_nuages_tag’ to yourINSTALLED_APPSsettings.Example usage1. Source dataGiven that we have a my_favourite_tools context variable defined like
this:my_favourite_tools = [{'name': 'Python', 'interest': 30},
                      {'name': 'Django', 'interest': 70},
                      {'name': 'Ruby', 'interest': 6}]Note: example shows a simple list, butthis also works with a Django
QuerySet.2. Compute the tag cloudWe can now do:{% load django_nuages_tag %}

{% compute_tag_cloud my_favourite_tools interest font_size 10 100 lin %}compute_tag_cloud will add afont_sizeattribute to each element
inmy_favourite_toolsthat is contained between 10 and 100 and is
representative of the value ofinterest. The last parameter
(lin) asks to use a linear formula to compute this tag cloud.
Another option is to use a logarithmic formula (use thelogparameter). You should test both options, butlogwill probably give
you better results if there is a large variation in the values you want
to compute. NOTE: 0 and negative values will be computed to 0 (with both formulas).Our source data now looks like:my_favourite_tools = [{'name': 'Python', 'interest': 30, 'font_size': 43.75},
                      {'name': 'Django', 'interest': 70, 'font_size': 100},
                      {'name': 'Ruby', 'interest': 6, 'font_size': 10}]3. Render the tag cloudThis can be done very easily with thefortag and basic HTML/CSS.
For example:{% for tool in my_favourite_tools %}
  <span style="font-size: {{ tool.font_size }}px;"> {{ tool.name }} </span>
{% endfor %}Notescompute_tag_cloudcan be called multiple times in a row to
generate multiple values. We can for example compute the font size
(between 10 and 55), but also the margin (between 5 and 28) and the
opacity (between 0.7 and 1) of the text with something like:{% load django_nuages_tag %}

{% compute_tag_cloud my_favourite_tools interest font_size 10 55 lin %}
{% compute_tag_cloud my_favourite_tools interest margin 5 28 lin %}
{% compute_tag_cloud my_favourite_tools interest opacity 0.7 1 lin %}

{% for tool in my_favourite_tools %}
  <span style="font-size: {{ tool.font_size }}px; margin: {{ tool.margin }}px; opacity: {{ tool.opacity }}">{{ tool.name }}</span>
{% endfor %}Thecounterparameter (interestin our example) can be an attribute, a method to be called or a dictionary key.
Package: django-nucleus
django-nucleusDjango Nucleus is Django admin theme extending default admin CSS styles.Getting startedInstallationpipinstalldjango-nucleusor if you are using pipenvpipenvinstalldjango-nucleusAddnucleusintoINSTALLED_APPSin your settings file beforedjango.contrib.admin.Updatecontext_processorsby adding new context processornucleus.context_processors.nucleusNucleus settings_=lambdas:s# Translations in setting fileNUCLEUS={'sidebar':{# Title'title':_('Custom title'),# Footer'footer':{'title':_('Custom title'),'description':_('Longer text displayed below the title'),},# Navigation'navigation':{# Application'auth':{'title':_('Accounts'),# Override title'icon':'img/custom-icon.svg'# Optional},# Model'auth.User':{'title':_('Users'),'icon':'img/custom-icon.svg'# Optional}}}}Custom dashboard pageapps.pyfromdjango.contrib.admin.appsimportAdminConfigclassAppAdminConfig(AdminConfig):default_site='app.admin.AppAdmin'admin.pyfromdjango.contrib.adminimportAdminSiteclassAppAdmin(AdminSite):defindex(self,request,extra_context=None):# Update extra_context with new variablesreturnsuper().index(request,extra_context)settings.pyINSTALLED_APPS=['app.apps.AppAdminConfig',# 'django.contrib.admin',]templates/admin/index.html{% extends "admin/base_site.html" %}
{% load i18n static %}

{% block bodyclass %}{{ block.super }} dashboard{% endblock %}

{% block breadcrumbs %}{% endblock %}

{% block content %}
 
{% endblock %}ComponentsHeadingreturnrender_to_string('nucleus/components/heading.html',{'title':'Title,'subtitle':'Subtitle,'image':'img/image.png',# Optional image'rounded':True,# Rounded corners, optional'initials':'LV',# Optional text of the image is not available'background_color':'red'# Optional background color})Stat itemreturnrender_to_string('nucleus/components/stat_item.html',{value:'5269',title:'Units Sold',subtitle:'Avg. 351 per week',label:'-12%',})Chartreturnrender_to_string('nucleus/components/chart.html',{series:'{"labels": ["1", "2", "3"], "datasets": [{"data": [1, 2, 3]}]}',# JSON objectheight:360,# Optional})Signed numberreturnrender_to_string('nucleus/components/signed_number.html',{'value':21.87,# Value which will be compared'display':'$21.87 ',# For example string with currency to display (django-money object)})Progressreturnrender_to_string('nucleus/components/progress.html',{'value':32,# Value in percent in this case it will be (style="width: 32%")})Labelreturnrender_to_string('nucleus/components/progress.html',{'title':_('Active'),'class':'success',# Optional. Accepted values: success, info, error})User avatarTo display user avatar in top right corner before the currently signed user you can implement two methods in user model:get_initialsget_avatarCreditsFeatherdjango-capture-tagTailwind CSSNunitoChart.js
Package: django-nullablecharfield
This app is a collection of a widget, form field and db field that allows to have
a nullable charfield inside django.Quick startAdd “nullablecharfield” to your INSTALLED_APPS setting like this:INSTALLED_APPS = (
    ...
    'nullablecharfield',
)Use in your model CharNullField from nullablecharfield.db.models.fieldsYou should set null=True and blank=True in the fields that you want to make nullable, like this:from django.db import models
from nullablecharfield.db.models.fields import CharNullField

class Person(models.Model):
    first_name = CharNullField(max_length=30, null=True, blank=True)
    last_name = CharNullField(max_length=30, null=True, blank=True)
Package: django-num2fa
Django Num2Fadjango-num2fais a wrapper aroundnum2fapackage which provides a set of filters to convert numbers to Persian numbers and words.Installationpipinstall-Udjango-num2faThat's it!UsageFirst, adddjango_num2fainside yourINSTALLED_APPS:INSTALLED_APPS=['django.contrib.admin','django.contrib.auth','django.contrib.contenttypes','django.contrib.sessions','django.contrib.messages','django.contrib.staticfiles','django_num2fa',# other packages]loadnum2fainside your template:{%loadnum2fa%}then, wherever you have a number in your code template, pipe it with one of thefa_numbers,fa_words, andfa_ordinal_wordstemplate filters.{%loadnum2fa%}{{number|fa_numbers}}{{number|fa_words}}{{number|fa_ordinal_words}}ContributingWe welcome contributions! To learn how you can contribute, please check theContributingdocument.LicenseThis work is licensed under the terms of theGNU Affero General Public License (AGPL).
Package: django-numerators
Django NumeratorsDjango Numerators track autonumber style inner_id for model record
This repository contains aNumeratormodel utils to create nice formatted Inner ID.Installation$ pip install django-numeratorsor$ pip install git+https://github.com/sasriawesome/django_numerators.git#egg=django-numeratorsUsagefrom django.db import models
from django_numerators.models import NumeratorMixin, NumeratorReset

class Product(NumeratorMixin):
    doc_prefix = 'PD'
    name = models.CharField(max_length=100)Usage with Polymorphicinstall django-polymorphic$ pip install django-polymorphicUsing Parent Model doc_prefixfrom django.db import models
from polymorphic.models import PolymorphicModel
from django_numerators.models import NumeratorMixin, NumeratorReset

class Product(NumeratorMixin):
    doc_prefix = 'PD'
    parent_prefix = True
    parent_model = 'Parent2'
    name = models.CharField(max_length=100)

class Inventory(Product):
    pass

class Asset(Product)
    passUsing Child Model doc prefixclass Product(NumeratorMixin):
    name = models.CharField(max_length=100)

class Inventory(Product):
    doc_prefix = 'INV'

class Asset(Product)
    doc_prefix = 'AST'
Package: django-numericfieldlistfilter
# Django-NumericFieldListFilterDjango-NumericFieldListFilter is a plugin for Django. It allows easy filtering of numeric fields (IntegerField, FloatField and DecimalField) inside the Django admin.For each numeric field, two inputs will be added to the admin, representing a minimum and maximum value which you can filter on.![Screenshot of NumericFieldListFilter](http://i.imgur.com/y6U9uCI.png)### Installation```sh$ pip install django-numericfieldlistfilter```You'll need Django version 1.8 or greater.### Usage1. Add `djangonumericfieldlistfilter` to the installed apps:```pythonINSTALLED_APPS = (...'djangonumericfieldlistfilter',...)```2. Use the `NumericModelAdmin` as the base class of your admin classes:```pythonfrom djangonumericfieldlistfilter.options import NumericModelAdminclass TransactionAdmin(NumericModelAdmin):...```3. Add your numeric field to the list_filter variable:```pythonlist_filter = (...'price_paid'...)```### Version0.1License-------MIT
Package: django-numfilters
django-numfiltersis a collection of template filters for Django who provides access to several basic mathematical functions.DownloadTo install it by usingpip:$ pip install django-numfiltersor by usingeasy_install:$ easy_install django-numfiltersYou can also pot for installing it from source:$ git clone git@github.com:amatellanes/django-numfilters.git
$ cd django-numfilters
$ python setup.py installInstallationTo enabledjango-numfiltersin your Django project, you need to adddjango_numfilterstoINSTALLED_APPS:INSTALLED_APPS = (
    ...
    'django_numfilters',
    ...
)UsageThis section provides a summary ofdjango-numfiltersfeatures.Firstly, you need make filters available to your templates using{% load numfilters %}tag. After this, you can use
next tags:absReturns the absolute value ofa, foranumber.addThis filter is provided byDjango.subReturnsa - b, foraandbnumbers.mulReturnsa * b, foraandbnumbers.divReturnsa / b, foraandbnumbers (classicdivision).modReturnsa % b, foraandbnumbers.floordivReturnsa // b, foraandbnumbers.powReturnsa ** b, foraandbnumbers.sqrtReturn the square root ofa, foranumber.Example{% load numfilters %}<!doctype html><htmllang="en"><head><metacharset="UTF-8"><title>Example django-numfilters</title></head><body><ul><li>abs(-41) = {{ -41|abs }}</li><li>23 - 7 = {{ 23|sub:7 }}</li><li>25 * 2 = {{ 25|mul:2 }}</li><li>32 / 4 = {{ 32|div:4 }}</li>{% with a=15 b=3 %}<li>15 % 3 = {{ a|mod:b }}</li>{% endwith %}

    {% with a=5 b=2 %}<li>5 // 2 = {{ a|floordiv:b }}</li>{% endwith %}<li>pow(5, 2) = {{ 5|pow:2 }}</li>{% with a=64 %}<li>sqrt(64) = {{ a|sqrt }}</li>{% endwith %}</ul></body></html>TestingYou can see the current Travis CI build here:https://travis-ci.org/amatellanes/django-numfilters.ChangelogRelease 0.1.1 (no codename, released on December 26th 2014)Fix minor bugs.Release 0.1.0 (no codename, released on July 20th 2014)Initial release.LicenseMIT License, see LICENSE file.
Package: django-numpy
Version:1.0.1DjangoNumpy:Production/StableAuthor:José Antonio Perdiguero LópezDjango Numpy is an application for Django projects that adds some utilities and integration tools with Numpy.Quick startInstall this package using pip:pip install django-numpyAddPROJECT_PATHto your django settings module.Addstatusto yourINSTALLED_APPSsettings like this:INSTALLED_APPS = (
    ...
    'django_numpy',
)Database FieldsThis package adds a new Field type that manages numpy arrays. This field is based on django ArrayField, thatonly works with PostgreSQL backend. TheNumpyArrayFieldbehave just like Django’s ArrayField so all parameters
defined inofficial docs.
Package: django-numpy-json-encoder
IntroductionSubclass of standard Django JSON encoder[1]that can encode some numpy types (integers, floats and arrays).[1]https://docs.djangoproject.com/en/dev/topics/serialization/#djangojsonencoderInstallationSupported Python versions are:3.6and3.7-dev.Supported Django versions are:2.0pipinstall--upgradedjango-numpy-json-encoderUsage# -*- encoding: utf-8 -*-# ! python3importnumpyasnpfromdjango.httpimportJsonResponsefromdjango.viewsimportViewfromdjango_numpy_json_encoder.numpy_encoderimportNumpyJSONEncoderclassExampleView(View):# noinspection PyMethodMayBeStaticdefpost(self,*args,**kwargs):numpy_array=np.random.rand(8,42).astype(np.float32)returnJsonResponse(data={'array':numpy_array},encoder=NumpyJSONEncoder,safe=True)LicenseThe MIT License (MIT)
Package: django-nupages
Pages application for django projectsDocumentationThe full documentation is athttps://django-nupages.readthedocs.org.QuickstartInstall django-nupages:pip install django-nupagesCookiecutter-project IntegrationInitial Setup:mkprojectPROJECT_NAMEpipinstallcookiecuttercookiecutterhttps://github.com/pydanny/cookiecutter-django.gitGithub Setup:workonPROJECT_NAMEcdPROJECT_NAMEgitinitgitadd.gitcommit-m'init'gitremoteaddorigingit@github.com:USER_NAME/REPO_NAME.gitgitpushoriginmasterDevelopment Setup:workonPROJECT_NAMEcdPROJECT_NAMEpipinstall-rrequirements/local.txtnpminstallcreatedbPROJECT_NAMEpythonPROJECT_NAME/manage.pysyncdbpythonPROJECT_NAME/manage.pymigratenupages Setup:pipinstalldjango-nupagesadd ‘nupages’ to PROJECT_NAME/config/settings.py in THIRD_PARTY_APPS (lines 47 - 51)THIRD_PARTY_APPS=('south',# Database migration helpers:'crispy_forms',# Form layouts'avatar',# for user avatars+'nupages',)add nupages url namespace to PROJECT_NAME/config/urls.py to the bottom of urlpatterns (lines 13 - 33)urlpatterns=patterns('',url(r'^$',TemplateView.as_view(template_name='pages/home.html'),name="home"),url(r'^about/$',TemplateView.as_view(template_name='pages/about.html'),name="about"),# Uncomment the next line to enable the admin:url(r'^admin/',include(admin.site.urls)),# User managementurl(r'^users/',include("users.urls",namespace="users")),url(r'^accounts/',include('allauth.urls')),# Uncomment the next line to enable avatarsurl(r'^avatar/',include('avatar.urls')),# Your stuff: custom urls go here+url(r'^pages/',include("nupages.urls",namespace="nupages")),)+static(settings.MEDIA_URL,document_root=settings.MEDIA_ROOT)sync the databasepythonPROJECT_NAME/manage.pysyndbpythonPROJECT_NAME/manage.pymigrategruntserve# open 127.0.0.1:8000 in browserProduction Setup:herokucreate--buildpackhttps://github.com/heroku/heroku-buildpack-pythonherokuaddons:addheroku-postgresql:devherokuaddons:addpgbackupsherokuaddons:addsendgrid:starterherokuaddons:addmemcachier:devherokupg:promoteHEROKU_POSTGRESQL_COLORherokuconfig:setDJANGO_CONFIGURATION=Productionherokuconfig:setDJANGO_SECRET_KEY=RANDOM_SECRET_KEYherokuconfig:setDJANGO_AWS_ACCESS_KEY_ID=YOUR_IDherokuconfig:setDJANGO_AWS_SECRET_ACCESS_KEY=YOUR_KEYherokuconfig:setDJANGO_AWS_STORAGE_BUCKET_NAME=BUCKETgitpushherokumasterherokurunpythonccx/manage.pysyncdb--noinput--settings=config.settingsherokurunpythonccx/manage.pymigrate--settings=config.settingsherokurunpythonccx/manage.pycollectstatic--settings=config.settingsHistory0.1.0 (2014-03-11)First release on PyPI.0.1.6 (2014-05-05)Adds Multi-tenant middleware0.1.7 (2014-05-09)adds support for creating site-specific Home pagesadds Page admin
Package: django-nuts
Django application providing database of European NUTS and LAUInstallationpipinstalldjango-nutsConfigurationAdd'django_nuts'tosettings.INSTALLED_APPS.Data migrationpythonmanage.pymigrateLoad / update dataYou may load the data manually from the shell (python manage.py shell)fromdjango_nuts.loadersimportload_nuts,load_lau,load_other_nuts# load all NUTS and LAU (note that NUTS must be loaded before LAU)load_nuts(),load_ohter_nuts(),load_lau()# load NUTS and LAU for some particular countriesload_nuts('CZ','SK'),load_other_nuts('IS'),load_lau('CZ','SK')# load NUTS4 for CZ or SKfromdjango_nuts.loaders.cz_nutsimportload_cz_nutsfromdjango_nuts.loaders.sk_nutsimportload_sk_nutsload_cz_nuts(),load_sk_nuts()# load CZ NUTS4 + LAUfromdjango_nuts.loaders.cz_nuts4_lauimportload_cz_nuts4_lauload_cz_nuts4_lau()Filter objects by NUTS in Django Admin Siteyour_app/models.py:fromdjango.dbimportmodelsfromdjango_nuts.modelsimportNUTSclassPlace(models.Model):name=models.CharField(max_length=255)nuts=models.ForeignKey(NUTS)your_app/admin.py:fromdjango.contribimportadminfromdjango_nuts.adminimportNUTSRelatedOnlyFieldListFilterclassPlaceAdmin(admin.ModelAdmin):list_display=('name',)list_filter=(('nuts',NUTSRelatedOnlyFieldListFilter),)raw_id_fields=('nuts',)
Package: django-o18n
Use caseDjango’s [i18n_patterns][] prefixes URLs with a language code which may
contain a variant e.g./en,/fr,/fr-ca.o18n_patterns is similar but it prefixes URLs with a country code and a
language code e.g./us,/ca/en,/ca/fr.This is useful for websites that are mainly segmented by country rather than
by language.[i18n_patterns]:https://docs.djangoproject.com/en/stable/topics/i18n/translation/#django.conf.urls.i18n.i18n_patternsFeaturesSome countries have a main language. In that case, the URL for the main
language only contains the country e.g./us. URLs for other languages
contain the country and the language e.g./us/es.Some countries don’t have a main language — and it may be a sensitive topic!
In that case, all URLs contain the country and the language e.g./ca/enand/ca/fr.Unlike i18_patterns, o18n_patterns doesn’t attempt to determine the country
and language and automatically redirect the user to the appropriate URL.If an URL doesn’t match a valid country and language combination, it doesn’t
resolve with o18n_patterns and no country is activated. Vice-versa, if no
country is active, reversing an URL raises an exception.