Saravanan666/pypi-org huggingface dataset:
Package: django-easyfilters-ex
OverviewThis library provides filters similar in some ways tolist_filteranddate_hierarchyin Django’s admin, but for use outside the
admin. Importantly, it also includes result counts for the choices. It is
designed to be very easy to get started with.Installpip install django-easyfilters-exDocshttps://django-easyfilters.readthedocs.org/en/latest/TODOPossible: ability to specify ‘defaults’ attribute for FilterSetAllow the automatic ‘page’ resetting to be customizedChangelogVersion 0.7.0Fix bug with DateTimeFilter on Django 1.6 and add support for filtering NULLs in ForeignKey filters (contributed by
Eugene A Brin in PR#9)Version 0.6.2Add ashow_countsoption on filters.Add adefaultsoption on filterset so you don’t have to specify the same options for every filter.Version 0.6.1Fix broken import / error handling in utils.Version 0.6Fixed compat with django 1.6 and 1.7Fixed handling around NULL valuesFixed inconsistencies with “display” linksAdd support for filters on forward relations (eg: fk1__fk2__finalfield)Version 0.5Python 3.3 compatibility :-) Tests are run against Python 2.6, 2.7 and 3.3,
and Django 1.3 to 1.5Version 0.4Cleaned up internalFilterimplementation/APIAdded and documentedFilter.render_choice_objectwhich can
be overridden for easy customization of filters.Fixed various bugs with DateTimeFilter. Thanks to psyton for a bug fix.Version 0.3.2Correction to newFilterSet.titleattribute.Version 0.3.1Fixed crasher in 0.3Version 0.3Added theFilterSet.titleattribute, and thetitle_fieldsattribute
that can be used to control it.Version 0.2Added NumericRangeFilterMore docs, and API firmed up.Fixed bug with test_settings.py which caused static media not to be served
with most recent Django.Version 0.1.1Cleaned up the release tarball to remove old files.Version 0.1Initial release
Package: django-easy-fixture
django-easy-fixture===================.. figure:: https://travis-ci.org/allenling/django-easy-fixture.svg?branch=masterpython2.7, python3.51.8<= Django <= 1.10**install: pip install django-easy-fixture**That is a easy, simple tool to help you to fill your fixture dict with some spam datasMake your fixture dict to be a completely available django fixture that **you do not have to worry about any unqiue, unqie_together, just pk****The pk must be defined by you!****Just support all the fields defined by Django, and do not support any customization field.****Maybe** support the customization field in the future.1. get a fixture dict---------------------.. code-block:: python# in template.pyfixtures_template={'auth.User': [{'pk': 1}]}# in other.pyfrom easy_fixture.easy_fixture import EasyFixturefrom template import fixtures_templateef = EasyFixture(fixtures_template)fixtures_dict = ef.output()2. use as a django app command------------------------------.. code-block:: python# in template.pyfixtures_template = {'auth.User': [{'pk': 1}]}# in your settings.pyINSTALLED_APPS = ('other apps','easy_fixture',)run make_fixture command.. code-block:: pythonpython manage.py make_fixture template.fixtures_template > /path/to/fixture.jsonMust pass the module path and fixture variable, like module.to.fixture.Variable_name**do not support old style**.. code-block:: pythonpython manage.py make_fixture template > /path/to/fixture.json3. use in test--------------In your testCase, call EasyFixture.load_into_testcase in your setUpTestData, setUpClass, setUp or anywhere you want to load your fixture data... code-block:: pythonFIXTURE_DICT = {'auth.User': [{'pk': 1}]}class MyTestCase(TestCase):@classmethoddef setUpTestData(cls):ef = EasyFixture(FIXTURE_DICT)ef.load_into_testcase()TestCase.setUpTestData()def tes_what_you_want(self):pass**deprecate**.. code-block:: pythonfrom easy_fixture.easy_fixture import FixtureFileGenclass MyCase(TestCase):fixtures = FixtureFileGen(['my.fixture.template.module'])
Package: django-easy-formset
django-easy-formsetDjango Formsets with ECMAScript 6InstallationInstallation is easy using pip and the only requirement is a recent version of Django.python-mpipinstalldjango-easy-formsetBasic app configurationThen to add the Django Easy Formset to your project add the appeasy_formsetto
yourINSTALLED_APPS.INSTALLED_APPS=[# ..."easy_formset",]How to useVideoIn template{% load static %}
<head>
  <link rel="stylesheet" href="{% static 'easy_formset/easy_formset.css' %}">
</head>
<body>
  <div id="{{ formset.prefix }}">
    {{ formset.management_form }}

    <template formset-empty-form="{{ formset.prefix }}">
      {{ formset.empty_form.as_p }}
      <a formset-form-delete="{{ formset.empty_form.prefix }}>Delete</a>
    </template>

    <div formset-forms="{{ formset.prefix }}">
      {% for form in formset.forms %}
        <div formset-form>
          {{ form.as_p }}
          <a formset-form-delete="{{ form.prefix }}>Delete</a>
        </div>
      {% endfor %}
    </div>
    <button formset-add="{{ formset.prefix }}">Add Formset</button>
  </div>
  ...
  <script src="{% static 'easy_formset/easy_formset.js' %}"></script>
  <script>
    const formset = new Formset("{{ formset.prefix }}")
  </script>
</body>Custom undo element// add one root element...Formset.revertHTML='<a href="#">Custom undo link...</a>'constformset=newFormset("{{ formset.prefix }}")Handle add/deleted eventsdocument.addEventListener('formset:add',(event)=>{// access the form with event.detail.form})document.addEventListener('formset:deleted',(event)=>{// access the form with event.detail.form})Nested formsetsSee examples intests.testapp.Run testspython-mpip-rrequirements.txt
pytestRun project testpythonmanage.pyrunserver
Package: django-easy-geoposition-field
This package adds geoposition field with map widget to django. It don’t deppend
on GIS extensions.Installpipinstalldjango-easy-geoposition-fieldUsageAdddjango_geoposition_fieldtoINSTALLED_APPS.# settings.pyINSTALLED_APPS=(# ...'django_geoposition_field',)Now you can addGeopositionFieldto your model:# models.pyfromdjango_geoposition_field.fieldsimportGeopositionFieldclassModel(models.Model):position=GeopositionField()
Package: django-easy-health-check
Django-easy-health-checkDjango-easy-health-check is a Django package that provides an easy-to-use middleware to allow health check.MotivationDjango's ALLOWED_HOSTS setting often would prevent health check from being completed successfully in production. A
common method of getting around this involves making a request to fetch ip address about the instance itself and adding
it to the ALLOWED_HOSTS. This approach often varies depending on deployment platform/environment.This package provides a simple middleware that allows requests to a specified health check path to be made without
checking against ALLOWED_HOSTS setting. This negates the need to modify ALLOWED_HOSTS setting in runtime, and is
therefore platform-agnostic.Quick startInstall using pip:pip install django-easy-health-checkOr, install from source:pip install git+https://github.com/oscarychen/django-easy-health-check.gitAdd the health check middleware to Django settings beforedjango.middleware.common.CommonMiddleware:MIDDLEWARE=[...,'easy_health_check.middleware.HealthCheckMiddleware','django.middleware.common.CommonMiddleware',...]By default, the health check url will be available at "example.com/healthcheck/".SettingsYou can customize and overwrite the default settings by including the following in your project's settings.py:DJANGO_EASY_HEALTH_CHECK={"PATH":"/healthcheck/","RETURN_STATUS_CODE":200,"RETURN_BYTE_DATA":"","RETURN_HEADERS":None}In production, you may also want to set the following Django settings:ALLOWED_HOSTS=["example.com"]SECURE_SSL_REDIRECT=TrueSECURE_REDIRECT_EXEMPT=[r'^healthcheck/$']
Package: django-easy-instagram
django-easy-instagramA Django application that provides a template tag for displaying content from a public Instagram profile. Has ability to cache files locally.This is derived fromMarco Pompili's version, which has different requirements and options. Thanks to Marco for doing all the hard work.RequirementsDjango >= 1.6html5librequestssorl-thumbnailPillowInstallationInstall Django with your favourite Linux packaging system or you can use pip for installing python packages, if Django is not an official package for your distribution:pipinstalldjangoUse pip to install Django Easy Instagram:pipinstalldjango-easy-instagramPip should take care of the package dependencies for Django Easy Instagram.ConfigurationAdd the application to INSTALLED_APPS:INSTALLED_APPS=(...'sorl.thumbnail',# required for thumbnail support'django_easy_instagram',)Rebuild your application database, this command depends on which version of Django you are using.In Django 2.0 (recommended):pythonmanage.pymakemigrationsdjango_easy_instagramThem migrate the db:pythonmanage.pymigrateUsageTheinstagram_user_recent_mediabrings into context two objects:profile: Contains the who scraped object.recent_media: Contains the recent media, like 10 or 12 entries or so.You can display the data contained inrecent_medialist like this:<!DOCTYPE html>{% load instagram_client %}<htmllang="en"><head><metacharset="UTF-8"><title>{{ instagram_profile_name|capfirst }} Instagram feed</title></head><body><h1>{{ instagram_profile_name|capfirst }} Instagram Feed</h1><divid="django_recent_media_wall">{% instagram_user_recent_media instagram_profile_name %}
    {% for media in recent_media %}<divclass="django_easy_instagram_media_wall_item"><ahref="//instagram.com/p/{{ media.shortcode }}"target="_blank"><imgsrc="{{ media.thumbnail_src }}"/><span>{{ media.edge_media_to_caption.edges.0.node.text }}</span></a></div>{% endfor %}</div><p>Got from instagram</p></body></html>Resizing and Caching ImagesYou are able to resize images, which will also mean they are cached locally rather than being loaded from Instagram's servers.To enable this, ensure you havesorl.thumbnailin the INSTALLED_APPS, and that you have setupDjango caching.In order for requests to Instagram to work properly, you will need to ensure you set thesorl.thumbailsetting:THUMBNAIL_REMOVE_URL_ARGS=FalseYou can then use thelocal_cachetemplate filter and specify a size:{% for media in recent_media %}
...<imgsrc="{{ media.thumbnail_src|local_cache:'332x332' }}"/>...
{% endfor %}The images will be saved locally in a cache.By default images will be resized and saved at 80% JPG quality, to
override this you can use this setting in your Django settings file:INSTAGRAM_QUALITY=90ThanksThe original version and most of the actual work was done by Marco Pompili in the versionavailable here.
Package: django-easy-logging
Django Easy LoggingEasy Django logging with LoguruLoguruis an exceeding easy way to do logging in Python. django-easy-logging makes it exceedingly easy to use Loguru in Django. Once integrated you can using existings Python logging mechanisms which are then funneled into Loguru or you can use the Loguru logging methods.Installpip install django-easy-loggingUsageIn yoursettings.pytowards the end of the file add:fromdj_easy_logimportload_loguruload_loguru(globals())In your other files, use Loguru methods for logging.fromloguruimportloggerlogger.debug("That's it, beautiful and simple logging!")logger.info("If you're using Python{}, prefer{feature}of course!",3.6,feature="f-strings")Note:Any existing logging is funneled into loguru when using the defualt settings. Loguru is used as a sink asoutlined in the docs.CustomizationLog LevelThe default log level in DEBUG isINFO. Otherwise the default level isERROR.You can override the log level with the envLOGLEVEL.orpass in a log level intoload_loguru.Example:load_loguru(globals(), loglevel="WARNING")Logging ConfigTheLOGGINGconfig dict is generated automatically or you can pass in your own. The default is created bygenerate_logging_configExample:load_loguru(globals(), logging_config=MY_LOGGING_CONFIG)Configuring LoguruYou can pass in a function that configures Loguru.Example:defsetup_loguru(logger,settings_dict):ifnotsettings_dict['DEBUG']:logger.add("django.log",rotation="100 MB")load_loguru(globals(),configure_func=setup_loguru)Configuring the Default Formatexport LOGURU_FORMAT="<blue>{time:HH:mm:ss}</blue> | <red>{name}:{line}</red> | {level} - {message}"See therecord dict documentionfor other available formatting options. And seecolor markupsfor more info on coloring and markups.Shameless PlugsI built this library originally for theNeutronSync Service. So if you would like to support this project please support the service with a subscription to NeutronSync or adonationto the open source libraries.
Package: django-easy-login
Django Easy Login is a Django app that allows end-users to login with already created users at the system without
authentication.Quick startAdd ‘easy_login’ to your INSTALLED_APPS settings:INSTALLED_APPS=[...'easy_login',...]Now edit the example/urls.py module in your project:urlpatterns=[...url(r'^easy_login/',include('easy_login.urls',namespace='easy-login')),...]Set middleware class:TEMPLATES=[...'context_processors':['easy_login.context_processors.easy_login',...],]Define default url redirect:EASY_URL_REDIRECT='test-app:index'In template define easy_login variable:{{easy_login}}CustomizationYou can change the view settings up to your wishes.
For customizing view settings please put this to the settings:EASY_LOGIN_SETTINGS={'FILTER':{},# --> dict;'LIMIT':None,# --> int;'LABELS':[],# --> list, lambda;'LOGIN_BY':'',# --> str;'GET_BY':'',# --> str;'LOGIN_BUTTON':''# --> str;}Options:FILTER- possible type -dict; Using this option you can by the attributes filter objects which are
shown in the select bar. For example'FILTER': {'username': 'admin'}. By default -None.LIMIT- possible type -int; Limit number of records in dropdown. You can put None if you don’t want to
limit the number of users for select. By default -10.LABELS- possible type -list,lambda; You can change the label of users displayed in dropdown.
For example you can add roles, permissions and any other important information. Also, you can use
lambda expression here, for ex.'LABELS': lambda x: x.username + ' - ' + str(x.id).
By default -__str__method of your object.LOGIN_BY- possible type -str, values:‘select’, ‘id’, ‘both’; You can enable login with select field,
ID input or both. By default -‘both’.GET_BY- possible type -str; You can change attribute by which you will authorize. By default -‘id’.LOGIN_BUTTON- possible type -str; You can change login button label. By default -‘Login’.
Package: django-easy-messages
Django Easy Messages===================Requires Backbone.js, underscore.js, and jQueryInstallation:-------------1. Add ``easy_messages`` to ``INSTALLED_APPS`` in settings.py.2. Add ``easy_messages.middleware.AjaxMessaging`` to ``MIDDLEWARE_CLASSES`` in settings.py.3. Add the following lines to your base template in the desired locations::{% include "easy_messages/list.html" %}<script type="text/javascript" src="{{ STATIC_URL }}js/messages.js"></script><link type="text/css" rel="stylesheet" href="{{ STATIC_URL }}css/messages.css" />Note also that there's also a messages.less file included if you'd prefer to use .less instead of css.See ``examples.views.py`` for usage in views and API calls.
Package: django-easy-metatags
Django Easy MetatagsDjango Easy Metatags is a package for adding meta tags from admin panel to any url of your website.Quick startAdd "metatags" to your INSTALLED_APPS setting like this::INSTALLED_APPS = [
    ...
    'metatags',
]Runpython manage.py migrateto create the polls models.Load metatags templates tags in base.html::{% load metatags %}Add metatags tag in head of body or any page where you want to add meta tags to.<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    {% metatags request.path %}
    <title>Document</title>
</head>Visithttp://127.0.0.1:8000/admin/metatags/metatag/to add meta tags.In slug add some unique feature of url.Enjoy!
Package: django-easymode
With easymode you can create backends for dynamic flash/flex
websites.Easymode makes internationalization simple and outputs xml by
default. To tailor the xml to your application, you can transform
it using xslt templates, which easymode integrates.For more info, look athttp://packages.python.org/django-easymode/details.htmldocumentation athttp://packages.python.org/django-easymode/release notes athttp://packages.python.org/django-easymode/changes.html
Package: django-easymoney
An easy to use money field for Django.
Handles type conversions and arithmetic seamlessly.RequirementsPython 2.7 and 3.3+, Django 1.6+.Installationpip install django-easymoneyOverviewfromdjango.dbimportmodelsfromeasymoneyimportMoneyFieldclassMyModel(models.Model):price=MoneyField(default=3.14)other_price=MoneyField(default=1)obj=MyModel()printobj.price# -> $3.14# Money arithmeticobj.price+obj.other_price# $4.14# Mix with ints and floatsobj.price+1# $4.14obj.price+0.2# $3.34# No partial cents or crazy floatsobj.price/3# $1.05SettingsA primary use of easymoney is global currency defined in settings
with global formatting and precision. Here is how you do that:# These are default settings, code and locales refer to ones used in babel libraryCURRENCY_CODE='USD'CURRENCY_LOCALE='en_US'CURRENCY_DECIMAL_PLACES=2# This is optional, for cases when you want to use some fake currencyCURRENCY_FORMAT='# points'Several currenciesOne money field can’t store different currencies, however, you can create different money classes and model fields for them:fromeasymoneyimportMoney,MoneyFieldclassGameMoney(Money):# CODE = '...'# LOCALE = '...'DECIMAL_PLACES=0FORMAT='# points'classGameMoneyField(MoneyField):MONEY_CLASS=GameMoney
Package: django-easy-news
Application provides news functionality for your site.Installation:In settings.py:Addeasy_newsto yourINSTALLED_APPS.Include('easy_news.urls')in yoururls.pylike this:urlpatterns += patterns('',
    (r'^news/', include('easy_news.urls')),
)UsageViewsEasy news usesdjango generic views systemto render pages.
Easy news has several url handlers (I mean named patterns):news_detail- Show news itselfnews_list- ifsettings.ENABLE_NEWS_LISTis True, shows list of publicated newsnews_archive_indexifnews_settings.ENABLE_NEWS_ARCHIVE_INDEXis True, shows content ofdjango.views.generic.date_based.archive_indexviewnews_archive_year,news_archive_month,news_archive_day- ifsettings.ENABLE_NEWS_DATE_ARCHIVEis True, shows news archive by given datenews_tag_detail- if you usedjango-taggingandsettings.NEWS_TAGGINGis True, easy_news provide list of tagged newsTemplate tags:If you want to use easy_news template tags, loadeasy_news_tags:{% load easy_news_tags %}show_newsShows list ofnumlatest news. 5 news in list by default:{% show_news <num> %}calendarRender calendar. If there’s some news at date, shows hyperlink to news. By default, use current date:{% calendar <year> <month> %}Customize:Full settings list:ENABLE_NEWS_LIST(boolean) - render latest news list. Default - TrueENABLE_NEWS_ARCHIVE_INDEX(boolean) - render django generic datearchive indexof news objects. Default - TrueENABLE_NEWS_DATE_ARCHIVE(boolean) - render django generic datefull archiveof news objects. Default - TrueNEWS_TAGGING(boolean) - use news tagging. Default - ifdjango-taggingis installed, True, otherwise FalseClassifiers:Frontpage handlers
Package: django-easyoptions
Easily add moreMetaesque option classes to your Django forms, models and more.InstallingInstall using pip:pip install django-easyoptionsIt works with Django 1.4 and upwards.UsingTo make use of Options in your class,
define an Options class, and
use one of the metaclass factories provided.fromdjangoimportformsfromdjango.utilsimportsixfromeasyoption.optionsimportOptionsBase,form_option_factory# Define your ``Option``\s container classclassExtendedOptions(OptionsBase):def__init__(self,options):# Collect your options, supplying defaults as appropriateself.foo=options.pop('foo',None)self.frobnicate=options.pop('frobnicate',True)# Call the ``super().__init__()``, which ensures all options are# consumed.super(ExtraOption,self).__init__(options)# Define your base class, using the options from ``_extendedoptions``classExtendedForm(six.with_metaclass(form_option_factory(ExtendedOptions),forms.Form)):def__init__(self,**kwargs):super(ExtendedForm,self).__init__(**kwargs)ifself._extendedoptions.frobnicate:self.bar(self._extendedoptions.foo)# Extend your base class, and define the ``ExtendedOptions`` for options# for this specific implementationclassSpecificExtendedForm(ExtendedForm):classExtendedOptions:foo='quux'Methodsoptions.options_factoryThe main method that does all of the work isoptions.options_factory.
It generates a new Metaclass that you should apply to your base class,
allowing subclasses to define their own options.
The method accepts four arguments:options_processorA callable that processes options the options dict from the class.
This is usually a class subclassingoptions.OptionsBase,
but could be any callable as long as it returns some options structure.options_class_nameThe name of the attribute on the class where the options definition can be found.Defaults to theoptions_processor.__name__, which works well with classes.options_attr_nameThe name of the attribute where processed options will be stored.Defaults to'_' + options_class_name.lower().metaclassThe base metaclass to extend.
Many Django classes have metaclasses already,
so if you’re adding options to class that already has a metaclass,
you must supply it here for the class to work properly.Defaults totype.options.form_options_factoryCallsoptions.options_factorywith themetaclassalready set to the metaclass for Django forms.options.modelform_options_factoryCallsoptions.options_factorywith themetaclassalready set to the metaclass for Django model forms.
Package: django-easy-paginate
Django Easy Paginator for API Responsedjango-easy-paginate is a simple Django app to conduct pagination for api responses.Detailed documentation is in the "docs" directory.Quick startAdd "api_paginator" to your INSTALLED_APPS setting like this::INSTALLED_APPS = [
...
'api_paginator',
]Import paginate from api_paginator.api_paginator in views.py as::from api_paginator.api_paginator import paginateUse paginate as ::result = paginate(data_as_array, page_number, per_page_count_integer_value)