Saravanan666/pypi-org huggingface dataset:
Package: django-hashids
Django Hashidsdjango-hashids is a simple and non-intrusive hashids library for Django. It acts as a model field, but it does not touch the database or change the model.FeaturesProxy the internal modelpkfield without storing the value in the database.Allows lookups and filtering by hashid string.Can be used as sort keyAllows specifying a salt, min_length and alphabet globallySupports custom salt, min_length, and alphabet per fieldSupports Django REST Framework SerializersSupports exact ID searches in Django Admin when field is specified in search_fields.Supports common filtering lookups, such as __iexact, __contains, __icontains, though matching is the same as __exact.Supports other lookups: isnull, gt, gte, lt and lte.Installpipinstalldjango-hashidsdjango-hashidsis tested with Django 1.11, 2.2, 3.0, 3.1, 3.2, 4.0 and python 3.6, 3.7, 3.8, 3.9, 3.10.UsageAddHashidsFieldto any modelfromdjango_hashidsimportHashidsFieldclassTestModel(Model):hashid=HashidsField(real_field_name="id")TestModel.hashidfield will proxyTestModel.idfield but all queries will return and receive hashids strings.TestModel.idwill work as before.Examplesinstance=TestModel.objects.create()instance2=TestModel.objects.create()instance.id# 1instance2.id# 2# Allows access to the fieldinstance.hashid# '1Z'instance2.hashid# '4x'# Allows querying by the fieldTestModel.objects.get(hashid="1Z")TestModel.objects.filter(hashid="1Z")TestModel.objects.filter(hashid__in=["1Z","4x"])TestModel.objects.filter(hashid__gt="1Z")# same as id__gt=1, would return instance 2# Allows usage in queryset.valuesTestModel.objects.values_list("hashid",flat=True)# ["1Z", "4x"]TestModel.objects.filter(hashid__in=TestModel.objects.values("hashid"))ConfigThe folloing attributes can be added in settings file to set default arguments ofHashidsField:DJANGO_HASHIDS_SALT: default saltDJANGO_HASHIDS_MIN_LENGTH: default minimum lengthDJANGO_HASHIDS_ALPHABET: default alphabetHashidsFielddoes not reqiure any arguments but the followinig arguments can be supplied to modify its behavior.NameDescriptionreal_field_nameThe proxied field namehashids_instanceThe hashids instance used to encode/decode for this fieldsaltThe salt used for this field to generate hashidsmin_lengthThe minimum length of hashids generated for this fieldalphabetThe alphabet used by this field to generate hashidsThe argumenthashids_instanceis mutually exclusive tosalt,min_lengthandalphabet. Seehashids-pythonfor more info about the arguments.Some common Model arguments such asverbose_nameare also supported.
Package: django-hashphrase
=====django-hashphrase=====django-hashphrase is a django module that facilitates the process thatusers click on a link in an email and django handles the click.Hashlink makes it easy to generate such a link, authenticate it or not,calls a custom function or not, etc.Quick start-----------1. Add "hashphrase" to your INSTALLED_APPS setting like this::INSTALLED_APPS = (...'hashphrase',)2. Include the hashphrase URLconf in your project urls.py like this::url(r'^hl/', include('hashphrase.urls')),3. Also put this at the end of your urls.py like this::from hashphrase import hashphraseviews_autodiscoverhashphraseviews_autodiscover() #autodiscover hashphraseviews.py in apps3. To generate a link::from hashphrase import generate_hashphrasefrom django.contrib.auth.models import Userany_object = User.objects.get(id=1)import datetimeaction = 'my_click_handler'hash_phrase = generate_hashphrase(request.user, any_object, datetime.datetime.now(), action=action)# Then generate for example "http://yourhost.com/hl/"+hash_phrase+"/"# that lick will call the "registered" function4. To register a function, create a file called hashphraseviews.py and put the function in it.::from hashphrase import hashphrase_register@hashphrase_register('my_click_handler')  #name must match action when creating the linkdef test_success(request, has_error, error_code, hash_link, content_obj):"""use hashphrase_register decorator to register this function to be called whenusers click on the email link.be sure to check has_error. If not verified, has_error = TrueSee HashLink class for error code definition"""if has_error or not hash_link or not content_obj:from hashphrase import HashLinkret = "Invalid email link."if error_code == HashLink.ERR_EXPIRED:ret = "Link expired."elif error_code == HashLink.ERR_INVALID_USER:ret = "Needs to login."elif error_code == HashLink.ERR_INVALID_LINK:ret = "Invalid link."return HttpResponse(ret)return HttpResponse("Successful.")
Package: django-hashtag
django-hashtagGitHubTestCheck Demo ProjectCheck the demo repo onGitHubRequirementsPython 3.8+ supported.Django 3.2+ supported.SetupInstall frompip:pipinstalldjango-hashtagModifysettings.pyby adding the app toINSTALLED_APPS:INSTALLED_APPS=[# ..."taggit","hashtag",# ...]Execute Django's commandmigrateinside your project's root:python manage.py migrate
Running migrations:
  Applying hashtag.0001_initial... OK
  Applying hashtag.0002_alter_mytag_slug... OK
  Applying hashtag.0003_alter_mytag_last_used... OKRun Example Projectgitclone--depth=50--branch=django-hashtaghttps://github.com/DLRSP/example.gitDLRSP/examplecdDLRSP/example
pythonmanage.pyrunserverNow browser the app @http://127.0.0.1:8000
Package: django-hateconf
Application for distribuited configurations in djangousage:1. Install django-hateconf in your enviroment (or copy this folder in yourdjango project root.2. Add 'django_hateconf' in yours settings.py INSTALLED_APPS.3. Add in your project's settings.py a dictionary "SETTINGS_BIND":SETTINGS_BIND = {"file":"path/to/settings.<yaml|yml|json|xml|cfg|ini>","bind":("list or tuple", "of names", "of existing", "vars in","settings.py to, bind),"header":"header of your settings file (optional)"}The keysfile: absolute path to the file that contains the variable bindsfor settings.py.The file extention must be (case INsensitive):* ".yml" or ".yaml" for YAML (<http://yaml.org/) filetype. (pyyaml must be installed: http://pyyaml.org/)* ".json" for JSON (http://www.json.org/) file type.* ".xml" for XML (http://www.w3.org/XML/) file type.* ".cfg" or ".ini" for file consists of sections, lead bya "[section]" header, and followed by "name: value"entries, with continuations and such in the style ofRFC 822.bind: List of EXISTING settings.py vars for binding.header: Optional header for binds file.4. Add in the end of settings.py file this 2 lines:import django_hateconfdjango_hateconf.patch(locals())5. Run:$ python manage.py settings --sync6. ENJOY!For more usages see after the 6 steps:python manage.py settings --help
Package: django-hatstall
Hatstall is a Django app to manage the identities in Sorting Hat. You can
edit, list, merge, unmerge and enroll the identities in SortingHat.Detailed documentation is in the “docs” directory.Quick startAdd “hatstall” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'hatstall',
]Include the hatstall URLconf in your project urls.py like this:path('hatstall/', include('hatstall.urls')),Start the development server.Visithttp://127.0.0.1:8000/hatstall/to use it.
Package: django-hattori
Django-HattoriCommand to anonymize sensitive data. This app helps you anonymize data in a database used for development of a Django project.This app is based onDjango-Database-Anonymizer, usingFakerto anonymize the values.InstallationInstall using pip:pip install django-hattoriThen add'hattori'to yourINSTALLED_APPS.INSTALLED_APPS = [
    ...
    'hattori',
]ImportantYou should only run the anonymize process in PRE or development environments. To avoid problems by default anonymization is disabled.To enable you must add to settingsANONYMIZE_ENABLED=TrueUsageHow to execute command:./manage.py anonymize_dbPossible arguments:-a, --app: Define a app you want to anonymize. All anonymizers in this app will be run. Eg.anonymize_db -a shop-m, --models: List of models you want to anonymize. Eg.anonymize_db -m Customer,Product-b, --batch-size: batch size used in the bulk_update of the instances. Depends on the DB machine, default use 500.Writing anonymizersIn order to use the management command we need to defineanonymizers.Create a moduleanonymizers.pyin the given django-appAnanonymizeris a simple class that inherits fromBaseAnonymizerEach anonymizer class is going to representonemodelAn anonymizer has the following members:model: (required) The model class for this anonymizerattributes: (required) List of tuples that determine which fields to replace. The first value of the tuple is the fieldname, the second value is thereplacerget_query_set(): (optional) Define your QuerySetAreplaceris either of typestrorcallableA callablereplaceris a Faker instance or custom replacer.All Faker methods are available. For more info read the official documentationFaker!Examplefrom hattori.base import BaseAnonymizer, faker
from shop.models import Customer

class CustomerAnonymizer(BaseAnonymizer):
    model = Customer

    attributes = [
        ('card_number', faker.credit_card_number),
        ('first_name', faker.first_name),
        ('last_name', faker.last_name),
        ('phone', faker.phone_number),
        ('email', faker.email),
        ('city', faker.city),
        ('comment', faker.text),
        ('description', 'fix string'),
        ('code', faker.pystr),
    ]

    def get_query_set(self):
        return Customer.objects.filter(age__gt=18)Extending the existing replacers with argumentsUse lambdas to extend certain predefined replacers with arguments, likemin_charsormax_charsonfaker.pystr:('code', lambda **kwargs: faker.pystr(min_chars=250, max_chars=250, **kwargs)),Important: don't forget the **kwargs!
Package: django-hautomation
REST API to control home automation deployments coded as Django appsDjango Home Automation is a set of Django apps which provides a REST API meant to
control home automation devices. It also provides a modular framework for
developing home automation drivers to enable more protocolos to be drived by this project.The application by it self wont be enable to manage any home automation protocol
You need to install any protocol module to do this.For example you can usehttps://github.com/jpardobl/hautomation_x10to
manage X10 devices.Further documentation found athttp://jpardobl.com/home-automation-python-project/
Package: django-haveli-admin
Django Haveli AdminImproved theme for Django admin Interface.Django Haveli Admin is alternative Theme forDjangoadministration interface.LicenseDjango Haveli Admin is licensed under BSD-3-Clause license.Docs & PackageDocumentation:https://django-haveli-admin.readthedocs.io/en/latest/Package:https://pypi.org/project/django-haveli-admin/RequirementDjango: 2.1 or aboveUsageproject/settings.pyAlways place the above django's default admin package (django.contrib.admin). So that it could override the existin django theme.INSTALLED_APPS = [

    'django_haveli_admin',
    'django.contrib.admin',
    ...
]What's Newsidebar menu whole tab clickableCan add icon in AppConfig for sidebarCan add Brand ImageUser menu dropdownAdded Home button in sidebarSampleDjango Haveli Admin: LoginDjango Haveli Admin: DashboardDjango Haveli Admin: Nav Sidebar and DropdownDjango Haveli Admin: FiltersDjango Haveli Admin: Change Form
Package: django-haweb
Django app meant to serve a frontend to enable users to issue Domotic commands to
any server running django_hautomation module.This module providesm, through a web interface, an easy way issue domotic commands, as well as
create custom domotic dashboards. Each dashboard has a set of domotic controls to which user
can issue domotic commands.The module belongs to the Home Automation Python Project, you can find further documentation about
it herehttp://blog.digitalhigh.es/home-automation-python-project/Also on this link there is documentation about this module:http://blog.digitalhigh.es/home-automation-python-project/django-haweb/
Package: django-hawk
Django HawkThis package can be used to help create HAWK Authenticated views.Installationpip install django-hawkAdd the following to your Django Settings:DJANGO_HAWK={"HAWK_INCOMING_ACCESS_KEY":"xxx","HAWK_INCOMING_SECRET_KEY":"xxx",}Example UsageTo use the HAWK Authentication, we need to do 2 things:Make sure theHawkResponseMiddlewarerunsCheck the authenticationAdd theHawkResponseMiddlewareto theMIDDLEWAREsetting in your project like so:MIDDLEWARE = [
    ...
    "django_hawk.middleware.HawkResponseMiddleware",
    ...
]To check the authentication you can calldjango_hawk.utils.authenticate_request, if an exception isn't raised then you know that the request is authenticated, see below for examples.fromdjango.httpimportHttpResponsefromdjango_hawk.utilsimportDjangoHawkAuthenticationFailed,authenticate_requestdefsimple_view(request):# Try to authenticate with HAWKtry:authenticate_request(request=request)exceptDjangoHawkAuthenticationFailedase:returnHttpResponse(status=401)# Continue with normal View code...returnHttpResponse("This is a simple view")TestingTests belong in the/django_hawk/tests/directory. You can run the tests by installing the requirements like so:make setupNow you can run the tests using the following command:poetry run python manage.py testTox testsWe usetoxto test compatibility across different Django versions.To run these tests with tox, just run the following:make toxPushing to PyPIPyPI PackageTest PyPI PackageRunningmake build-packagewill build the package into thedist/directory.Runningmake push-pypi-testwill push the built package to Test PyPI.Runningmake push-pypiwill push the built package to PyPI.Setting up poetry for pushing to PyPIFirst you will need to add the test pypy repository to your poetry config:poetry config repositories.test-pypi https://test.pypi.org/legacy/Then go tohttps://test.pypi.org/manage/account/token/and generate a token.Then add it to your poetry config:poetry config pypi-token.test-pypi XXXXXXXXThen you also need to go tohttps://pypi.org/manage/account/token/to generate a token for the real PyPI.Then add it to your poetry config:poetry config pypi-token.pypi XXXXXXXXNow the make commands should work as expected.
Package: django-hawk-drf
Django Hawk DRFThis package providesDjango Rest Frameworkhelper classes for use withDjango Hawk.InstallationRead theDjango Hawk installationdocumentation.Example usageRead theDjango Hawk example usagedocumentation.Add theHawkResponseMiddlewareto theMIDDLEWAREsetting in your project like so:MIDDLEWARE = [
    ...
    "django_hawk.middleware.HawkResponseMiddleware",
    "django_hawk_drf.middleware.HawkResponseMiddleware",
    ...
]To check the you can use thedjango_hawk.authentication.HawkAuthenticationauthentication class.fromrest_framework.responseimportResponsefromrest_framework.viewsetsimportViewSetfromdjango_hawk_drf.authenticationimportHawkAuthenticationclassExampleViewSet(ViewSet):authentication_classes=(HawkAuthentication,)permission_classes=()deflist(self,request):returnResponse([])TestingTests belong in the/django_hawk_drf/tests/directory. You can run the tests by installing the requirements like so:make setupNow you can run the tests using the following command:poetry run python manage.py testTox testsWe usetoxto test compatibility across different Django versions.To run these tests with tox, just run the following:make toxPushing to PyPIPyPI PackageTest PyPI PackageRunningmake build-packagewill build the package into thedist/directory
Runningmake push-pypi-testwill push the built package to Test PyPI
Runningmake push-pypiwill push the built package to PyPI
Package: django-haystack
Haystackauthor:Daniel Lindsleydate:2013/07/28Haystack provides modular search for Django. It features a unified, familiar
API that allows you to plug in different search backends (such asSolr,Elasticsearch,Whoosh,Xapian, etc.) without having to modify your code.Haystack is BSD licensed, plays nicely with third-party app without needing to
modify the source and supports advanced features like faceting, More Like This,
highlighting, spatial search and spelling suggestions.You can find more information athttp://haystacksearch.org/.Getting HelpThere is a mailing list (http://groups.google.com/group/django-haystack/)
available for general discussion and an IRC channel (#haystack on
irc.freenode.net).DocumentationDevelopment version:http://docs.haystacksearch.org/v2.8.X:https://django-haystack.readthedocs.io/en/v2.8.1/v2.7.X:https://django-haystack.readthedocs.io/en/v2.7.0/v2.6.X:https://django-haystack.readthedocs.io/en/v2.6.0/See thechangelogRequirementsHaystack has a relatively easily-met set of requirements.Python 3.6+A supported version of Django:https://www.djangoproject.com/download/#supported-versionsAdditionally, each backend has its own requirements. You should refer tohttps://django-haystack.readthedocs.io/en/latest/installing_search_engines.htmlfor more
details.
Package: django-haystack-channels
Add asynchronous search index updates to your django app with this drop-in support for django, django-channels and haystack!Install from pip or githubAddhaystack_channelstoINSTALLED_APPSUpdate your projects channels routing:from channels.routing import route, route_class, include
from haystack_channels.routing import channel_routing as haystack_channel_routing

channel_routing = [
  # your routes
  include(haystack_channel_routing)
]Update yourHAYSTACK_SIGNAL_PROCESSOR:HAYSTACK_SIGNAL_PROCESSOR = 'haystack_channels.signals.ChannelsAsyncSignalProcessor'Or inherit fromChannelsAsyncSignalProcessorandChannelsAsyncSignalConsumerto build a custom version optimised for your app.
Package: django-haystack-elasticsearch
django-haystack-elasticsearchA set of backends for using multiple versions of Elasticsearch onHaystack.Free software: BSD licenseHow to useMake sure that yourelasticsearchlibrary has the same major version as your Elasticsearch server.Choose the right backend as yourENGINEon Haystack.Elasticsearch 1.x$pipinstall"elasticsearch>=1.0.0,<2.0.0"HAYSTACK_CONNECTIONS={'default':{'ENGINE':'haystack_elasticsearch.elasticsearch.ElasticsearchSearchEngine',...},}Elasticsearch 2.x$pipinstall"elasticsearch>=2.0.0,<3.0.0"HAYSTACK_CONNECTIONS={'default':{'ENGINE':'haystack_elasticsearch.elasticsearch2.Elasticsearch2SearchEngine',...},}Elasticsearch 5.x$pipinstall"elasticsearch>=5.0.0,<6.0.0"HAYSTACK_CONNECTIONS={'default':{'ENGINE':'haystack_elasticsearch.elasticsearch5.Elasticsearch5SearchEngine',...},}CreditsThis project was based on the original Elasticsearch backend forHaystack.
Special thanks to@PedroAquilinoand@joaojuniorfor their work towards ES2 support.This package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2016-12-29)First release on PyPI.
Package: django-haystack-es
Django Haystack backend for Elasticsearch 5.QuickstartInstall Django Haystack ES:pip install django-haystack-esAddhaystack_es.backends.ElasticsearchSearchEngineto yourHAYSTACK_CONNECTIONSengine insettings.pyExampleHAYSTACK_CONNECTIONS={'default':{'ENGINE':'haystack_es.backends.Elasticsearch5SearchEngine',# ...}}Define your indexes usinghaystack_es.indexesinstead ofhaystack.indexes.Example# myapp/search_indexes.pyfromhaystack_esimportindexesfrommyapp.modelsimportMyModelclassMyModelIndex(indexes.SearchIndex,indexes.Indexable):text=indexes.CharField(document=True,use_template=True)# ...If you havecelery-haystackinstalled you can usehaystack_es.indexes.CelerySearchIndexfor defining your SearchIndex utilizing celery-haystackIf you want to utilize additional SearchQuerySet methods usehaystack_es.query.SearchQuerySetinstead ofhaystack.query.SearchQuerySet.Examplefromhaystack_es.queryimportSearchQuerySetsqs=SearchQuerySet().filter(content='some query')sqs.boost_fields({'field_name':2,'some_field':1.5,'another_field':1})sqs.facet('some_field')# ...Differences compared to the default django-haystack Elasticsearch backendIntended for Elasticsearch >= 5Allows query-time fields boosting.Allows query-timenegative boostProvides additional SearchFields;DictField,NestedFieldandGeometryFieldTries to use Elasticsearchfilter contextinstead of query string for filtering results.Usesmulti-fieldsfor creating shadow fields which are useful for performing operations like
faceting and exact matches which need non-analyzed values.Query-time fields boostingfrom haystack_es.query import SearchQuerySet
SearchQuerySet().boost_fields(boost_fields)ExampleSearchQuerySet().boost_fields({'field_name':2, 'another_field': 1})Negative boostingfrom haystack_es.query import SearchQuerySet
SearchQuerySet().boost_negative(query, negative_boost)exampleSearchQuerySet().boost_negative({'match':{'category.raw': 'awfultype'}},negative_boost)Running TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsInspired byhaystack-elasticsearch5:https://github.com/Alkalit/haystack-elasticsearch5Tools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.0 (2017-07-27)First release on PyPI.0.2.8 (2019-07-18)Simplify Django Version in Tox.
Package: django-haystack-panel
A Django Debug Toolbar panel for HaystackAboutThis is a panel forDjango Debug Toolbar1.x that displays query results from
Haystack.InstallationInstall usingpip:pip install django-haystack-panelor install the development version from source:pip install git+git@github.com:streeter/django-haystack-panel.gitThen addhaystack_panelto yourINSTALLED_APPSso that we can find the
templates in the panel. Also, add'haystack_panel.panel.HaystackDebugPanel'to yourDEBUG_TOOLBAR_PANELS.UsageTODOTestingThere are no tests yet. Yeah, I know, I need to add some tests. However,
this has been tested with Haystack version 2.0. I also expect it to work on
at least Haystack >= 1.2.x. Let me know if other versions also work.LicenseUses theMITlicense.
Package: django-haystack-solr-commands
Solr 5.0.0 is easy to deploy with cloud Cores and automatic managed-schema but no more schema.xml file to copy.Solr 5.0.0 can edit a core's configuration via with the Schema REST API.Solr 5.0.0 breaked Haystack version 2.3.1 because it uses managed-schema by default and removes the need to copy a schema.xml file.It also provide a ``bin/solr`` command that start and a Solr daemon service, or administrate the Cores.This what the  ``manage.py solr`` command provided by this Django App# InstallAfter cloning this repositorymkvirtualenv django-hasytack-solr-commandscd django-haystack-solr-commandspip install -r requirements.txtYou will need **wget, tar, rm**Configure Haystack and this app by adding at to your server settings.py to following:HAYSTACK_CONNECTIONS = {'default': {'ENGINE': 'haystack.backends.solr_backend.SolrEngine','URL': 'http://127.0.0.1:8983/solr/haystacksolrcommandsexamplecore/',},}SOLR_DIRECTORY = "."SOLR_VERSION = "5.0.0"SOLR_CORE = 'haystacksolrcommandsexamplecore'Add ``haystack_solr_commands`` to your INSTALLED_APPS# Versions tested:- Python 2.7- Django 1.4+- Haystack 2.3.1 with Solr 5.0.0 support from https://github.com/Stupeflix/django-haystack- Search engine used : Solr 5.0.0 with the latest pysolr- Oracle Java JVM version 7 or 8# About Solr 5.0.0What major changes in 5.0.0 breaks Haystack 2.3.1 apart from the schema.xml and the daemon service start and stop commands ?Quoting CHANGES.txt in the 5.0.0 distribution :```* The following legacy numeric and date field types, deprecated in Solr 4.8, are nolonger supported: BCDIntField, BCDLongField, BCDStrField, IntField, LongField,FloatField, DoubleField, SortableIntField, SortableLongField, SortableFloatField,SortableDoubleField, and DateField.  Convert these types in your schema to thecorresponding Trie-based field type and then re-index.  See SOLR-5936 for moreinformation.```**Sortable*Fields** have been replace with their equivalent **Trie*Field**Since 4.8.0, Apache Solr now requires Java 7 or greater (recommended is Oracle Java 7 or OpenJDK 7, minimum update 55; earlier versions have known JVM bugs affecting Solr).Apache Solr is fully compatible with Java 8.