Saravanan666/pypi-org huggingface dataset:
Package: wsgi-seo-iframe
SEO iframe Replacer is a wsgi middleware to replace iframes containing
‘src’ attribute by its rendered html code. It is used to allow content
rendered by Ajax to be indexed by search engines like Google. Typical
usage on a django’s WSGI script:import os
from django.core.wsgi import get_wsgi_application
from wsgi_seo_iframe import IframeReplacerMiddleware

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")

application = get_wsgi_application()
application = IframeReplacerMiddleware(application)RequirementsThis packege requiresPhantomJSto be installed manually.You can download a compatible version of PhantomJS
here:http://phantomjs.org/download.htmlIn Debian based systems you can install it using:sudoapt-getinstall phantomjs
Package: wsgiserialize
Object serialization middleware for WSGI.
Supported object serialization formats include:XML-RPCJSONYaMLmarshalpicklecPickleSample usage:from wsgiserializer.jsonize import jsonize

@jsonize
def simple_app(environ, start_response):
    start_response('200 OK', [('Content-type','text/plain')])
    return {'test':'Hello world!'}

if __name__ == '__main__':
    from wsgiref.simple_server import make_server
    http = make_server('', 8080, simple_app)
    http.serve_forever()
Package: wsgiserve
wsgiserveis a command to run wsgi application defined paste deploy configuration.usage: wsgiserve [-h] [--reload] config [config_vars [config_vars ...]]

positional arguments:
config       A path to the configuration file
config_vars  Variables required by the config file.

optional arguments:
-h, --help   show this help message and exit
--reload     Use auto-restart file monitorChanges0.1 (2017/07/21)first release
Package: wsgistate
Session (flup-compatible), caching, memoizing, and HTTP cache control middleware for WSGI. Supports memory, filesystem, database, and memcached based backends.Simple memoization example:from wsgistate.memory import memoize

@memoize()
def app(environ, start_response):
    start_response('200 OK', [('Content-Type', 'text/plain')])
    return ['Hello World!']

if __name__ == '__main__':
     from wsgiref.simple_server import make_server
     http = make_server('', 8080, app)
     http.serve_forever()Simple session example:from wsgistate.memory import session

@session()
def app(environ, start_response):
     session = environ['com.saddi.service.session'].session
     count = session.get('count', 0) + 1
     session['count'] = count
     start_response('200 OK', [('Content-Type', 'text/plain')])
     return ['You have been here %d times!' % count]

if __name__ == '__main__':
    from wsgiref.simple_server import make_server
    http = make_server('', 8080, app)
    http.serve_forever()
Package: wsgi-static-middleware
WSGI Middleware for serving static files.Usageimportosfromwsgiref.simple_serverimportmake_serverfromwsgi_static_middlewareimportStaticMiddlewareBASE_DIR=os.path.dirname(__name__)STATIC_DIRS=[os.path.join(BASE_DIR,'static')]defapp(env,start_response):start_response('200 OK',[('Conte-type','text/plain; charset=utf-8')])return[b'Hello World']app=StaticMiddleware(app,static_root='static',static_dirs=STATIC_DIRS)if__name__=='__main__':httpd=make_server('',8000,app)httpd.serve_forever()$curl-vlocalhost:8000/static/style.css*Trying::1...*connectto::1port8000failed:Connectionrefused*Trying127.0.0.1...*Connectedtolocalhost(127.0.0.1)port8000(#0)>GET/static/style.cssHTTP/1.1>Host:localhost:8000>User-Agent:curl/7.43.0>Accept:*/*>*HTTP1.0,assumecloseafterbody<HTTP/1.0200OK<Date:Sun,11Sep201603:42:33GMT<Server:WSGIServer/0.2CPython/3.5.1<Content-Encodings:<Content-Type:text/css;charset=UTF-8<Content-Length:30<Last-Modified:Sun,11Sep201603:42:1473532953SGMT<Accept-Ranges:bytes<.foo{font-size:10px;}*Closingconnection0LICENSEMIT License

Copyright (c) 2016 Masashi SHIBATA

Permission 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: wsgi_status
WSGI-statusWSGI-status is a Python WSGI Middleware for monitoring WSGI application.
It records worker status and provide worker status as a file.
WSGI-status is inspired by uWSGI--statsoption.
These metrics that uWSGI provide are not given by other WSGI server middleware such as Gunicorn.
WSGI-status provide worker metrics like uWSGI format.UsageExamples echo.py with Gunicorn:$ ./example.shAnd seeexamples/upperware.pydirectory.LicenseWSGI-status is released under the MIT License. See the LICENSE file for more details.
Package: wsgistraw
wsgistraw(WSGI without STart_Response And Write) is a tiny Python
library that simplifies coding WSGI applications and middleware by removingstart_responseandwritefrom signatures of functions. This leads to a
signature like:def app(environ):
    return "200 OK", [("Content-Type", "text/plain")], ["Hello World!"]That is, return a three-tuple of(status, headers, response).start_responseandwriteare very annoying in WSGI middleware. wsgistraw
makes your middleware code cleaner. This is an example of a “lowercase”
middleware factory:@wsgistraw.mid_factory
def lowercase(app):
    def mid(environ):
        status, headers, response = app(environ)
        return status, headers, (s.lower() for s in response)
    return midWhat’s NewA bugfix release. Fixed a bug inapp_proxywith extending an iterable with
the results ofwrite().See Alsowsgistraw ProjectWSGI 2.0 at WSGI WikiPEP 333
Package: wsgisubdomain
wsgisubdomain is a WSGI application dispatcher. A WSGI application is fetched based on a request’s target subdomain, creating one if needed.wsgisubdomain supports Python 2.6, 2.7, 3.2, 3.3 and PyPy.The code in this module is adapted from:http://flask.pocoo.org/docs/patterns/appdispatch/#dispatch-by-subdomain[Read the complete docs](https://wsgisubdomain.readthedocs.org)[![Build Status](https://travis-ci.org/xsleonard/wsgisubdomain.png)](https://travis-ci.org/xsleonard/wsgisubdomain)
Package: wsgisvc
There are many deployment scenarios with Python web applications. Without diving into all the options I’ll suppose part of your deployment is utilizing Paste Deployment (http://pythonpaste.org/deploy/) . To test and develop your application you use “paster serve some_name.ini”. Now to setup the application so that it runs after log off or restart you need a customized Windows service.There are a couple of recipes around to achieve this but, you have to copy and paste some code and hardcode the name and config file into it. I’ve put together a little tool which helps creating windows services, based on arbitrary configuration parameters.1. install the tooleasy_install wsgisvcThis adds the wsgisvc.exe into your scripts directory.Python extensions for Windows are a prerequisite.If you don’t have them download (http://sourceforge.net/project/showfiles.php?group_id=78018) them and install.2. Extend your *.ini filewith a [winservice] section. The list of options you can use:svc_namesvc_display_namesvc_descriptionlog_filevirtual_envIf you don’t use the [winservice] section, the configuration file will be used as service name. Sensible defaults will be made up for the rest.3. Install the servicewsgisvc -c some_name.ini installThis adds the service “svc1” to your system. You can check it out under display name “svc1 Paste Service” through Administrative Tools -> Services. To start the service you can either use that or command line:wsgisvc -c some_name.ini startAnd the last thing, to list display names of all installed Paste services:wsgisvc listSource code of the packagehttp://bitbucket.org/tibor_arpas/wsgisvc/Any feedback or corrections are appreciated.
Package: wsgitest
You can usewsgitestto start a HTTP server for a WSGI application and
control the process:@Request.applicationdefapplication(request):returnResponse('Hello World!')classAppServerTestCase(TestCase):deftest_hello_app(self):server=WSGITestServer.create(application)try:response=requests.get(server.application_url)self.assertEqual(response.status_code,200)self.assertEqual(response.content,b"Hello World!")finally:server.terminate()deftest_hello_app_reference(self):server=WSGITestServer.create("tests.test_server.application")try:response=requests.get(server.application_url)self.assertEqual(response.status_code,200)self.assertEqual(response.content,b"Hello World!")finally:server.terminate()The methodWSGITestServer.create()initialize amultiprocessing.Processand wait for the server startup.You can use server as a context manager to avoid that tests get stucked when
you forget to “terminate” server:@Request.applicationdefapplication(request):returnResponse('Hello World!')classAppServerTestCase(TestCase):deftest_hello_app(self):withWSGITestServer(application)asserver:response=requests.get(server.application_url)self.assertEqual(response.status_code,200)self.assertEqual(response.content,b"Hello World!")You can also start server with an specific host/ip or TCP port:@Request.applicationdefapplication(request):returnResponse('Hello World!')classAppServerTestCase(TestCase):deftest_hello_app(self):withWSGITestServer(application,"0.0.0.0",5000)asserver:response=requests.get(server.application_url)self.assertEqual(response.status_code,200)self.assertEqual(response.content,b"Hello World!")
Package: wsgitestcase
Version:0.1TestCase that will launch your wsgi/werkzeug application in a separate thread
for you (usingsetUpandtearDownmethods).Inspired by Django’s LiveServerTestCase.How toimportrequests# you should use this, requests is coolfromwsgitestcaseimportWsgiTestCaseclassMyTestCase(WsgiTestCase):# add your wsgi application here# you can also set it with something like# app = staticmethod(my_wsgi_app)# see tests.py for more examples@staticmethoddefapp(environ,start_response):start_response('200 OK',[('Content-Type','text/plain')])yield'Hello World'deftest_something(self):# server with your app should be already up# use self.host, self.port and self.url to find out where it isr=requests.get("http://%s:%s/"%(self.host,self.port))self.assertEqual(r.text,"Hello World")# in self.requests you can find a list with all requests made to# your app. it contains werkzeug's Request objects.# see tests.py for more examples# and werkzeug's doc at http://werkzeug.pocoo.org/docs/wrappers/# for Request object referenceself.assertEqual(len(self.requests),1)self.assertEqual(self.requests[0].path,"/")Licensewsgitestcase is distributed under terms of MIT license.
Package: wsgi-tools
WSGI-ToolsA collection of WSGI packagesUsageSee: example.pyErrorHandlerThe error handler is a WSGI app which calls another WSGI app.If that WSGI app raises awsgi_tools.error.HTTPException, the error code and an optional message will be returńed.If that WSGI app raises a normal Exception, the error code500will be returńed.Import:fromwsgi_tools.errorimportErrorHandler,JSONErrorHandler,HTMLErrorHandlerTo use theErrorHandleryou have to overwrite the abstracthandlemethod or use the prebuildJSONErrorHandlerorHTMLErrorHandler.app=JSONErrorHandler(app0)FriedlyWith this you can serve easy-to-use functions over WSGI.defapp0(request):data=request.body_jsonresponse=do_something(data)return200,responseRouterThe router is a WSGI app which reads the path of the request and calls another corresponding WSGI app.Import:fromwsgi_tools.routingimportRouterCreate the Router:The first argument ofRouteris thelistof rules you want to use.A rule an instance of an subclass ofwsgi_tools.routing.Rule.The order of these rules is important, because you don't want to throw an405 Method Not Allowederror if there are no endpoints which match one of the endpoint and the method.So the path-checking rule must be before the method checking rule.There are premade rules for matching path, method and content-type:fromwsgi_tools.routingimportPathRule,METHOD_RULE,CONTENT_TYPE_RULEThe second argument is thedictwith tuples as keys, which represent the args for the rules and wsgi apps as keys.fromwsgi_tools.routingimportRouter,PathRule,METHOD_RULE,CONTENT_TYPE_RULEpath_rule=PathRule()app=Router([path_rule,METHOD_RULE,CONTENT_TYPE_RULE],{(('/create',),'POST','json'):create_app,(('/',int,'/options'),'GET',None):options_app})If you send aPOSTrequest to/createand the content-type is*/json,*/*+json,*/json+*or*/*+json+*,create_appwill be called.If you send aGETrequest to/3/options,options_appwill be called andpath_rule.argswill be[3].
Package: ws.gitpersona
git-persona provides an easy way to configure the git username on a per
repository basis. It is inspired by the mercurial extensionhg-persona.git-persona requires at least Python 3.3.
You can install it from PyPI like this:$ pip install ws.gitpersonaYou can configure invidual personas in your~/.gitconfigas follows:[persona]
home = Firstname Lastname <firstname@home.domain>
work = Firstname Lastname <firstname.lastname@work.domain>and you’ll probably want to set up an alias like this:[alias]
persona = !git-personaThen you can switch the persona of a repository:$ git persona -n home
$ git persona -n workAnd list all known personas:$ git personaCHANGES1.1.0 (2023-04-04)ChangesDrop Python-2 support (py2)Switch from setup.py to pyproject.toml (wheel)1.0.1 (2018-11-07)Make current-setuptools compatible1.0 (2015-01-11)First release.
Package: wsgitypes
This is an attempt to bring some type safety to WSGI applications using Python’s new
typing features (TypedDicts, Protocols). It seems to work OK but it’ll be full of gaps,
holes, bugs, missteps, etc. I would not recommend depending on it.This is implemented as a Python module, rather than MyPy stubs, as it represents a
protocol things can satisfy rather than a set of types for something concrete.This package came together during an exploration documented here:https://github.com/python/mypy/issues/7654Define a callable application as a class:classMyApplication(wsgitypes.Application[MyEnviron]):def__call__(self,environ:Environ,start_response:wsgitypes.StartResponse,)->wsgitypes.ResponseBody:my_header=environ.get("REQUEST_METHOD","")return[]Environ should be type-safe:classMyApplication(wsgitypes.Application):def__call__(self,environ:Environ,start_response:wsgitypes.StartResponse)->wsgitypes.ResponseBody:environ["wsgi.input"]# Goodenviron["wsgi.unpot"]# BORK! MyPy will catch this.return[]You can define your own extensions toEnvironusingTypedDictinheritance,
like so:classMyEnviron(wsgitypes.Environ):HTTP_X_MY_HEADER:t.Optional[str]classMyApplication(wsgitypes.Application):def__call__(self,environ:wsgitypes.Environ,start_response:wsgitypes.StartResponse)->wsgitypes.Response:environ=typing.cast(MyEnviron,environ)environ.get("HTTP_X_MY_HEADER")return[]Note that you need to usetyping.castto convert the incoming environ to your derived
version. An attempt was made to use a type param for Environ, but it wasn’t viable:https://github.com/python/mypy/issues/7654
Package: wsgiview
WSGI middleware that connects TurboGears/Buffet template plug-ins to any WSGI-enabled application.Usage example:from wsgiview import view

@view('webstring:template.html', format='html')
def simple_app(environ, start_response):
    start_response('200 OK', [('Content-type','text/html')])
    return {'test':'Hello world!\n'}

if __name__ == '__main__':
    from wsgiref.simple_server import make_server
    http = make_server('', 8080, simple_app)
    http.serve_forever()
Package: wsgi-vmprof
wsgi-vmprofWSGI Middleware for integrating vmprof.https://github.com/vmprof/vmprof-pythonhttps://github.com/vmprof/vmprof-serverHow to useInstallation$pipinstallwsgi-vmprofBasic Usageimporttimeimportbottlefromwsgi_vmprofimportVmprofMiddlewareapp=bottle.default_app()@app.route('/')defindex():time.sleep(1)return"Hello world!!"if__name__=="__main__":# Add wsgi-vmprof as a WSGI middleware!app=VmprofMiddleware(app)bottle.run(app=app)RequirementsPython 3.3 or latervmprofLicenseThis software is licensed under the MIT License.
Package: wsgi_wovn
# wsgi_wovnWSGI middleware for translating application by WOVN.io.A port of wovnjava (https://github.com/wovnio/wovnjava).## Install$ pip install wsgi_wovn## Usagefrom werkzeug import run_simplefrom wsgi_wovn import Middlewaredef application(env, start_response):start_response('200 OK', [('Content-Type', 'text/html')])return [b"<html><body><a href='/test'>Hello WSGI world!</a></body></html>"]wovn_app = Middleware(application, {'user_token': 'IRb6-','secret_key': 'secret',})run_simple('0.0.0.0', 8000, wovn_app)## LicenseMIT LicenseCopyright (c) 2016 Minimal Technologies, Inc.Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, 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 THESOFTWARE.
Package: wsgize
Middleware for WSGI-enabling Python callables including:Middleware that makes non-WSGI Python functions, callable classes, or methods into WSGI applicationsMiddleware that automatically handles generating WSGI-compliant HTTP response codes, headers, and compliant iteratorsAn HTTP response generatorA secondary WSGI dispatcherExamples:# Automatically handle HTTP response, header, and iterator generation

@wsgize()
def app(environ, start_response):
    return 'Hello World'

# Make a normal Python function into a WSGI application

@wsgiwrap()
def app(name):
    return 'Hello ' % name
Package: wsheatzypy
heatzypyManage your Heatzy in Python with websocketCheck your config, enable or disable heater, change preset mode.InstallUse the PIP package manager$pipinstallheatzypyOr manually download and install the last version from github$gitclonehttps://github.com/cyr-ius/heatzypy.git
$pythonsetup.pyinstallGet started# Import the heatzypy package.importasynciofromheatzypyimportHeatzyClientasyncdefmain():api=HeatzyClient("username","password")devices=awaitapi.async_get_devices()fordeviceindevices:name=device.get("dev_alias")data=awaitapi.async_get_device(device["did"])mode=data.get("attr").get("mode")logger.info("Heater :{}, mode :{}".format(name,mode))loop=asyncio.get_event_loop()loop.run_until_complete(main())Have a look at theexample.pyfor a more complete overview.Notes on HTTPSNot implemented
Package: wshubsapi
The package helps you handle complex communications in a server/clients architecture.Forget to handle web-socket messages with huge switch cases or maintain url strings for your API-REST.
Justcall server functions from the clientandcall client function from the serverlike it is the same program.
But not only that! with this package you will be able to communicate client applications with different languages or communication protocols at the same time!Available coding languages:Server side:only pythonClient side:pythonjavascriptjava/android (on going)c++/arduino (on going)micro-python (planned)Communication protocolsThis package is mainly a message handler so it doesn’t matter which communication protocol you use as long as you create a Wrapper to handle it. However, we provide handlers to start coding right away :)Web-Sockets for tornado and ws4pyHttp requests for Django and tornado frameworks (of course we lose server to client communication)SocketOf course, any contribution will be more that appreciated ;)
Package: wsid
wsidwsid (web show image dir), inspired bywoof, runs a webserver that generates a HTML with every image/video on a directory
see examplehere.python3.7+installarch/manjarowsidandwsid-gitare avaliable on the AUR.pippip install 'wsid[gui]'if that doesn't work, omit[gui]to install without the guielseget latest release fromthe releases pageand copy wsid to $PATHusagejustwsid <path to dir>orwsidto run the gui
Package: wsidicom-data
wsidicom-dataTest data forwsidicom.InstallInstall from pypi:pip install wsidicom-dataRe-creating encoded test datapython .\wsidicom_data\create_encoded_test_files.pyAccessing test datafromwsidicom_dataimportTestData,EncodedTestData,defined_encoder_settingstest_tile_path=TestData.get_test_tile_path()settings=defined_encoder_settings[0]encoded_test_file_path=EncodedTestData.get_filepath_for_encoder_settings(settings)Description of datatest_tile.pngis extracted fromCMU-1-Small-Region.svsin theOpenSlide test data setEncoded test data is created from thetest_tile.pngusing different encoders. The target transfer syntax, color, and bits per pixel is given in the filename.