Saravanan666/pypi-org huggingface dataset:
Package: wagtail-django-recaptcha
Wagtail ReCaptchaWagtail forms with a ReCaptcha form field/widget integration app. Wagtail ReCaptcha provides an easy way to integrate thedjango-recaptchafield when using the Wagtail formbuilder.Check outAwesome Wagtailfor more awesome packages and resources from the Wagtail community.InstallationInstall wagtailcaptcha via pippip installwagtail-django-recaptchaor addwagtailcaptchato your Python path.Addwagtailcaptchato yourINSTALLED_APPSsetting.Config django-recaptcha as explained inhere.UsageFieldThe quickest way to add a captcha field to a Wagtail Form Page is to inherit from the two options provided,WagtailCaptchaFormorWagtailCaptchaEmailForm. The first options inherits fromAbstractFormwhile the seconds does it fromAbstractEmailForm. Either way your page is going to display a captcha field at the end of the form.Examplefromwagtail.contrib.forms.modelsimportAbstractFormFieldfromwagtail.admin.panelsimportFieldPanel,InlinePanel,MultiFieldPanelfromwagtail.fieldsimportRichTextFieldfrommodelcluster.fieldsimportParentalKeyfromwagtailcaptcha.modelsimportWagtailCaptchaEmailFormclassSubmitFormField(AbstractFormField):page=ParentalKey('SubmitFormPage',related_name='form_fields')classSubmitFormPage(WagtailCaptchaEmailForm):body=RichTextField(blank=True,help_text='Edit the content you want to see before the form.')thank_you_text=RichTextField(blank=True,help_text='Set the message users will see after submitting the form.')classMeta:verbose_name="Form submission page"SubmitFormPage.content_panels=[FieldPanel('title',classname="full title"),FieldPanel('body',classname="full"),FieldPanel('thank_you_text',classname="full"),InlinePanel('form_fields',label="Form fields"),MultiFieldPanel([FieldPanel('to_address'),FieldPanel('from_address'),FieldPanel('subject'),],"Email notification")]The captcha field can’t be added from the admin UI but will appear in your frontend as the last of the form fields.If you need to customise the behaviour of the form builder, make sure to inherit fromwagtailcaptcha.forms.WagtailCaptchaFormBuilderinstead of Wagtail’s default form builder, then declare it as usual on the page model.fromwagtailcaptcha.formsimportWagtailCaptchaFormBuilderfromwagtailcaptcha.modelsimportWagtailCaptchaFormclassCustomFormBuilder(WagtailCaptchaFormBuilder):# Some custom behaviour...classFormPage(WagtailCaptchaForm):form_builder=CustomFormBuilder# The rest of the page definition as usual...For a more thorough example,Made with Wagtail(github.com/springload/madewithwagtail) is an example of an open-source site using this module.DevelopmentInstallationRequirements:virtualenv,pyenv,twinegitclonegit@github.com:springload/wagtail-django-recaptcha.gitcdwagtail-django-recaptcha/virtualenv.venvsource./.venv/bin/activatemakeinitCommandsUsemake helpto get a list of commands.ReleasesMake a new branch for the release of the new version.Update theCHANGELOG.Update the version number inwagtailcaptcha/__init__.py, following semver.Make a PR and squash merge it.Back onmasterwith the PR merged, usemake publish(confirm, and enter your password).Finally, go to GitHub and create a release and a tag for the new version.Done!
Package: wagtaildocs-previews
Extend Wagtail’s Documents with image previews and metadata from FilePreviewsInstallingInstall withpip:$pipinstallwagtaildocs_previewsSettingsIn your settings file, addwagtaildocs_previewstoINSTALLED_APPS:INSTALLED_APPS=[# ...'wagtaildocs_previews',# ...]You’ll also need to setWAGTAILDOCS_DOCUMENT_MODEL.WAGTAILDOCS_DOCUMENT_MODEL='wagtaildocs_previews.PreviewableDocument'URL configurationfromwagtaildocs_previewsimporturlsaswagtaildocs_urlsurlpatterns=[# ...url(r'^documents/',include(wagtaildocs_urls)),# ...]UsageSince we’re extending viaWAGTAILDOCS_DOCUMENT_MODELyou should be usingget_document_model()to reference to correct Document model.fromwagtail.wagtailcore.modelsimportPagefromwagtail.wagtaildocs.modelsimportget_document_modelfromwagtail.wagtaildocs.edit_handlersimportDocumentChooserPanelclassBookPage(Page):book_file=models.ForeignKey(get_document_model(),null=True,blank=True,on_delete=models.SET_NULL,related_name='+')content_panels=Page.content_panels+[DocumentChooserPanel('book_file'),]In your template now you’ll be able to access thepreview_datafield.{% extends "base.html" %}
{% load wagtailcore_tags %}

{% block body_class %}resource-page{% endblock %}

{% block content %}<h1>Book</h><h2>{{ page.book_file.title }}</h2><imgsrc="{{ page.book_file.preview_data.preview.url|default:'http://placehold.it/300x300' }}"alt="">{% endblock %}
Package: wagtail-download-counter
Wagtail Download CounterWagtail Download Counter is an add-on forWagtail CMSthat keeps track of the number of times a document has been downloaded and shows the count in the Wagtail admin interface.UsageIn your settings file add the following:INSTALLED_APPS=[...'downloadcounter',...]Make sure you adddownloadcounterbeforewagtail.wagtaildocsin the installed apps.Run migrations and you’re set.
Package: wagtail-draftail-anchors
Wagtail Draftail AnchorsAdds the ability to add and edit anchors in the Draftail rich text editor, as well as automatically adding
(slug-form) anchor ids to all headings.InstallationInstall usingpip:pip install wagtail-draftail-anchorsAdd'wagtail_draftail_anchors'toINSTALLED_APPSbelowwagtail.admin.Add'anchor-identifier'to the features of any rich text field where you have overridden the default feature list. The feature must be added before any heading('h1',...,'h6') feature:body = RichTextField(features=['anchor-identifier', 'h2', 'h3', 'bold', 'italic', 'link'])ConfigurationRendered representation of anchorsBy default,anchor-identifierrich text entities will be rendered as HTMLanchorelements, e.g.:<ahref="#my-element"id="my-element"data-id="my-element">My element</a>This package provides an alternative renderer that rendersanchor-identifierentities as HTMLspanelements, e.g.:<spanid="my-element">My element</span>The desired renderer can be specified using theDRAFTAIL_ANCHORS_RENDERERsetting. To use thespanrenderer, configure your application as follows:DRAFTAIL_ANCHORS_RENDERER="wagtail_draftail_anchors.rich_text.render_span"It is possible to define your own renderer. It should be a callable that takes adictof attributes, and returns a string containing the opening tag of the HTML element that represents the anchor target. Thedictpassed to the renderer, for an anchor with an identifier of"my-anchor", would look like the following:{"data-id":"my-anchor","href":"#my-anchor","id":"my-anchor","linktype":"my-anchor"}If you define your own renderer, you should set the value ofDRAFTAIL_ANCHORS_RENDERERto your custom renderer's import path.Seerender_spanandrender_ainwagtail_draftail_anchors.rich_textfor examples.
Package: wagtail-draftail-hovercard
Wagtail Draftail HovercardA Wagtail plugin that adds a hovercard to Wagtail's Draftail rich text editor. You are responsible for rendering the hovercard in your frontend.RequirementsWagtail 4.2+InstallationInstall the packagepipinstallwagtail-draftail-hovercardAddwagtail_draftail_hovercardto yourINSTALLED_APPSINSTALLED_APPS=[# ..."wagtail_draftail_hovercard",# ...]Add thehovercardfeature to yourRichTextFieldorRichTextBlockclassMyModel(models.Model):content=RichTextField(features=["hovercard"])That's it! You now have a hovercard feature in your Draftail editor toolbar.Rendering the hovercard on the frontend of your siteYou are responsible for rendering the hovercard in your frontend. The rich text representation in limited to a<span>element with the extra fields added as data attributes. You need to write some JS to look forspan[data-type="hovercard"]and replace it with your whatever you want to render.Here's what the HTML rendered by Draftail looks like:<spandata-type="hovercard"data-text="I'm the text inside the hovercard"data-heading="I'm the heading or I can be blank">I'm the text that the hovercard is attached to</span>LicenseThis project is licensed under the MIT License - see theLICENSEfile for details.
Package: wagtail-draftail-katex
Wagtail Katex pluginIntegrate KaTex render into the Wagtail CMS Draftail editor..This image shows a rendered value:Simple dialog for editing the LaTeX codes:Installationpip install wagtail-katek-pluginAdddraftail_katexto your list of installed apps AFTER all wagtail app includes
(e.g. wagtail.admin, wagtail.core etc).UsageDevelopmentCreate a local virtualenv using python3python3 -m venv .venv3
source .venv3/bin/activateOn windows, thesourcecommand above is different. you need to run the setup script.venv3\Scripts\activateInstall the development requirementspip install -r requirements_dev.txtResourcesThis plugin uses the KaTeX javascript renderer to render the input text to an output format. More information can be found here:https://khan.github.io/KaTeX/Including a reference to the LaTeX Math syntax supported.
Package: wagtail-draftail-snippet
wagtail-draftail-snippetWagtail has support for adding numerous types of links toRichTextcontent, but there is not a way to tie a link to an arbitrarysnippetmodel currently.wagtail-draftail-snippetprovides a way to create either ana hrefelement for a specificsnippetmodel based on a template that can be provided, or a completely free-form piece of HTML for a snippet.The project provides the following draftail (Wagtail Richtext editor) features:snippet-link: Allows to create a link using the snippet chooser modal. The link is rendered using the template{app_name}/{model_name}_snippet_link.html.snippet-embed: Allows to embed a block using the snippet chooser modal. The block is embedded using the template{app_name}/{model_name}_snippet_embed.html.Unsure whether you want to use a snippet link or embed? Embeds have complete flexibility, but 1) break the flow of text in the Draftail richtext editor and 2) can't be used to link arbitrary text. If you want to render a link to a snippet model inside of body copy, then you probably want to use the snippet link. For anything else, the embed can be used.Installpip install wagtail-draftail-snippetAddwagtail_draftail_snippettoINSTALLED_APPSin Django settingsAdd"snippet-link"and"snippet-embed"to thefeatureskeyword list argument when instantiating aRichTextBlock, e.g.paragraph = RichTextBlock(features=["bold", "italic", "h1", "h2", "h3", "snippet-link", "snippet-embed"])Create a frontend template to determine how the snippet model will be rendered. Frontend templates are required for a snippet to be selected and are discovered when they match a path like{app_name}/{model_name}_snippet_link.htmland{app_name}/{model_name}_snippet_embed.html. For example, if you have anAffiliatesnippet model inaffiliates/models.py, then a file inaffiliates/templates/affiliates/affiliate_snippet_link.htmlandaffiliates/templates/affiliates/affiliate_snippet_embed.htmlwould be required.Example use-caseWagtail is used for a content site that will display articles that have affiliate links embedded inside the content. Affiliate links have a snippet data model to store information with a URL, start, and end dates; the urls need to be rendered in such a way that JavaScript can attach an event listener to their clicks for analytics.When the content gets rendered, it uses the specific affiliate model to get the URL stored in the snippet model. If the affiliate's URL ever changes, the snippet can be changed in the Wagtail admin, and the all of the content will use the correct link when rendered.An example frontend template inaffiliates/templates/affiliates/affiliate_snippet_link.htmlcould be the following.<a href="{{ object.url }}" data-vars-action="content-cta" data-vars-label="{{ object.slug }}" rel="sponsored">RequirementsThe package requires Wagtail 2.5 or above.Build the librarypoetry buildPush a new version release to PyPITravis-CI will build the library and deploy it to PyPI on every commit tomasterthat is tagged with a version.Run testspoetry installpoetry run pytestContributorsParbhat PuriAdam HillBrady MoeLicenseBSD
Package: wagtaildraftsharing
wagtaildraftsharingShareWagtaildrafts with private URLs.wagtaildraftsharing makes it easier to share Wagtail draft content for review by users who don't have access to the Wagtail admin site. It allows you to generate random urls to expose the revisions of your Wagtail pages.SetupInstall the package using pip:pipinstallwagtail-sharingAddwagtaildraftsharingas an installed app in your Django settings:# in settings.pyINSTALLED_APPS=(...'wagtaildraftsharing','wagtail.admin',...)Sincewagtaildraftsharingoverrides one of thewagtail.admintemplates, it must be listed afterwagtail.adminin theINSTALLED_APPSlist.This package also makes use ofwagtail.snippets, so it must be included in your list of installed apps.Run migrations to create the required database tables:pythonmanage.pymigratewagtaildraftsharingAdd thewagtaildraftsharingurls to yoururls.py:# in urls.pyimportwagtaildraftsharing.urlsaswagtaildraftsharing_urlsurlpatterns+=[path("wagtaildraftsharing/",include(wagtaildraftsharing_urls)),# or whatever url you want]Each draft in the history page for any page (/admin/pages/<id>/history/) will now have an additional action -Copy external sharing url. Clicking this will generate a random url (and copy it to the clipboard) that can be shared with anyone. The url will display the draft version of the page.All generated links can be viewed at/admin/wagtaildraftsharing/.Each link can be edited to expire at a certain date, or to be disabled immediately.SettingsThe following settings can be added to your Django settings file:WAGTAILDRAFTSHARING_MAX_AGEThe default expiry time for generated links, in seconds. Defaults to 1 week. Set it to a negative value to disable expiry.
Package: wagtail-dynamic-choice
wagtail-dynamic-choiceA collection of useful Wagtail blocks for selecting items. Please bear with us while we prepare more detailed documentation.Compatibilitywagtail-dynamic-choice' major.minor version number indicates the Wagtail release it is compatible with. Currently this is Wagtail 4.1.xInstallationInstall usingpip:pipinstallwagtail-dynamic-choiceAddwagtail_dynamic_choiceto yourINSTALLED_APPSsetting:INSTALLED_APPS=[# ...'wagtail_dynamic_choice'# ...]
Package: wagtail-dynamic-dropdown
Wagtail Dynamic DropdownA Django application which allow to use dynamically defined choices that
will be updated every time the user opens edit/create page. Moreover,
the choices are not migrated to the database.Install::pip install wagtail-dynamic-dropdownThen addwagtail_dynamic_dropdownto your installed apps:::INSTALLED_APPS = [
...
'wagtail_dynamic_dropdown'
]Usage###1. Define function that will return choices.. code:: pythondef dynamic_choices():
"""
Choices creation logic
"""
return choicesThis function should return iterable which contains list of touples.
Example of valid choices:.. code:: pythonchoices = (
('choice_1','label_1'),
('choice_2','label_2')
)###2. Use your function with DynamicDropdownPanelIn your model create CharField field. Then pass its name and path to
choice function as arguments in DynamicDropdownPanel.. code:: pythonfrom wagtail_dynamic_dropdown.edit_handlers import DynamicDropdownPanelclass MyModel():
...
my_dynamic_choices = models.CharField(max_length=255, blank=True,null=True)content_panels = [
       DynamicDropdownPanel("my_dynamic_choices", "app_name.folder_name.file_name.function_name")
       ]Or, instead of defining a function path, you can import it and pass it
as an argument.. code:: pythonfrom wagtail_dynamic_dropdown.edit_handlers import DynamicDropdownPanel
from app_name.folder_name.file_name import function_nameclass MyModel():
...
my_dynamic_choices = models.CharField(max_length=255, blank=True,null=True)content_panels = [
       DynamicDropdownPanel("my_dynamic_choices", function_name)
       ]
Package: wagtail-dynamic-stream-block
wagtail-dynamic-stream-blockA Wagtail stream block whose child blocks are determined at runtime. Please bear with us while we prepare more detailed documentation.Compatibilitywagtail-dynamic-stream-block' major.minor version number indicates the Wagtail release it is compatible with. Currently this is Wagtail 4.1.xInstallationInstall usingpip:pipinstallwagtail-dynamic-stream-blockAddwagtail_dynamic_stream_blockto yourINSTALLED_APPSsetting:INSTALLED_APPS=[# ...'wagtail_dynamic_stream_block'# ...]
Package: wagtail-easyAI
OverviewEasyAIis a user interface that acts like a drag and drop machine learning software. It allows the user to input their data and the program takes over for them by using the best, most accurate machine learning algorithm. This removes the middle ground and allows the researcher to focus on collecting, and interpreting the data rather than figuring out the best algorithm to use.EasyAIalso gives the user the option of visualizing the data through different charts and graphs. The best part is that they are formatted in a professional way so that they can be usedimmediately.DocumentationFind our work-in-progress documentation athttps://wagtail-easyAI.readthedocs.io/en/latest/?For ContributorsWe would love extra help! We are accepting pull requests and issues, and our
team members will review your revisions or concerns and work with you to make it
happen if it aligns with our project goals.
Package: wagtail-editable-help
Wagtail Editable HelpMake help text editable in the Wagtail adminLinksDocumentationChangelogContributingDiscussionsSecuritySupported versionsPython 3.8 - 3.12Django 3.2 - 4.2Wagtail 4.1 - 5.2InstallationRunpip install wagtail-editable-helpAdd"wagtail_editable_help"to INSTALLED_APPSFor Wagtail 5.1 and below: add"wagtail.contrib.modeladmin"to INSTALLED_APPS if not already presentRun./manage.py migrateOptional: add"wagtail_editable_help.middleware.EditableHelpMiddleware"to the MIDDLEWARE setting, somewhere below"django.contrib.auth.middleware.AuthenticationMiddleware". Enabling this middleware will add an "Edit" link at the point the help text is shown, to allow superusers and other users with the appropriate permission to edit the help text.UsageFor anyhelp_textargument that you wish to make editable:from wagtail_editable_help.models import HelpTextthen replacehelp_text="Some help text"withhelp_text=HelpText("model", "identifier", default="Some help text"). The model and identifier strings serve as a unique identifer for the help text string and to organise the strings in the admin interface - they do not need to exactly match the model or field name.HelpTextis valid within any definition that supports help text strings, not just model fields - such as form fields and StreamField blocks.For example:class HomePage(Page):
    tagline = models.CharField(max_length=255, help_text="Write something snappy here")could be rewritten to:from wagtail_editable_help.models import HelpText

class HomePage(Page):
    tagline = models.CharField(max_length=255, help_text=HelpText("Home page", "tagline", default="Write something snappy here"))The help text string will then be made available for editing within the Wagtail admin under Settings -> Help text, under the heading "Home page tagline".
Package: wagtailembedder
# wagtailembedder [![PyPI](https://img.shields.io/pypi/v/wagtailembedder.svg)](https://pypi.python.org/pypi/wagtailembedder)> Snippets embedder for Wagtail RichTextField.*Check out [Awesome Wagtail](https://github.com/springload/awesome-wagtail) for more awesome packages and resources from the Wagtail community.*![Wagtailembedder scnreenshot](./screenshot.png)## QuickstartInstall the package with```shpip install wagtailembedder```Add `wagtailembedder` to your `settings.py` in the `INSTALLED_APPS` section:```pythonINSTALLED_APPS = [...'modelcluster','wagtailembedder','core',...]```For each models registered as a wagtail.wagtailsnippets create an html file to render the template inside a RichText field.* Templates names will match snippets models names replacing capital letters with underscores, Wagtail style.For the ```SocialMediaLink``` snippet in the ```core``` app, it will look for the following template ```core/templates/snippets/socialmedialink.html```.* The variable containing the snippet instance in the template is ```snippet```.If no template is defined then an exception will be raised in the frontend when rendering a RichTextField with the embedded snippet in it. Make sure you write some templates for your snippets before start to embedding them.# OptionsIf the snippet meta has a description field, it will show up next to the snippet name in the admin interface.```pythonfrom django.db import modelsimport django.db.models.options as optionsoptions.DEFAULT_NAMES = options.DEFAULT_NAMES + ('description',)@register_snippetclass MySnippet(models.Model):# fields definitionclass Meta:description = "My Snippet Description"```## Development### Releases- Make a new branch for the release of the new version.- Update the [CHANGELOG](https://github.com/springload/wagtailembedder/CHANGELOG.md).- Update the version number in `setup.py`, following semver.- Make a PR and squash merge it.- Back on master with the PR merged, use `make publish` (confirm, and enter your password).- Finally, go to GitHub and create a release and a tag for the new version.- Done!
Package: wagtailembedpeertube
wagtailembedpeertubeEmbed PeerTube videos into Wagtail.IntroductionWagtail has a greatsupport of oEmbedfor embedding content. Unfortunately,
the oEmbed mechanism is based on services domain names and URI; and this is prone
to centralization since it limits to a short list of selected providers.By the way, there is already hundreds instances and it will probably grow with
years - seePeerTube instances.This app brings oEmbed support for decentralized PeerTube instances. To do this,
it only focuses on a string URI filtering, allowing all services from any domain
name.InstallationInstall usingpip:pipinstallwagtailembedpeertubeAddwagtailembedpeertubeto yourINSTALLED_APPSsetting somewhere
afterwagtail.embeds:INSTALLED_APPS=[..."wagtail.embeds",..."wagtailembedpeertube",...]Configure embed finders inWAGTAILEMBEDS_FINDERSsetting to add PeerTube's
one at the end, i.e.:WAGTAILEMBEDS_FINDERS=[{"class":"wagtail.embeds.finders.oembed",},{"class":"wagtailembedpeertube.finders",},]Since the first matching finder will be used,wagtailembedpeertubeshould
be declared as last because others finders are matching domain names and may
be more precise. SeeConfiguring embed “finders”for more details.UsageThat's it! You should now be able to embed any PeerTube content using theEmbedBlock:fromwagtail.embeds.blocksimportEmbedBlockclassMyStreamField(blocks.StreamBlock):...embed=EmbedBlock()DevelopmentTo setup a development environment, clone this repository and follow the
installation steps but replace the installation from PyPi by:pipinstall-e.[test]The Python code is formatted and linted thanks to flake8, isort and black. To
ease the use of this tools, the following commands are available:make lint: check the Python code syntax and imports ordermake format: fix the Python code syntax and imports orderLicenseThis extension is mainly developed byCliss XXIand
licensed under theAGPLv3+. Any contribution is welcome!