Saravanan666/pypi-org huggingface dataset:
Package: django-slack-notification
django-slack-notificationsExtremely simple and easy slack integration with django.OverviewRequirementsPython (3.3+)Django (1.7, 1.8, 1.9)Slack Webhook Url:https://api.slack.com/custom-integrationsInstallationInstall usingpippip install django-slack-notificationsAdddjango-slack-notificationsto yourINSTALLED_APPSsetting.INSTALLED_APPS = (
    ...
    'django-slack-notifications',
)AddSLACK_NOTIFICATIONSto yoursettings.pySLACK_NOTIFICATIONS = {
    'WEBHOOK_URL': '{your slack webhook url}'
    'CHANNEL': '{default slack channel that you want to send message.}',
    'USERNAME': '{default message sender name}',
    'ICON_EMOJI': '{default sender emoticon}',
}WEBHOOK URLis required. You can get your webhook url from slack.
Seehttps://api.slack.com/custom-integrationsCHANNEL,USERNAME,ICON_EMOJIis optional parameters. If
default value is set, you don’t need to pass parameter to yoursend_messagemethod. See below.UsageIn your python code,from django-slack-notifications.utils import send_message

send_message(channel='#general', username='test', text="Hi, I'm a test message.")send_messagereturns default slack response. If succeed, it returns
200.If you set default valuesCHANNEL,USERNAME, you can callsend_messagelike…from django-slack-notifications.utils import send_message

send_message(text="Hi, I'm a test message.")channelandusernameis set default value that you defined insettings.pyifICON_EMOJIis not set, it uses default slack webhook integrations
settings that you’ve defined athttps://prnd.slack.com/apps/manage/custom-integrations
Package: django-slack-notifications
django-slack-notificationsExtremely simple and easy slack integration with django.OverviewRequirementsPython (3.3+)Django (1.7, 1.8, 1.9)Slack Webhook Url:https://api.slack.com/custom-integrationsInstallationInstall usingpippip install django-slack-notificationsAdddjango-slack-notificationsto yourINSTALLED_APPSsetting.INSTALLED_APPS = (
    ...
    'django-slack-notifications',
)AddSLACK_NOTIFICATIONSto yoursettings.pySLACK_NOTIFICATIONS = {
    'WEBHOOK_URL': '{your slack webhook url}'
    'CHANNEL': '{default slack channel that you want to send message.}',
    'USERNAME': '{default message sender name}',
    'ICON_EMOJI': '{default sender emoticon}',
}WEBHOOK URLis required. You can get your webhook url from slack.
Seehttps://api.slack.com/custom-integrationsCHANNEL,USERNAME,ICON_EMOJIis optional parameters. If
default value is set, you don’t need to pass parameter to yoursend_messagemethod. See below.UsageIn your python code,from django-slack-notifications.utils import send_message

send_message(channel='#general', username='test', text="Hi, I'm a test message.")send_messagereturns default slack response. If succeed, it returns
200.If you set default valuesCHANNEL,USERNAME, you can callsend_messagelike…from django-slack-notifications.utils import send_message

send_message(text="Hi, I'm a test message.")channelandusernameis set default value that you defined insettings.pyifICON_EMOJIis not set, it uses default slack webhook integrations
settings that you’ve defined athttps://prnd.slack.com/apps/manage/custom-integrations
Package: django-slack-tools
django-slack-toolsLittle helpers working with Slack bot 🤖 in Django.This project aims to implementing helpful features making Slack bot and providing reusable Django apps integrated with database.✨ FeaturesKey features are:Reusable Django app for Slack messaging with various messaging backends for different environmentsDatabase-backed Slack messaging policies with simple dictionary-based templateMessage historiesBuilt-in admin for management working with Slack workspaceAnd more in future roadmap...Celery support for messaging backends, management and shortcut tasks, etc.Django template supportNew Django apps and helpers for Slack features such as modals, event subscription, etc.Currently it is focused on messaging features. In future, hoping to bring more helpful features across Slack Bot ecosystem, such as event subscriptions, modals, bot interactions, etc.🚀 Installationdjango-slack-toolssupports Python 3.8+ and Django 3.2+. Supports for each deps will be dropped as soon as the ends of security updates.Install the package:$pipinstalldjango-slack-toolsAdd the app to the your Django settings:INSTALLED_APPS=[..."django.contrib.messages",# Used in admin"django_slack_tools.slack_messages",...]Add configuration for application:DJANGO_SLACK_TOOLS={# Module path to Slack Bolt application or callable returns the app"SLACK_APP":"path.to.your.slack.app",# Messaging backend configuration"BACKEND":{"NAME":"django_slack_tools.slack_messages.backends.SlackBackend","OPTIONS":{# TODO(#44): Reasonable defaults to reduce some duplicates"slack_app":"path.to.your.slack.app",}}}Then, run the database migration and send messages:fromdjango_slack_tools.slack_messages.messageimportslack_messagemessage=slack_message("I like threading",channel="id-of-channel",header={"reply_broadcast":True},)Please check thedocumentationfor more about details.💖 ContributingAll contributions and helps are welcome. Please check theCONTRIBUTING.mdfile for about details.📜 LicenseThis project is licensed under the terms of the MIT license.
Package: django-slack-utils
django-slack-utilsDjango-slack-utils is helper application to handle Slack requests.It supports verification throughHTTP_X_SLACK_SIGNATUREandHTTP_X_SLACK_REQUEST_TIMESTAMP.InstallationAdd the following to yoursettings.pyINSTALLED_APPS=[...'slack_utils',]SLACK_SIGNING_SECRET='your signing secret from Slack'Add the following to yoururls.pyfromdjango.conf.urlsimportincludefromdjango.urlsimportpathurlpatterns=[...path('slack/',include('slack_utils.urls')),]UsageView decoratorThe@slack_viewdecorator adds CSRF exempt and verification to your function-based django view.fromslack_utils.decoratorsimportslack_viewfromdjango.httpimportHttpResponse@slack_viewdefsample_view(request,*args,**kwargs):# your logicreturnHttpResponse("Hello!")Class-based viewTheSlackViewbase class adds CSRF exempt and verification to your class-based django view.fromslack_utils.viewsimportSlackViewfromdjango.httpimportHttpResponseclassSampleView(SlackView):defpost(self,request,*args,**kwargs):# your logicreturnHttpResponse("Hello!")Slash commandsTo handleSlack slash commands, point the command URL to/slack/commands/.Now just add a handler function toslack.pymodule of your app.fromslack_utils.decoratorsimportslack_command@slack_command('/test')deftest_command(text,**kwargs):# your logicreturn"Hello!"# or {'text': "hello!"}**kwargswould get the rest of the data from Slack requestEvents APIPointSlack events APIto the/slack/events/.Subscription can be done in two ways:Receiver decoratorPut them intoslack.pyof your app or make sure it's loaded once.fromslack_utils.decoratorsimportslack_receiver@slack_receiver('reaction_added')defon_reaction_added(event_data,**kwargs):# your logicSignalfromslack_utils.signalsimportevent_receivedfromdjango.dispatchimportreceiver@receiver(event_received)defon_event_received(sender,event_type,event_data,**kwargs):ifevent_type=='reaction_added':# your logic# your other logic
Package: django-slappy
django-slappyThis is a django app that allows you to run python interactively in slack. It requires an
existing server running django.FeaturesVariable PersistenceShared Scopeallows interactivity between usersMulti-linersFool ProofLong running code will be terminatedExit preventionInstallationNeed an already running django sitepip install django-slappyAdd "django_slappy" to your INSTALLED_APPS setting like thisINSTALLED_APPS=[...'django_slappy',]Include the URLconf in your project urls.py like thispath('slappy/', include('django_slappy.urls'))Create a slack appand add command with url 'http://your-server/slappy/'Install to workspace. Slack will give you an OAUTH secret. Paste to yoursettings.pylike
followingSLACK_OAUTH_SECRET = "abab-1231231231232-sfasfasdf-12312312"A better practice is to use environment variable.NoteOf course you'll expose your server to remote-exploitation.Make sure your have nice people in your workspace, otherwise prepare to get your entire server deleted
Package: django-sld
django-sldA django library that generates SLD documents from geographic models.RequirementsdjangoRequired for models and spatial fields.python-sldRequired for reading and generating SLD XML files.pysalRequired for classification algorithms.colorbrewerRequired for color lookup definitions.To install these requirements, you may use pip to install these packages
(except for django) with this command:> sudo pip install -r requirements.txtInstallation> easy_install django-sldOR> pip install django-sldUsageThis library implements a single module named “generator” that contains all
the methods of interacting with the classification algorithms. Assuming that
you have a geographic model in geodjango, you may classify your distribution
with by constructing a queryset, and feeding it to the generator.Assuming you have a spatial model namedMySpatialModel, with a data field
ofpopulation, you can classify all your data into 10 quantile classes with:from djsld import generatorqs = MySpatialModel.objects.all()
sld = generator.as_quantiles(qs, ‘population’, 10)You may also any queryset to generate classes, such as a filtered queryset:qs = MySpatialModel.objects.filter(owner__name = ‘David’)
sld = generator.as_quantiles(qs, ‘population’, 10)If your spatial model has a different geometry column name other than ‘geom’,
you may specify that field as thegeofieldkeyword:sld = generator.as_quantiles(qs, ‘population’, 10, geofield=’state’)The data field may also be distantly related to the queryset in question. For
this example, assume thatMySpatialModelhas a foreign key to a model namedRoute, and that the data value you would like to classify is a field of theRoutemodel:sld = generater.as_quantiles(qs, ‘route__traffic’, 10)By default, all the generator methods use a plain black-to-white color ramp.
The number of classes must match an available color scheme, or the color ramp
will default to black-to-white. You may specify a colorbrewer ramp name with
thecolorbrewernamekeyword:sld = generator.as_quantiles(qs, ‘population’, 9, colorbrewername=’Greys’)You may also reverse the order of the ramp, by specifying theinvertgradientkeyword:sld = generator.as_quantiles(qs, ‘population’, 9, colorbrewername=’Reds’,invertgradient=True)SupportIf you have any problems, questions, or comments, please visit the django-sld
project on github:https://github.com/azavea/django-sld/
Package: django-slds
=============================django.slds=============================.. image:: https://badge.fury.io/py/django-slds.png:target: https://badge.fury.io/py/django-slds.. image:: https://travis-ci.org/jlantz/django-slds.png?branch=master:target: https://travis-ci.org/jlantz/django-sldsDjango implementation of the Salesforce Lightning Design SystemDocumentation-------------The full documentation is at https://django-slds.readthedocs.org.Quickstart----------Install django.slds::pip install django-sldsThen use it in a project::import django_sldsFeatures--------* TODORunning Tests--------------Does the code actually work?::source <YOURVIRTUALENV>/bin/activate(myenv) $ pip install -r requirements_test.txt(myenv) $ python runtests.pyCredits---------Salesforce Lightning Design System Licenses===========================================* Source code is licensed under [BSD License Clause 2](http://opensource.org/licenses/BSD-2-Clause)* All icons and images are licensed under [Creative Commons Attribution-NoDerivatives 4.0](http://creativecommons.org/licenses/by-nd/4.0/)* The font is licensed under our [font license](https://www.lightningdesignsystem.com/assets/licenses/License-for-font.txt)Tools used in rendering this package:*  Cookiecutter_*  `cookiecutter-djangopackage`_.. _Cookiecutter: https://github.com/audreyr/cookiecutter.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackageHistory-------0.1.0 (2016-09-16)++++++++++++++++++* First release on PyPI.
Package: django-slds-crispyforms
Django Crispy Forms template overrides for rendering forms using the Salesforce Lightning Design SystemDocumentationThe full documentation is athttps://django-slds-crispyforms.readthedocs.org.QuickstartInstall django_slds_crispyforms:pip install django-slds-crispyformsThen use it in a project:import django_slds_crispyformsFeaturesTODORunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r requirements_test.txt
(myenv) $ python runtests.pyCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.0 (2016-09-16)First release on PyPI.
Package: django-sloop
This package contains some tools that will ease the implementation of push notifications using AWS SNS and other backends into django projects.Django-SloopInstallationInstall the package via Github or PIP (pip install django-sloop)Adddjango_sloopto the INSTALLED_APPS list in the settings file.Extend the django_sloop.models.AbstractSNSDevice class and create your own push token device model.# models.pyfromdjango_sloop.modelsimportAbstractSNSDeviceclassDevice(AbstractSNSDevice):pass# (Optional) if you need to override Meta.classMeta(AbstractSNSDevice.Meta):passMake sure that you fill necessary information at the settings file:# settings.pyDJANGO_SLOOP_SETTINGS={"AWS_REGION_NAME":"","AWS_ACCESS_KEY_ID":"","AWS_SECRET_ACCESS_KEY":"","SNS_IOS_APPLICATION_ARN":"test_ios_arn","SNS_IOS_SANDBOX_ENABLED":False,"SNS_ANDROID_APPLICATION_ARN":"test_android_arn","LOG_SENT_MESSAGES":False,# False by default."DEFAULT_SOUND":"","DEVICE_MODEL":"module_name.Device",}You cannot change the DEVICE_MODEL setting during the lifetime of a project (i.e. once you have made and migrated models that depend on it) without serious effort. The model it refers to must be available in the first migration of
the app that it lives in.Create migrations for newly created Device model and migrate.Note:django_sloop's migrations must run after your Device is created. If you run into a problem while running migrations add following to the your migration file where the Device is created.run_before = [
   ('django_sloop', '0001_initial'),
]Add django_sloop.models.PushNotificationMixin to your User model.classUser(PushNotificationMixin,...):passuser.send_push_notification_async(message="Sample push notification.")Add django_sloop.admin.SloopAdminMixin to your UserAdmin to enable sending push messages to users from Django admin panel.# admin.pyfromdjango_sloop.adminimportSloopAdminMixinfromdjango.contribimportadminclassUserAdmin(SloopAdminMixin,admin.ModelAdmin):actions=("send_push_notification",)Add django rest framework urls to create and delete device.# urls.pyfromdjango.urlsimportpathfromdjango.urlsimportincludeurlpatterns=[# ...path('api/devices/',include('django_sloop.urls')),# ...]Done!
Package: django-slots
django_slotsAllows multiline strings to be captured and passed to template tags.DemoRegister a component# app/templatetags/component_tags.pyfromdjango_slotsimportLibrary,Componentregister=Library()@register.block_componentclassDetails(Component):passCreate a template{# app/templates/components/details.html #}<details><summary>{{summary|default:slots.summary}}</summary>{{slot}}</details>Usage:{%loadcomponent_tags%}{%loadslot_tags%}{%detailssummary="the summary"%}the default slot
{% /details %}{%details%}{%slotsummary%}the<b>summary</b>{% /slot %}
  the default slot
{% /details %}Installationpipinstalldjango-slotsINSTALLED_APPS=[# ...'django_slots',]SlotsUse{% slot name %}{% /slot %}to capture and name a slot. These slots will be available in the template in a dictionary calledslots. eg{{ slots.name }}.Any lines not surrounded by a slot tag will be available in the component template as{{ slot }}.TemplateThe default the template path iscomponents/<component_name>.html.Usetemplate_nameattribute orget_template_name()method to override.Change nameBy default, the template tag name will be the Component class name converted to snake case. Use thenameattribute to override.eg:fromdjango_slotsimportComponent,Libraryregister=Library()@register.inline_componentclassButton(Component):name='btn'{%btn%}Change name formatBy default, inline tags are named"{name}/"and block tags are named"{name}", "/{name}". To change this format specifyinline_tag_nameandblock_tag_namesattributes.eg:fromdjango_slotsimportComponent,Libraryregister=Library()classAppComponent(Component):inline_tag_name="{name}end"block_tag_names="{name}","end{name}"@register.componentclassButton(AppComponent):pass{%buttonend%}{%button%}{%endbutton%}Inline only template tagUse@register.inline_componentto only allow{% inline/ %}use.Block only template tagUse@register.block_componentto only allow{% block %}{% /block %}use.Validate argumentsImplementdef get_content_data(slots, **kwargs)to validate arguments.eg:fromdjango_slotsimportComponent,Libraryregister=Library()@register.componentclassButton(Component):STYLE=["primary","secondary"]defget_context_data(self,slots,*,style:str):ifstylenotinself.STYLE:raiseself.validation_error(f"style{style!r}not in{self.STYLE!r}")returnsuper().get_context_data(slots,style=style)Namespace componentsComponents can be namespaced which is useful for creating a third party app.fromdjango_slotsimportLibrary,Componentregister=Library()classNHSUKComponent(Component):namespace='nhsuk'@register.componentclassButton(NHSUKComponent):pass{%nhsuk:button%}Save and continue
{% /nhsuk:button %}Seehttps://github.com/nwjlyons/nhsuk-components
Package: django-slowdown
Ultra simple slowdown middleware for django (Add a time.sleep(settings.SLOWDOWN / 1000) in a middleware).Installpip install django-slowdownUsageAdd your settings file the Slowdown middleware and the SLOWDOWN setting
variable (the default value is 1000 miliseconds).MIDDLEWARE_CLASSES += ["slowdown.middleware.SlowDownMiddleware"]
SLOWDOWN = 3000
Package: django-slow-log
django-slow-logis an additional logging layer that keeps a log similar to
an apache or nginx request log, but adds additional higher level information
about the state of the process and the resources used by the server during
the generation of the response.installing/usageTo use, add to yourMIDDLEWARE_CLASSESin settings.py:MIDDLEWARE_CLASSES = (
    'django_slow_log.middleware.SlowLogMiddleware',
    ...
)settingsDJANGO_SLOW_LOG_PRINT_ONLYdo not keep a log in a file, only print; this can be useful for use on your
devbox (via runserver)DJANGO_SLOW_LOG_LOCATIONpath of the log file (default:/var/log/django-slow.log)
Package: django-slowtests
django-slowtests========================.. image:: https://travis-ci.org/realpython/django-slow-tests.svg?branch=master:target: https://travis-ci.org/realpython/django-slow-tests.. image:: https://coveralls.io/repos/realpython/django-slow-tests/badge.svg?branch=master:target: https://coveralls.io/r/realpython/django-slow-tests?branch=master.. image:: https://img.shields.io/pypi/v/django-slowtests.svg:target:  https://pypi.python.org/pypi/django-slowtests/.. image:: https://img.shields.io/badge/license-MIT-blue.svg:target:  https://pypi.python.org/pypi/django-slowtests/Welcome!--------Welcome to the documentation for django-slowtests!*Code tested on Django 1.6, 1.7, 1.8, 1.9, 1.10 and 1.11 with Python 2.7 and 3.6Instructions-------------1. Install::$ pip install django-slowtests2. Add the following settings::TEST_RUNNER = 'django_slowtests.testrunner.DiscoverSlowestTestsRunner'NUM_SLOW_TESTS = 10# (Optional)SLOW_TEST_THRESHOLD_MS = 200  # Only show tests slower than 200ms# (Optional)ALWAYS_GENERATE_SLOW_REPORT = False  # Generate report only when requested using --slowreport flag3. Run test suite::$ python manage.py test3.1. Save report to file::$ python manage.py test --slowreportpath report.json3.2. Generating full reports to file::In some situations, you may need to generate full tests reports. To do so,set NUM_SLOW_TESTS to None in your settings and run the following command:$ python manage.py test --slowreportpath report.json4. Sample output::$ python manage.py testCreating test database for alias 'default'.............----------------------------------------------------------------------Ran 10 tests in 0.413sOKDestroying test database for alias 'default'...Ten slowest tests:0.3597s test_detail_view_with_a_future_poll (polls.tests.PollIndexDetailTests)0.0284s test_detail_view_with_a_past_poll (polls.tests.PollIndexDetailTests)0.0068s test_index_view_with_a_future_poll (polls.tests.PollViewTests)0.0047s test_index_view_with_a_past_poll (polls.tests.PollViewTests)0.0045s test_index_view_with_two_past_polls (polls.tests.PollViewTests)0.0041s test_index_view_with_future_poll_and_past_poll (polls.tests.PollViewTests)0.0036s test_index_view_with_no_polls (polls.tests.PollViewTests)0.0003s test_was_published_recently_with_future_poll (polls.tests.PollMethodTests)0.0002s test_was_published_recently_with_recent_poll (polls.tests.PollMethodTests)0.0002s test_was_published_recently_with_old_poll (polls.tests.PollMethodTests)Running the Tests------------------------------------You can run the tests via::$ python setup.py testor::$ make testor::$ make allor::$ python runtests.pyKnown Issues------------License-------This code is distributed under the terms of the MIT license. See the `LICENSE` file.
Package: django-sluggable
django-sluggable is a library to manage your slugs and redirect old slugs
to a new one. With this library, you will have the plain history of your operations.InstallationTo install it, simplypip install django-sluggableDocumentationFor documentation, usage, and examples, see:http://django-sluggable.readthedocs.orgInspirationSome code are fromdjango-autoslugand old codebase of Ulule bytwidi.A big thanks to them.
Package: django-slugger
Automatic slug field for your Django models.FeaturesOne query to rule them all. No database spam on model save.Supports all standard “unique_for” field attributes likeunique_for_date.Supports model metaunique_together.Supports custom “slugify” functions.How it worksdjango-slugger providesAutoSlugFieldwhich value is automatically
generated if it is not filled manually. If the field has any “uniqueness”
constraint (unique=True, for example), numerical suffix will be used if
necessary to prevent constraint violation.If generated slug exceeds fieldmax_length, slug value will be cut to
fit in. This does not apply to suffixed slugs. Increasemax_lengthattribute value or usecustom slug templateif you need more space to
ensure slug uniqueness.Installationpipinstalldjango-sluggerUsagefromsluggerimportAutoSlugFieldclassAutoSlugModel(models.Model):title=models.CharField(max_length=255)slug=AutoSlugField(populate_from='title')Custom slug templateBy default, django-slugger will use Djangoslugifyfunction
(combined withunidecodeto handle non-ASCII characters). To use your own function,
specify it inslugifyargument.defcustom_slugify(value):return'custom-%s'%valueclassCustomAutoSlugModel(models.Model):title=models.CharField(max_length=255)slug=AutoSlugField(populate_from='title',slugify=custom_slugify)Noteslugifyargument must be top-level named function.