Saravanan666/pypi-org huggingface dataset:
Package: wagtail-streamfield-index
wagtail-streamfield-indexIndexing of streamfield data in WagtailInstallationInstall the packagepipinstallwagtail-streamfield-indexAdd to your installed appsINSTALLED_APPS=[..."streamfieldindex",...]Runpython manage.py streamfieldindexto index all pages.After indexing, your database will contain oneIndexEntryfor every block found in a page model.The index will keep itself up-to-date every time a page is saved.ModelAdminIf you would like to see a list of indexed blocks in your wagtail admin interface, you can register themodeladminMake sure modeladmin app is installed:INSTALLED_APPS=[..."wagtail.contrib.modeladmin",...]Register theIndexEntryAdminin a wagtail_hooks.py file:fromwagtail.contrib.modeladmin.optionsimportmodeladmin_registerfromstreamfieldindex.modeladminimportIndexEntryAdminmodeladmin_register(IndexEntryAdmin)IndexEntry modelfrom streamfieldindex.models import IndexEntryFieldsblock_nameThe name that you gave to your block in the streamfield definition.
e.g "author" or "heading" in the following example:my_field=StreamField([('author',AuthorBlock()),('heading',CharBlock()),])For items inside list blocks, theblock_nameis set to the list block name with ":item" appended, since individual items inside a list block do not have a name.block_valueThe string value of the block, in the form that it is stored in the streamfield.StructBlock,StreamBlockandListBlocks have an empty string as the block_value since you can inspect the contents of those blocks by looking at their sub-blocks.
If you have a complex block type such as an ImageChooser block, see theget_bound_block()methodblock_pathA slash-delimited path to the location of the block within the streamfield.
E.g. if block_path =5/author/title5. The 6th block in the streamfield.author. The 6th block is namedauthor.title. Thetitlesub-block ofauthor.field_nameThe name of the field where the block was found.pageThe page where the block was found.Methodsget_bound_block()Returns a WagtailBoundBlockinstance of the block. See theWagtail docsfor explaination ofBoundBlocks.Example usageIf you had anauthorblock and wanted to find all usage of that block:fromstreamfieldindex.modelsimportIndexEntryforindex_entryinIndexEntry.objects.filter(block_name="author"):print(index_entry.page.id)# Print the page ID where the block is foundprint(index_entry.field_name)# Print the field where the block is foundprint(index_entry.block_path)# Print a slash-separated path to the block inside the fieldContributingGetting startedClone the repogit clone https://github.com/nhsuk/wagtail-streamfield-index.gitInstall dependenciespip install .[testing,linting]Formattingblack .Lintingflake8 .Testspytest
Package: wagtail-streamfield-migrate
wagtail-streamfield-utilsAPIiteratorsflatten_streamfield(streamvalue)Returns a generator, yielding (block, path) tuple to each block in a streamfield.fromstreamfieldutils.iteratorsimportflatten_streamfieldpage=MyPage.objects.first()# Print a slash-separated path to each block followed by the block's value.forblock,pathinflatten_streamfield(page.body):print("/".join(path),block.value)ContributingGetting startedClone the repogit clone https://github.com/mikemonteith/wagtail-streamfield-utils.gitInstall dependenciespip install -e .[testing]Formattingblack .Lintingflake8 .Testspytest
Package: wagtail-streamfield-migration-toolkit
This package aims to make it easier for developers using StreamField who need to write data
migrations when making changes involving blocks/block structure in the StreamField. We expose a
custom migration operation class (MigrateStreamData) for migrations, which recurses through
a streamfield to apply chosen sub-operations to all blocks matching a specific type. With it we also
supply a set of sub-operations to perform the most common changes, while also allowing you to
write your own when needed.For more details, seehttps://github.com/sandilsranasinghe/wagtail-streamfield-migration-toolkit
Package: wagtail-streamfieldtools
A suite of tools that extendsWagtail’s already-awesomeStreamFieldto make it even more flexible/versatile/useful!Includes:A simple interface for displaying the individual blocks of aStreamFieldin any number of renditions.A ‘block registry’ (and its associated field,RegisteredBlockStreamField) that makes blocks pluggable/re-usable across disparate models/apps/projects.CompatibilityPython:2.73.43.5Wagtail:1.21.31.4NoteIf you want to use Python 3.3 or Wagtail 1.1 install the 0.2 release.InstallationFirst, install with:$pipinstallwagtail-streamfieldtoolsAfter installation completes, add'streamfield_tools'toINSTALLED_APPS:INSTALLED_APPS=(# All your other apps here'streamfield_tools',)Running TestsTo run tests, first create a new virtual environment and install the test requirements:$virtualenvTEST_ENV$pipinstall-rtest_requirements.txtThen run the test suite with this command:$coveragerun--sourcestreamfield_tools/runtests.pyIf all tests pass, then push your code to Github where Travis CI will tests against the entire dependency matrix. If [all tests passed there](https://travis-ci.org/WGBH/wagtail-streamfieldtools), then [head over to Coveralls](https://coveralls.io/github/WGBH/wagtail-streamfieldtools) to ensure your coverage has remained the same.If the tests passed and coverage remained the same then it’s time to release to PyPI!
Package: wagtailstreamforms
Allows you to build forms in the CMS admin area and add them to any StreamField in your site.
You can add your own fields along with the vast array of default fields which include the likes
of file fields. Form submissions are controlled by hooks that you can add that process the forms cleaned data.
Templates can be created which will then appear as choices when you build your form,
allowing you to display and submit a form however you want.Backwards CompatibilityPlease note that due to this package being virtually re-written for version 3, you cannot upgrade any existing
older version of this package to version 3 and onwards.
If you have an existing version installed less than 3 then you will need to completely remove it including
tables and any migrations that were applied in the databasesdjango_migrationstable.Older versions:If you are using a version of wagtail 1.x, then the latest compatible version of this package is 1.6.3:$pipinstallwagtailstreamforms<2Other wise you must install a version of this package from 2 onwards:$pipinstallwagtailstreamforms>=2What else is included?Each form is built using a StreamField.Customise things like success and error messages, post submit redirects and more.Forms are processed via abefore_page_servehook. Meaning there is no fuss like remembering to include a page mixin.The hook can easily be disabled to provide the ability to create your own.Form submissions are controlled via hooks meaning you can easily create things like emailing the submission which you can turn on and off on each form.Fields can easily be added to the form from your own code such as Recaptcha or a Regex Field.The default set of fields can easily be replaced to add things like widget attributes.You can define a model that will allow you to save additional settings for each form.Form submissions are also listed by their form which you can filter by date and are ordered by newest first.Files can also be submitted to the forms that are shown with the form submissions.A form and its fields can easily be copied to a new form.There is a template tag that can be used to render a form, in case you want it to appear outside a StreamField.DocumentationCan be found onreadthedocs.ScreenshotsExample Front EndForm Fields SelectionExample site with dockerClone the repo$gitclonehttps://github.com/labd/wagtailstreamforms.gitRun the docker container$cdwagtailstreamforms$docker-composeupCreate yourself a superuser$docker-composeexecappbash$pythonmanage.pycreatesuperuserGo tohttp://127.0.0.1:8000
Package: wagtailsvg
Wagtail+SVG= 🚀SVGforWagtailwith :Svg: ModelSvgChooserPanel: ChooserPanel for ForeignKeySvgChooserBlock: ChooserBlock for StreamFieldCan be used like this :fromwagtailsvg.modelsimportSvgfromwagtailsvg.blocksimportSvgChooserBlockfromwagtailsvg.edit_handlersimportSvgChooserPanelclassTestPage(Page):logo=models.ForeignKey(Svg,related_name='+',null=True,blank=True,on_delete=models.SET_NULL)body=StreamField([('svg',SvgChooserBlock()),],blank=True)content_panels=Page.content_panels+[SvgChooserPanel('logo'),StreamFieldPanel('body'),]SetupInstall with pip :pip install wagtailsvgAdd these to django apps installed :INSTALLED_APPS=['wagtailsvg','wagtail.contrib.modeladmin','generic_chooser',...]Set the SVG download folder in the Django settingsWAGTAILSVG_UPLOAD_FOLDER='svg'Default value is ‘media’Development envIf first rungit clone git@github.com:Aleksi44/wagtailsvg.git
pip install -r requirements.txt
python manage.py migrate
python manage.py initRun Django Serverpython manage.py runserver 0.0.0.0:4243Run Webpack Serveryarn
yarn startSnoweb SVGTo integrate SVG icons on Wagtail, I created Snoweb SVG with +2000 optimized SVG.
Check theSVG library.Feel free to contact me athello@snoweb.io.Made with ❤ bySnoweb.
Package: wagtail-svg-icons
Wagtail IconsWagtail Icons is package that allows you to add icons (in svg format) on your page, divide them on groups, resize and style displayed icons.Installpip install wagtail-svg-iconsThen addwagtail_iconsandgeneric_chooserto your installed apps:INSTALLED_APPS = [
    ...
    'wagtail_icons',
	'generic_chooser',
	...
]UsageIconsField, IconsChooserPanel and IconsChooserBlockIconsField- Subclass ofForeignKeyField with many-to-one relationship with Icon model. Have all arguments ofForeignKeywith defaults:on_delete=models.SET_NULLnull=Trueblank=TrueIconsChooserPanel- Subclass ofFieldPanelExtra (optional) argument:group - slug of the group from which icons can be choosen. If not specified all available icons will be displayed.IconsChooserBlock- Subclass ofChooserBlockExtra (optional) argument:group - slug of the group from which icons can be choosen. If not specified all available icons will be displayed.fromwagtail_icons.edit_handlersimportIconsChooserPanelfromwagtail_icons.fieldsimportIconsFieldfromwagtail_icons.blocksimportIconsChooserBlockfromwagtail.admin.edit_handlersimportStreamFieldPaneltry:fromwagtail.fieldsimportStreamFieldfromwagtail.modelsimportPagefromwagtailimportblocksexceptImportError:# wagtail version under 3.0fromwagtail.core.fieldsimportStreamFieldfromwagtail.coreimportblocksfromwagtail.core.modelsimportPageclassHomePage(Page):icon=IconsField()body=StreamField([('block_icon',IconsChooserBlock(group='some_group',required=False)),],blank=True)content_panels=Page.content_panels+[IconsChooserPanel('icon',group='another_group'),StreamFieldPanel('body'),]How to use Icons in templatesThe 'icon' tag inserts svg element into page, setting its size and custom_class (if specified). To use 'icon' tag load 'wagtail_icons_tags'{% load wagtail_icons_tags %}Icon tag required arguments:icon - instance of Icon modelIcon tag optional arguments:size - icon resize given in format "HEIGHTxWIDTH"class_name - icon class name that can be used to css stylingcolor - custom icon colorExample usage<!-- Display original size icon -->
{% icon self.icon %}

<!-- Display icon scaled to width 200 and height 250 -->
{% icon self.icon size='250x200' class_name='filter-green' %}

<!-- Display icon scaled to width 200 and height 200 and with class 'my-icon'-->
{% icon self.icon size='200x200' class_name='my-icon' %}

<!-- Display icon scaled to width 200 and height 200 and in color #81b29a-->
{% icon self.icon size='200x200' class_name='my-icon'  color='#81b29a' %}
Package: wagtailsweetcaptcha
Wagtail SweetCaptcha================**Wagtail forms SweetCaptcha form field/widget integration app.**wagtailsweetcaptcha provides a an easy wayto integrate the `django-sweetcaptcha <https://pypi.python.org/pypi/sweetcaptcha/>`_ field when using the Wagtail formbuilder.Installation------------#. Install or add ``wagtailsweetcaptcha`` to your Python path.#. Add ``wagtailsweetcaptcha`` to your ``INSTALLED_APPS`` setting.#. Config django-sweetcaptcha as explained in `here <https://github.com/jordij/django-sweetcaptcha>`_.Usage-----Field~~~~~The quickest way to add a sweetcaptcha field to a Wagtail Form Page is to inherit from the two options provided, ``SweetCaptchaForm`` or ``SweetCaptchaEmailForm``. The first options inherits from ``AbstractForm`` while the seconds does it from ``AbstractEmailForm``. Either way your page is going to display a sweetcaptcha field at the end of the form.Example.. code-block:: pythonfrom wagtail.wagtailforms.models import AbstractFormFieldfrom wagtail.wagtailadmin.edit_handlers import FieldPanel, InlinePanel, MultiFieldPanelfrom wagtail.wagtailcore.fields import RichTextFieldfrom modelcluster.fields import ParentalKeyfrom wagtailsweetcaptcha.models import SweetCaptchaEmailFormclass SubmitFormField(AbstractFormField):page = ParentalKey('SubmitFormPage', related_name='form_fields')class SubmitFormPage(SweetCaptchaEmailForm):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.')class Meta:verbose_name = "Form submission page"description = "Page with the form to submit"SubmitFormPage.content_panels = [FieldPanel('title', classname="full title"),FieldPanel('body', classname="full"),FieldPanel('thank_you_text', classname="full"),InlinePanel(SubmitFormPage, 'form_fields', label="Form fields"),MultiFieldPanel([FieldPanel('to_address'),FieldPanel('from_address'),FieldPanel('subject'),], "Email notification")]The sweetcaptcha field can't be added from the admin UI but will appear in your frontend.
Package: wagtail-switch-block
wagtail-switch-blockA Wagtail struct block with a selector to pick one of the fields. Please bear with us while we prepare more detailed documentation.Compatibilitywagtail-switch-block' major.minor version number indicates the Wagtail release it is compatible with. Currently this is Wagtail 4.1.xInstallationInstall usingpip:pipinstallwagtail-switch-blockAddwagtail_switch_blockto yourINSTALLED_APPSsetting:INSTALLED_APPS=[# ...'wagtail_switch_block'# ...]
Package: wagtail-synopsis
wagtail-synopsisA Wagtail app for a reusable synopsis model. Please bear with us while we prepare more detailed documentation.Compatibilitywagtail-synopsis' major.minor version number indicates the Wagtail release it is compatible with. Currently this is Wagtail 4.1.xInstallationInstall usingpip:pipinstallwagtail-synopsisAddwagtail_synopsisto yourINSTALLED_APPSsetting:INSTALLED_APPS=[# ...'wagtail_synopsis'# ...]
Package: wagtail-table-block
Don’t use this if you can help it. Wagtail 1.5 features [this exact code](https://github.com/torchbox/wagtail/pull/1705) merged into Wagtail’s core. This exists only as an intermittent solution before Wagtail 1.5 is released, and perhaps as a way to quickly include the table block in a project with Wagtail < 1.5.Since the code is identical to the code in core, the database representation and is the same. Therefore you can remove this plugin and simply change your imports once you upgrade to Wagtail 1.5.Install withpip install wagtail-table-blockThen addwagtail_table_blockto yourINSTALLED_APPS.Then usefrom wagtail_table_block.fields import TableBlockand implement it liketable = TableBlock().
Package: wagtailtables
Wagtail Tablesjspreadsheet tables in Wagtail, edited and customised from the Wagtail adminGetting startedAssuming you have a Wagtail project up and running:pip install wagtailtablesAddwagtailtablesto your settings.py in the INSTALLED_APPS section, before the core wagtail packages:INSTALLED_APPS=[# ...'wagtailtables',# ...]Add a wagtailtables TableBlock to one of your StreamFields:fromwagtailtables.blocksimportTableBlockclassContentBlocks(StreamBlock):table_block=TableBlock()Include your streamblock in one of your pagesclassHomePage(Page):body=StreamField(ContentBlocks())content_panels=Page.content_panels+[StreamFieldPanel('body'),]Simply render your table block as you would render any other block.{%loadwagtailcore_tags%}{%blockcontent%}<div class="container-fluid"><div class="row"><div class="col-6"><h1>{{self.title}}</h1><div class="excerpt">{{self.excerpt|richtext}}</div></div></div>{%forblockinself.body%}{%include_blockblock%}{%endfor%}</div>{%endblock%}ConfigurationCustomized toolbarTableBlockaccepts a toolbar argument in addition to the standardStructBlockarguments.The toolbar is an array of dicts, this is the default:TOOLBAR=[{'type':'i','content':'format_align_left','k':'text-align','v':'left'},{'type':'i','content':'format_align_center','k':'text-align','v':'center'},{'type':'i','content':'format_align_right','k':'text-align','v':'right'},{'type':'i','content':'format_bold','k':'font-weight','v':'600'},{'type':'i','content':'format_italic','k':'font-style','v':'italic'},{'type':'i','content':'border_left','k':'border-left','v':'1px solid'},{'type':'i','content':'border_right','k':'border-right','v':'1px solid'},{'type':'i','content':'border_top','k':'border-top','v':'1px solid'},]classContentBlocks(StreamBlock):table_block=TableBlock(toolbar=TOOLBAR)typeshould for now always beifor icon, we will provide more types latercontentdefines the icon (from material icons)click here for all possible keyskmeans the style that should be apply to the cellvmeans the value of the style should be apply to the cellDependenciesThis project relies onJspreadsheet Community Editionfor data entry and manipulation.
Package: wagtail-taggable
Wagtail TaggableSimple tag functionality for Wagtail sites wanting curated tags without the complexity.Change Logv0.0.10:Updated InlinePanel invocation to match requirements for Wagtail 4.2 and therefore pin Wagtail 4.2 as the minimum supported version.Installation & SetupInstall with pippip install wagtail-taggable

or

poetry add wagtail-taggableAdd to Django installed appsINSTALLED_APPS = [
    #...
    'wagtail_taggable',
]Setup your tag modelsUsing theregister_tagdecorator automatically sets up anyForeignKeyreferences to the decorated model to render using a chooser widget specifically for your tag model. It takes care of registering all the form widgets and urls needed to get this interface working.@register_tag('Example')
class ExampleTag(BaseTag):

    class Meta:
        verbose_name = _('Example')Optionally expose Tag models using Model Adminfrom django.apps import apps
from wagtail.contrib.modeladmin.options import ModelAdmin, ModelAdminGroup

class ExampleTagModelAdmin(ModelAdmin):

    @property
    def model(self):
        return apps.get_model('app.ExampleTag')

    menu_label = 'Example'
    menu_icon = 'tasks'
    menu_order = 100
    list_display = ('name',)


class TagsModelAdminGroup(ModelAdminGroup):

    menu_label = 'Tags'
    menu_icon = 'tag'
    menu_order = 502
    items = [
        ExampleTagModelAdmin,
    ]

from app.admin.tags import TagsModelAdminGroup

modeladmin_register(TagsModelAdminGroup)Use tags on page models (or any other model)Define through relationship:class ExamplePageExampleTagRelationship(models.Model):

     page = ParentalKey(
         'app.ExamplePage',
         on_delete=models.CASCADE,
         related_name='example_tag_relationships',
         related_query_name='example_tag_relationship',
     )

     example_tag = models.ForeignKey(
         'app.ExampleTag',
         on_delete=models.CASCADE,
         related_name='example_page_relationships',
         related_query_name='example_page_relationship',
     )Use TagsPanel to render the tags interface in the CMS for the taggable model (in this case a wagtail.Page)class ExamplePage(Page):

     ...

     content_panels = [
         TagsPanel('example_tag_relationships', heading='Example Tags'),
     ]Query items based on tagsPerform queries based on tags like you would with any other related tabletagged_items = (
    ExamplePage.objects
    .filter(example_tag_relationship__example_tag__name='My Cool Tag')
)
Package: wagtail-tags-block
wagtail-tags-blockA Wagtail block for storing tags. Please bear with us while we prepare more detailed documentation.Compatibilitywagtail-tags-block' major.minor version number indicates the Wagtail release it is compatible with. Currently this is Wagtail 4.1.xInstallationInstall usingpip:pipinstallwagtail-tags-blockAddwagtail_tags_blockto yourINSTALLED_APPSsetting:INSTALLED_APPS=[# ...'wagtail_tags_block'# ...]
Package: wagtailtextanalysis
[![Build Status](https://travis-ci.org/marteinn/wagtail-text-analysis.svg?branch=develop)](https://travis-ci.org/marteinn/wagtail-text-analysis)# Wagtail Text AnalysisDetect key phrases from your Wagtail content using powerful ML Apis.## FeaturesKey phrase generation using Azure Text AnalyticsText sentiment using Azure Text Analytics## Supported providers[Azure Text Analytics](#azure-text-analytics)## RequirementsPython 3.6+Wagtail 2+Access to any of the [supported providers](#providers)## Providers### Azure Text AnalyticsAzure’s Text Analytics Api. [Docs](https://azure.microsoft.com/en-us/services/cognitive-services/text-analytics/)#### SettingsAZURE_TEXT_ANALYTICS_API_KEY: Azure Computer Vision API keyAZURE_TEXT_ANALYTICS_REGION: The default region to use, e.g. westus, northeurope, etc## Where to go from here?We recommend you to check out our [Getting Started Guide](https://github.com/marteinn/wagtail-text-analysis/blob/develop/docs/getting-started.md).## ContributingWant to contribute? Awesome. Just send a pull request.## LicenseWagtail Text Analysis is released under the [MIT License](http://www.opensource.org/licenses/MIT).
Package: wagtailtrans
Wagtail multilanguage moduleSupport multiple languages for your Wagtail site.RequirementsPython 3.5+Django 2+Wagtail 2.7+Getting startedFollow ourGetting Startedguide to start integrating Wagtailtrans.DocumentationThe complete project documentation can be found onRead the DocsWho’s using it?If you want to see some examples on how Wagtailtrans is running in a production environment you can take a look at the following websites:Hendrix GeneticsWiskerke Onions
Package: wagtailtranslations
A plugin for Wagtail that provides page translations.
By extending your pages with the models included in this package users will be redirected to pages in (or closest to) their language.InstallingInstall using pip:$pipinstallwagtailtranslationsAdd it to yourINSTALLED_APPS:INSTALLED_APPS=[# ...'wagtailtranslations',# ...]It works with Wagtail 2.2 and upwards.
Check versions before 2.0 for compatability with older versions of wagtail.Quick startDefine aTranslationIndexmodel:fromwagtailtranslations.modelsimportAbstractTranslationIndexPageclassTranslationHomePage(AbstractTranslationIndexPage):subpage_types=['ContentPage']Use this as your site root page.
Each language your site supports should exist
as a separate page tree underneath this index page.
The English home page should have a slug “en”, for a URL of/en/;
while the French home page should have a slug “fr”, for a URL of/fr/.Define a translated model:fromwagtail.admin.edit_handlersimportFieldPanelfromwagtail.core.fieldsimportRichTextFieldfromwagtail.core.modelsimportPagefromwagtailtranslations.modelsimportTranslatedPageclassContentPage(TranslatedPage,Page):body=RichTextField()content_panels=Page.content_panels+[FieldPanel('body'),]Enable some languages in the Wagtail admin → Settings → Languages,
for example English and French.Create a newContentPagefor English.
On the ‘Translations’ tab, select English for the language,
and leave the ‘Translation of …’ field blank.Create another newContentPagefor French.
On the ‘Translations’ tab, select French for the language,
and select the English page you just created in the ‘Translation of …’ field.TestingTo start a test server, run:$python3-mvenvvenv$sourcevenv/bin/activate$pipinstall-e.$exportDJANGO_SETTINGS_MODULE=tests.settings$django-adminmigrate$django-admincreatesuperuser$django-adminrunserverTo run the automated test suite:# Do not run this from within a virtual environment$pipinstall--user--upgradetoxpipsetuptools$tox