Saravanan666/pypi-org huggingface dataset:
Package: wte
Web to ebookWTE (web-to-ebook) helps you to convert content from some websites into an ebook (epub format) that you can read offline or on an ebook reader. It currently supports downloading any story from wattpad.Installpython3-mpipinstall--upgradewteManuallyYou can also installwtemanually, but is it not recomended. Clone the repository and intall or upgrade the dependencies. Start the programme using the__main__.pyfile :gitclonehttps://github.com/webalorn/web-to-ebook
python3-mpipinstall--upgraderequestslxmlpyqueryebooklibcdweb-to-ebook
python3.# Starts __main__.py. Use this instead of 'wte'Usagewte[url_of_the_page]# Simple usagewte[url_of_the_page]--quiet-o[output.epub]# More optionswte-h# Show the help and all the optionsCurrently supportedWattpad: Converts a whole book
Package: wtee
The wtee tool does two things:Duplicates standard input to standard output.Starts a local http server on which the piped data can be viewed.In other words, much like the unixteeutility,wteeduplicates
standard input to standard output, while also making the piped data
viewable on a web page. For example:tail -f /var/log/debug | wtee | nlDocumentation:http://wtee.readthedocs.io/en/latest/Development:https://github.com/gvalkov/wteePackage:http://pypi.python.org/pypi/wteeChangelog:http://wtee.readthedocs.io/en/latest/changelog.html
Package: wtf
WTFis a Python post-mortem debug handler.After an exception, a Pdb debugger will be started in the frame and line where
the exception was raised. TheIPythondebugger
will be used by default if available, Otherwise Python’s ownpdb.Pdb.See the accompanyingLICENSEfile for the licensing terms.UsageIfwithstatement block support is available (default since 2.6), thenWTFcan be used as:from wtf import WTF

with WTF:
    ... do something ...If an exception is raised inside thewithblock, then a Pdb debugger will be
started on the conflicting line.WTFcan be used as a function call also, with the same results.:from wtf import WTF

try:
    ... do something ...
except:
    WTF()For more info, check thewtf.WTFHandlerclass.
Package: wtfml
WTFML: Well That's Fantastic Machine Learningpronounced as: w-t-f-m-lWTFML is WIP.Origin of the name:abhishek  11:21 AM
i cant think of any good names
wtf

friend1:  11:22 AM
WTF is a good name
:joy:

abhishek  11:22 AM
well, it is actually! 
wtfml

friend2  11:23 AM
:rolling_on_the_floor_laughing:

abhishek  11:23 AM
very nice!
ill use it

abhishek  11:24 AM
WTFML: Well That’s Fantastic Machine Learning library
Package: wtforglib
wtforglibA set of utility functions I use in my various python projects.FeaturesFully typed with annotations and checked with mypy,PEP561 compatibleAdd yours!InstallationpipinstallwtforglibDocumentationStableLatestLicenseMITCreditsThis project was generated withwemake-python-package. Current template version is:5fe13ee2646d5cf38736bacfa8f9dbbfac092efb. See what isupdatedsince then.
Package: wtform-address
Wtform address fields: CountrySelectField and StateSelectFieldFields that are helpful when dealing with physical addresses such as a
CountrySelectField and a StateSelectField.Installpipinstallwtform_addressUsagefromwtformsimportFormfromwtform_addressimportCountrySelectField,StateSelectFieldclassMyForm(Form):country=CountrySelectField(default="US")state=StateSelectField(default="US-CA")CreditsCredits to@mekzafor his initialgist.License
Package: wtforms-aceditor
Aceditor wtforms controlAceditor wtforms controlhttps://ace.c9.io/Use with flask-adminfromwtforms_aceditorimportAceEditorclassExampleView(ModelView):form_widget_args={'config_yaml':{'style':'width:100%; height: 200px;'}}form_args={'config_yaml':{'widget':AceEditor('yaml',minLines=4,tabSize=4),'validators':[YamlValidator()]}}Use with flask-formsfromwtforms_aceditorimportAceEditorclassSampleForm(FlaskForm):code=TextAreaField('config_yaml',widget=AceEditor('yaml'))Run exampleFLASK_APP=example1.appflaskrun
Package: wtforms_extras
IntroductionThis package aims to bring some improvements to make working with wtforms easier.This package currently allows you to render entire forms.Support for rendering wtform widgets with bootstrap and foundation are currently supported.Example:class MyForm(Form):
    # special property we use to specify order fields should
    # be shown
    _order = ['age']
    age = IntegerField(u'Age')

form = MyForm(req.POST)
from wtforms_extras import render_form
render_form(form, style='bootstrap')

# or just a field
from wtforms_extras import render_field
render_field(form, 'age', style='bootstrap')Changelog1.1.3 - 2014-11-25remove error star on default field1.1.2 - 2014-11-25spurious pdb1.1.1 - 2014-11-24omit fieldset properly1.1.0 - 2014-11-24be able to use fieldsetsfix to always allow html rendering1.0.1 - 2014-11-13doc fix1.0 - 2014-11-13initial release
Package: wtforms-field-factory
wtforms field factoryCreate fields on-the-fly at form construction time.Why?In order to e.g. translate field labels depending on the request without relying on global state.
Additionally, you can conditionally exclude fields. This avoids dodgy workarounds needed when e.g.
having a form field that is not relevant or feasible to pass during unit testing.How?Let's look at a use case where a field label must change depending on the locale(s) of the request:fromgettextimporttranslationfromtypingimportListfromwtforms_field_factoryimportfield,Form,DefaultMetafromwtformsimportStringFieldclassMyMeta(DefaultMeta):def__init__(self,ordered_locales:List[str]):self.ordered_locales=ordered_locales@propertydeflocales(self):# translate messages within wtforms depending on the request's locale(s)returnself.ordered_localesclassMyBaseForm(Form):def__init__(self,ordered_locales:List[str],**kwargs):self.ordered_locales=ordered_localessuper().__init__(meta=MyMeta(ordered_locales),**kwargs)@field(name="name")defname_field(self):_=translation("default",languages=self.ordered_locales)returnStringField(label=_("Name"))The example above will not only translate the name field's label but also internal wtforms messages
such as field errors.In cases where an external function is responsible for creating the field (useful for reusing field
factories) or if you want to precompute certain objects (e.g. the GNUTranslations object), the
following can be done:@field(name="name")defname_field(_cls,_):# since the associated attribute is bound, we need the class type as first argreturnStringField(label=_("Name"))classMyBaseForm(Form):some_class_attribute=name_field# to make Form actually discover this factorydef__init__(self,ordered_locales:List[str],**kwargs):self.set_factory_args(translation("default",languages=self.ordered_locales))super().__init__(meta=MyMeta(ordered_locales),**kwargs)Just use whatever method you find best. There is not "one" correct way of achieving your goal here.
The important part is that you now have an explicit contract and do not rely on global state.ContributingBefore committing, run the following and check if it succeeds:pipinstall--user-rrequirements-dev.txt&&\blackwtforms_field_factory.py&&\pylintwtforms_field_factory.py&&\pytest&&\coveragereport--fail-under=100
Package: wtforms-hcaptcha
WTForms hCaptchaCustom WTForms field that handleshCaptchadisplay and validation.hCaptchais a CAPTCHA service that 'protects user privacy, rewards websites, and helps companies get their data labelled'. This helps to prevent spam on websites by adding a challenge to forms that are hard for computers to solve, but easy for humans to solve.I wanted to use hCaptcha in one of my projects and although there are already Python libraries for working with hCaptcha, I had already used the WTForms ecosystem in that project so I wanted a drop in solution and as there were none at the time, I decided to create my own.This is a modified version ofwtforms-recaptchabyArtem Gluvchynskyto work with hCaptcha.InstallationUsepipto install on all systems:pipinstallwtforms-hcaptchaUsage ExampleThis example creates an empty form with just a CAPTCHA field.fromwtforms.formimportFormfromwtforms_hcaptchaimportHcaptchaFieldclassMyForm(Form):captcha=HcaptchaField(site_key="YOUR_SITE_KEY_HERE",secret_key="YOUR_SECRET_KEY_HERE")form=MyForm(request.form,captcha={# note this needs to be edited to get the correct IP address when using a reverse proxy"ip_address":request.remote_addr})ifform.validate():print("You are not a robot!")else:print(form.errors["captcha"])Development SetupThis project uses Poetry to manage dependencies and packaging.Hereare the installation instructions for Poetry.ContributingFork it (https://github.com/jake-walker/wtforms-hcaptcha/fork)Create your feature branch (git checkout -b feature/foobar)Commit your changes (git commit -am "Add some foobar")Push to the branch (git push origin feature/foobar)Create a new pull request
Package: wtforms-jsonschema
Introductionwtforms-jsonschema converts WTForms into JSON Schema compatibile representationsRequirementsPython 2.6 or laterWtformsUsageTo convert a form to a JSON Schema:from wtforms_jsonschema.jsonschema import WTFormToJSONSchema

schema_repr = WTFormToJSONSchema().convert_form(MyForm)TODO: To embed a JSON Schema as a form field:from wtforms_jsonschema.forms import JSONSchemaField

#where schema is a python dictionay like schema_repr in the first exmaple

class MyForm(forms.Form):
    subfield = JSONSchemaField(schema=schema)

form = MyForm(data={'subfield':'<json encoded value>'})
form.validate() #will validate the subfield entry against schema
form['subfield'].as_widget() #will render a textarea widget with a data-schemajson attribute
Package: wtforms-piccolo
Server-side form generation utilities for Piccolo ORM Table class.
Based on the code found inwtforms.extand provides a bridge between Piccolo ORM tables and WTForms.Installationpipinstallwtforms-piccoloUsageExample usage:# table.pyfrompiccolo.apps.user.tablesimportBaseUserfrompiccolo.columnsimportBoolean,ForeignKey,Integer,Text,Varcharfrompiccolo.tableimportTableclassTask(Table):"""An example table."""name=Varchar(required=True,null=False)description=Text(required=True,null=False)views=Integer(required=True,null=False,default=0)completed=Boolean(default=False)task_user=ForeignKey(references=BaseUser)Generate a form based on the table.TaskForm=table_form(Task)Generate a form based on the table, excluding 'id' and 'views'.TaskForm=table_form(Task,exclude=['id','views'])Generate a form based on the table, only including 'name' and 'description'.TaskForm=table_form(Task,only=['name','description'])The form can be generated setting field arguments:TaskForm=table_form(Task,only=['name','description'],field_args={'name':{'label':'Your new label',},'description':{'label':'Your new label',}})Example implementation for an edit view using Starlette web app:# app.py# other importsfromwtforms_piccolo.ormimporttable_form@app.route("/{id:int}/",methods=["GET","POST"])asyncdefedit(request):path_id=request.path_params["id"]item=awaitTask.objects().get(Task.id==path_id).run()users=awaitBaseUser.select().run()data=awaitrequest.form()TaskForm=table_form(Task,exclude=["id"])form=TaskForm(obj=item,formdata=data)# FK select fieldform.task_user.choices=[(i["id"],i["username"])foriinusers]ifrequest.method=="POST"andform.validate():form.populate_obj(item)awaititem.save().run()returnRedirectResponse(url="/",status_code=302)returntemplates.TemplateResponse("edit.html",{"request":request,"form":form,"table_name":Task._meta.tablename,},)Example template for above view using Jinja and Bootstrap:{% extends "base.html" %}
{% block content %}<mainrole="main"><br><br><divclass="container"><h2>Edit Task</h2><br><formmethod="POST">{% for field in form %}<divclass="form-group">{{ field.label }}:
                {{ field(class="form-control") }}
                {% for error in field.errors %}<spanstyle="color: red;">*{{ error }}</span>{% endfor %}</div>{% endfor %}<p><inputclass="btn btn-primary"type="submit"value="Submit"></p></form></div><!-- /container --><hr></main>{% endblock %}The full example of the Starlette web application is in example folder.
Package: wtforms-polyglot
WTForms-PolyglotWTForms companion library to providepolyglot HTML(i.e., XML-compatible)
output.Polyglot markup is a set of rules for how to write HTML.  A document that uses
polyglot markup is both a valid HTML5 document as well as a well-formed XML
document, that can be served with either atext/htmlor anapplication/xhtml+xmlMIME type.This package provides thePolyglotFormclass, which is built on top of
WTForms’ defaultForm.  When usingPolyglotForm, fields will be rendered
with polyglot markup.  For example, given the following form:from wtf_polyglot import PolyglotForm
from wtforms import BooleanField

class MyForm(PolyglotForm):
    foo = BooleanField("foo", default=True)RenderingMyForm.foowill result in the following XML-compliant output:<input checked="checked" id="foo" name="foo" type="checkbox" value="y" />In contrast, using WTForms’ defaultForm, the output would be:<input checked id="foo" name="foo" type="checkbox" value="y">In addition, this package provides a custom implementation of WTForms’SubmitField, which renders as a<button>instead of an<input>element.
For example:from wtf_polyglot import PolyglotForm, SubmitField

class MyForm(PolyglotForm):
    foo = SubmitField("Bar")Produces this output:<button id="foo" name="foo" type="submit" value="Bar">Bar</button>
Package: wtforms-recaptcha
OverviewWTForms-reCaptcha is a convenient field forWTFormsthat transparently handles
reCaptcha display and validation via corresponding widget and validator classes.reCaptchaTo get an idea about reCaptcha see thedocs.To start working with it, first get reCaptcha keyshere.InstallationGet the distribution:pip install wtforms-recaptchaor if you want the latest:pip install hg+http://bitbucket.org/excieve/wtforms-recaptcha#egg=wtforms-recaptchaor get hg clone of the source code:hg clone http://bitbucket.org/excieve/wtforms-recaptcha
cd wtforms-recaptcha
python setup.py installUsageIt is mostly the usual WTForms field that needs some extra data and parameters.
Here’s a simple example:from wtforms.form import Form
from wtfrecaptcha.fields import RecaptchaField


class CaptchaForm(Form):
    captcha = RecaptchaField(public_key=RECAPTCHA_PUB_KEY, private_key=RECAPTCHA_PRIV_KEY, secure=True)


form = CaptchaForm(request.POST, captcha={'ip_address': request.META['REMOTE_ADDR']})
if form.validate():
    print "Captcha response is correct"
else:
    print form.errors['captcha']Some description of field’s parameters:public_key:Public key generated by reCaptcha serviceprivate_key:Private key generated by reCaptcha servicesecure:True if it should be served via HTTPS, False otherwise. Default:False.http_proxy:URL of HTTP proxy for API callsWhen form with RecaptchaField is instantiated with bound fields, it must includecaptchakeyword parameter with dict that has ‘ip_address’ element.Other detailsAccessing field as a string will get the widget code with URLs that depend onsecureparameter passed to the field.HTTP errors and errors that are indepentent of user input are logged.
Others are handled as validation errors.LicenseWTForms-reCaptcha is released under BSD license.Copyright (c) 2010-2012 Artem Gluvchynsky <excieve@gmail.com> and contributors.See LICENSE for full licensing information.
Package: wtforms-tornado
WTForms extensions for Tornado.Usageimport tornado.ioloop
import tornado.web

from wtforms.fields import IntegerField
from wtforms.validators import Required
from wtforms_tornado import Form

class SumForm(Form):

    a = IntegerField(validators=[Required()])
    b = IntegerField(validators=[Required()])

class SumHandler(tornado.web.RequestHandler):
    def get(self):
        self.write("Hello, world")

    def post(self):
        form = SumForm(self.request.arguments)
        if form.validate():
            self.write(str(form.data['a'] + form.data['b']))
        else:
            self.set_status(400)
            self.write("" % form.errors)

application = tornado.web.Application([
    (r"/", SumHandler),
])

if __name__ == "__main__":
    application.listen(8888)
    tornado.ioloop.IOLoop.instance().start()InstallationYou can to usepipto install WTForms-Tornado:$ pip install wtforms-tornadoOr using last source:$ pip install git+git://github.com/puentesarrin/wtforms-tornado.gitOr manually, download the latest source fromPyPI:$ tar xvzf wtforms-tornado-$VERSION.tar.gz
$ cd wtforms-tornado-$VERSION
$ python setup.py build
$ sudo python setup.py install
Package: wtforms-validators
wtforms-validatorsAdditional validators for wtforms used in web applications frequently.Installationpip install wtforms-validatorsValidatorsAcceptedActiveUrlAlphaAlphaDashAlphaSpaceAlphaNumericNotEqualToIntegerIsJsonDisposableEmailExamples:from wtforms_validators import ActiveUrl, Alpha
...

class SignupForm(Form):
    login_id = StringField('login Id', [DataRequired(), Alpha()])
    url = StringField('profile url', [DataRequired(), ActiveUrl()])Accepted:Validates if the field is yes, on, 1, true orTrue. Can be used for validating terms of service, opt-ins etc.,Parameters:message - (optional) - Error message to raise in case of a validation error.ActiveUrl:Validates if the URL is active by checking A or AAAA DNS records.Parameters:message - (optional) - Error message to raise in case of a validation error.Alpha:Validates the field to include alphabetic characters only.Parameters:message - (optional) - Error message to raise in case of a validation error.AlphaDash:Validates the field to only include alphabets and dash(-).Parameters:message - (optional) - Error message to raise in case of a validation error.AlphaSpace:Validates the field to only include alphabets and spaces.Note:This validator does not strip the field's value, so input containing only spaces will still be valid. You will either have to register a filter to strip input data or add another validator to check if the field cannot contain only spaces.Parameters:message - (optional) - Error message to raise in case of a validation error.AlphaNumeric:Validates the field to only include alphabets and numbers.Parameters:message - (optional) - Error message to raise in case of a validation error.NotEqualTo:Checks the field under validation is not equal to another field.Parameters:fieldname – The name of the other field.message - (optional) - Error message to raise in case of a validation error.IntegerValidates the field to only include numbers.Parameters:message - (optional) - Error message to raise in case of a validation error.IsJsonThe field under validation must be a valid JSON string.Parameters:message - (optional) - Error message to raise in case of a validation error.DisposableEmailThe email address should not belong to a disposable email service provider.Parameters:message - (optional) - Error message to raise in case of a validation error.
Package: wtf-otp
One-Time Password Field for WT-FormsWhat This?This module has Google's2 factor authentication fieldsforWT-Forms.FeaturesSingle-Page Application driven secret key generation.QRCode GenerationSecret field and authentication validator that is based on [WTForms]How to useIf you want QR Code:First, write the form to generate secret key and authenticate it:form.py#!/usr/bin/env python# coding=utf-8fromflask_wtfimportFormimportwtforms.fieldsasfldimportwtforms.fields.html5asfld5importwtforms.validatorsasvldfromwtf_otpimportOTPSecretKeyField,OTPCheckclassUserInfoForm(Form):name=fld.StringField()email=fld5.EmailField(validators=[vld.InputRequired(),vld.Email()])password=fld.PasswordField()new_password=fld.PasswordField()confirm_password=fld.PasswordField(validators=[vld.EqualTo("new_password")])secret=OTPSecretKeyField(qrcode_url="/qrcode",validators=[vld.InputRequired()])classLoginForm(Form):email=fld5.EmailField(validators=[vld.InputRequired(),vld.Email()])passwrd=fld.PasswordField(validators=[vld.InputRequired()])auth=fld.IntegerField(validators=[validators=[vld.InputRequired(),OTPCheck()]])Next, write the app as usual. However, you want to add a new route of which
path is "/qrcode" that generates the qrcode. Fortuantely, the sufficient
function is provided. An instance ofOTPSecretKeyFieldprovidesqrcodefunction:from.formimportUserInfoForm# /qrcode is assigned to generate_qrcode.defgenerate_qrcode(req,res):form=UserInfoForm()secret=req.args.get("secret")ifnotsecret:abort(404)res.make_response(form.secret.qrcode(secret,name="Test Example",issuer_name="Test Corp"))resp.mimetype="image/svg+xml"Note that you can't get the instance byUserInfoForm.secret, becauseUserInfoForm.secretreturns an instance ofUnboundField.If you don't want QRCodeIf you don't want QRCode, just removeqrcode_urlfrom the corresponding
classes and remove QRCode generation class.More detailIf you want more detail, please refersource codeandexample code.License (MIT License)The MIT License (MIT)
Copyright (c) 2016- Hiroaki YamamotoPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Package: wtf-server
WTF (WSGI Tackling Framework) is a WSGI based meta-framework written in python
with optional speedup code written in C.WSGI is described here: <http://www.python.org/dev/peps/pep-0333/>Meta-framework means, that the package helps you build your own framework
out of it.Copyright and LicenseCopyright 2006 - 2016
André Malo or his licensors, as applicable.The whole package is distributed under the Apache License Version 2.0.
You’ll find a copy in the root directory of the distribution or online
at: <http://www.apache.org/licenses/LICENSE-2.0>.BugsNo bugs, of course. ;-)
But if you’ve found one or have an idea how to improve the WTF, feel
free to send a pull request ongithubor send a mail to
<wtf-bugs@perlig.de>.Author InformationAndré “nd” Malo <nd perlig.de>
GPG: 0x8103A37EIf God intended people to be naked, they would be born that way.
– Oscar Wilde
Package: wtf-tinymce
TinyMCE editor extension for WTForms1. InstallationUnder your project environment run:$ pip install wtf-tinymce2. Configuring2.1. Initializing moduleUnder your application initialization (e.g. app = Flask(__name__))
add module import and initialization:from wtf_tinymce import wtf_tinymce
wtf_tinymce.init_app(app)2.2. Adding templateIn your create or edit templates (or custom templates with wtforms) add
import:{% import 'wtf_tinymce/editor.html' as tinymce with context %}and under your site footer block add template initialization like:{% block tail %}
    {{ super() }}
    {{ tinymce.init_wtf_tinymce(default_content_css='css/tinymce.css') }}
{% endblock %}Note:default_content_cssis optional parameter with relative path
under project static folder to your custom stylesheet for editor
content.3. Usagefrom wtf_tinymce.forms.fields import TinyMceField

class MyForm(Form):
    text = TinyMceField(
        'My WTF TinyMCE Field label',
        tinymce_options={'toolbar': 'bold italic | link | code'}
    )To optional parametertinymce_optionsyou can add any TinyMCE options
(see official documentationhttps://www.tinymce.com/docs/configure/for details.