Saravanan666/pypi-org huggingface dataset:
Package: tormon
InfoTornado project which monitors urls provided.
As for now it supports file based url reader and persist information in memory.ManualClone project$pipinstalltormonRun tormon providing path to file which has list of urls (each in separate line) to monitor:$tor-mon--host=0.0.0.0--port=8081--filename=/tmp/urls.txt--debug=trueQuery api to get information:$curlhttp://localhost:8081/api/urls/$curlhttp://localhost:8081/api/stats/$curlhttp://localhost:8081/api/url/\?url\=<url>
Package: tormor
Tormor Command Line ToolTormor is a command line tool for migrating database. To use Tormor, please first ensure these requirements:Postgresql has been installedPostgresql can be accessed using command :$psqlSCHEMA_PATH has been specifiedInstallationTormor requires Python 3.5 or later to run. Tormor can be installed using pip:$pipinstallgit+https://github.com/Proteus-tech/tormor.git@pytest_asyncpg_dryrunInstruction$ tormor [opts] command [args]For more information, please use command:$tormor--helpEnabling Modulesenable-modulescommand receives module name as a parameter to be enabled and later migrated usingmigratecommand.$ tormor enable-modules module-to-be-migratedMigratemigratecommand executes sql files under the enabled modules.
To start migration, use the following command:$tormormigrateTo simply output migration sql queries without executing them, use the following command.$tormormigrate--dry-runRun a Script Fileincludecommand takes filename as a parameter allows tormor commands to be run in a script, each line at a time.$tormorincludefilenameExecute SQL Filesqlcommand takes filename as a parameter and load and execute the query inside it.$tormorsqlfilenameDevRequirementsflitPostgreSQLpipinstallflit
flitinstall
./runtestsPublish to PyPIflit publish
Package: torms
MIT LicenseCopyright (c) 2023 DERaCPermission 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: torn
torn-cli : A command line application to easily create and run tornado applications.Change logversion - 0.0.3 -Python 3 support addedversion - 0.0.2 -Fixed tornado missing issue.Versionstorn-cli works with Python 2.4-3.5Installationpip install tornorpip install git+https://github.com/shubhodeep9/torn.gitUsage$ torn -h
    Torn is tool for managing tornado web client.

    usage: torn command [arguments]

    positional arguments:
      command     Specify what command to proceed

    optional arguments:
      -h, --help  show this help message and exit

    The commands are:
            new             Create a Tornado Application
            run             run the app and start a Web server for development
            api             create an API tornado application
Package: tornadmin
Admin site for Tornado web server.Documentation•Python >= 3.7/!\ Work in progressIntroductionTornadmin is an admin site generation framework for Tornado web server. It is inspired by Django-Admin and Flask-Admin.Supported database ORMsTortoise ORMSQLAlchemyInstallInstall via pip:$pipinstalltornadminDocumentationQuickstart and usage docs can be found athttps://tornadmin.rtfd.io.LicenseBSD-3-ClauseIf you've found this library useful, and if you wish to support me you can:
Package: tornado
Tornadois a Python web framework and
asynchronous networking library, originally developed atFriendFeed.  By using non-blocking network I/O, Tornado
can scale to tens of thousands of open connections, making it ideal forlong polling,WebSockets, and other
applications that require a long-lived connection to each user.Hello, worldHere is a simple “Hello, world” example web app for Tornado:importasyncioimporttornadoclassMainHandler(tornado.web.RequestHandler):defget(self):self.write("Hello, world")defmake_app():returntornado.web.Application([(r"/",MainHandler),])asyncdefmain():app=make_app()app.listen(8888)awaitasyncio.Event().wait()if__name__=="__main__":asyncio.run(main())This example does not use any of Tornado’s asynchronous features; for
that see thissimple chat room.DocumentationDocumentation and links to additional resources are available athttps://www.tornadoweb.org
Package: tornado-alchemy-rest
This simple module creates CRUD endpoints for SQLAlchemy table. Its
purpose to allow quickly create RESTful APIs, for example for admin
panel. List endpoints support pagination and filtering. Was written for
Angular’s ng-admin, so this module supports ng-admin querying out of the
boxInstallationpip install tornado-alchemy-restUsage exampleimporttornado.webfromtornado.webimportURLSpecfrom.modelsimportItemTablefromtornado_alchemy_restimportSingleRESTAPIHandler,ListRESTAPIHandlerclassSingleItemHandler(SingleRESTAPIHandler):table=ItemTabledefdelete(self,*args,**kwargs):raiseHTTPError(405)classItemHandler(ListRESTAPIHandler):table=ItemTableapp=tornado.web.Application([URLSpec(prefix(r'items'),ItemHandler,dict(psql=psql_pool),'items'),URLSpec(prefix(r'items/(\d+)'),SingleItemHandler,dict(psql=psql_pool),'single_item'),])More complex example, where you can override object creation methods:classSingleItemHandler(SingleRESTAPIHandler):table=TableItem@gen.coroutinedefget_object_dict(self,*args):obj=yieldsuper().get_object_dict(*args)cursor=yieldself._execute_query(User.select().where(User.c.id==obj['user_id']))obj['user']=cursor.fetchone()returnobj@gen.coroutinedefput_object_dict(self,id,params):assertparams['value']>5yieldsuper().put_object_dict(id,params)classItemHandler(ListRESTAPIHandler):table=TableItem@gen.coroutinedefget_object_list(self,query):objects=yieldsuper().get_object_list(query)forobjinobjects:cursor=yieldself._execute_query(User.select().where(User.c.id==obj['user_id']))obj['user']=cursor.fetchone()raisegen.Return(objects)@gen.coroutinedefpost_object_dict(self,params):assertparams['value']>5yieldsuper().post_object_dict(params)QueryingTo get second page with ordering by id DESC you need to do that query:GET /item?_page=2&_perPage=30&_sortField=id&_sortDir=DESCTo get all items, wherenamecontains “test” andtypeis 5 andvalueis 7 or 6, you will need that query:GET /item?_filters={"name__contains":"test", "type":5, "value__any":[7,6]}Query params_page – page name_perPage – rows per page_sortField – field to order by_sortDir – direction to sort by_filters – filter items with given params. Currently supported
filters are: “” (equality), startswith, contains, icontains, any, neJoin supportThat will return data from both tables at some time:classSingleItemHandler(SingleRESTAPIHandler):table=TableItemdefget_from(self):returnself.table.join(TableUser,isouter=True)Requirementstornado, sqlalchemy
Package: tornado-alf
tornado-alf |build-status|===========Tornado OAuth 2 Client---------------------`tornado-alf` is a OAuth 2 Client base on the tornado's AsyncHTTPClientFeatures--------* Automatic token retrieving and renewing* Token expiration control* Automatic retry on status 401 (UNAUTHORIZED)Usage-----Initialize the client and use it as a AsyncHTTPClient object... code-block:: pythonfrom tornadoalf.client import Clientclient = Client(token_endpoint='http://example.com/token',client_id='client-id',client_secret='secret')resource_uri = 'http://example.com/resource'response = yield client.fetch(resource_uri,method='POST', body='{"name": "alf"}',headers={'Content-Type': 'application/json'})How it works?-------------Before any request the client tries to retrive a token on the endpoint,expecting a JSON response with the ``access_token`` and ``expires_in`` keys.The client keeps the token until it is expired, according to the ``expires_in``value.After getting the token, the request is issued with a `Bearer authorizationheader <http://tools.ietf.org/html/draft-ietf-oauth-v2-31#section-7.1>`_:.. code-block::GET /resource/1 HTTP/1.1Host: example.comAuthorization: Bearer tokenIf the request fails with a 401 (UNAUTHORIZED) status, a new token is retrievedfrom the endpoint and the request is retried. This happens only once, if itfails again the error response is returned.Troubleshooting---------------In case of an error retrieving a token, the error response will be returned,the real request won't happen.Related projects----------------This project tries to be an adaptaion to tornado of`alf <https://github.com/globocom/alf>`_.. |build-status| image:: https://secure.travis-ci.org/globocom/tornado-alf.png?branch=master:target: https://travis-ci.org/globocom/tornado-alf
Package: tornadoapi
Tornado REST framework【阅读文档】。安装目前 tornadoapi 支持的 Python 环境有 2.7, 3.4, 3.5, 3.6 和 pypy。:pip install tornadoapi快速开始启动之前或启动脚本开始时配置环境变量 并执行setup初始化:os.environ.setdefault("TORNADOAPI_SETTINGS_MODULE", "config.settings")
import tornadoapi
tornadoapi.setup()config/settings.py 中增加自定义配置:DEBUG = True
TEST = 1通过以下代码可以获取到settings参数:from tornadoapi.conf import settings

settings.TESTApiHandler调用示例:from tornadoapi.handler import ApiHandler

class TestHandler(ApiHandler):
    test_param = fields.CharField(description='测试参数', default=None)
    test_choice = fields.ChoiceField(description='选择参数', default=None, choices=((0, '选项0'), (1, '选项1')))

    @classmethod
    def get_return_sample(cls):
        return ErrCode.SUCCESS.get_res_dict(data={'test_param': '测试参数', 'test_choice' :'选择参数'})

    @classmethod
    def get_handler_name(cls):
        return '测试'

    def get(self, *args, **kwargs):
        ret = {
            'test_param': self.test_param,
            'test_choice': self.test_choice
        }
        self.write_api(ret)示例项目demo
Package: tornado-apidoc
# Tornado ApiDocTornado ApiDoc is a simple apidoc serving plugin for tornado inspired by flask-apidoc.## Installation```$ pip install tornado-apidoc```## Usage```pythonimport tornado.webfrom tornado_apidoc import make_apidoc_routeapplication = tornado.web.Application([make_apidoc_route(folder_path='./static',url_path='/docs')])```## Example```$ git clone https://github.com/wenhan-wu/tornado-apidoc$ cd tornado-apidoc$ apidoc -i . -o ./static -f .py$ python example.py```open [http://localhost:5000/docs](http://localhost:5000/docs) in your browser.
Package: tornado-api-kit
A collection of routines for building web APIs on top of Tornado web server.FeaturesAutomatic support multiple response formats (JSON, JSONP, XML)Pluggable authenticationError handlingExample usageimportapikit# Returning objects as response (only basic JSON-encodable types supported):classMyApiHander(apikit.ApiHandler):defget(self):self.write_response({'result':'sucess','x':1,y:[1,2,3]})# Authentication:classMyProtectedResourceBase(apikit.ProtectedResource):defauthenticate(self,callback):ifself.get_argument('password')!='12345':raisetornado.web.HTTPError(403,"Incorrect or missing password!")callback()classMyProtectedResource(MyProtectedResourceBase):defget(self):...Installation$ pip install tornado-api-kit
Package: tornado-async-pg
Momoko wrapsPsycopg2’s functionality for use inTornado. Have a look attutorialor fulldocumentation.Important:This is the 2.x version of Momoko. It requires Tornado >= 4.0, uses futures instead of calllbacks
and introduces a slightly different API compared to 1.x version. While transition is very
straightforward, the API is not backward compatible with 1.x!InstallationWith pip:pip install momokoOr manually:python setup.py installTestingSet the following environment variables with your own values before running the
unit tests:make -C tcpproxy
export MOMOKO_TEST_DB='your_db'
export MOMOKO_TEST_USER='your_user'
export MOMOKO_TEST_PASSWORD='your_password'
export MOMOKO_TEST_HOST='localhost'
export MOMOKO_TEST_PORT='5432'And run the tests with:python setup.py test
Package: tornado-async-transformer
Tornado Async TransformerAlibcsttransformer for updating tornado @gen.coroutine syntax to python3.5+ native async/await.Check out the demo.UsageYou can either:Addtornado_async_transformer.TornadoAsyncTransformerto your existing libcst codemod.Or runpython -m tornado_async_transformer.tool my_project/from the commandline.Example"""A simple coroutine."""from tornado import gen-@gen.coroutine-def call_api():-    response = yield fetch()+async def call_api():+    response = await fetch()if response.status != 200:raise BadStatusError()-    raise gen.Return(response.data)+    return response.data
Package: tornado-aws
A low-level Amazon Web Services API client for TornadoInstallationtornado-awsmay be installed via the Python package index with the tool of
your choice. I prefer pip:pipinstalltornado-awsExampleimportjsonimportpprintimporttornado_awsfromtornadoimportgen,ioloopHEADERS={'Content-Type':'application/x-amz-json-1.0','x-amz-target':'DynamoDB_20120810.DescribeTable'}PAYLOAD={'TableName':'my-dynamodb-table'}_ioloop=ioloop.IOLoop.instance()@gen.coroutinedefasync_request():client=tornado_aws.AsyncAWSClient('dynamodb')response=yieldclient.fetch('POST','/',headers=HEADERS,body=json.dumps(PAYLOAD))x=json.loads(response.body.decode('utf-8'))pprint.pprint(x)_ioloop.stop()_ioloop.add_callback(async_request)_ioloop.start()DocumentationDocumentation is available onReadTheDocs.RequirementsTornadoVersion HistoryAvailable athttps://tornado-aws.readthedocs.org/en/latest/history.html
Package: tornadobase
A base application and boilerplate for the Tornado web server.InstallationTo include tornadobase in your application install using pip:pip install tornadobaseRun the testspip install nosenosetestsUsetornadobase provides basic Application and Handler classes that wrap up some of
the boilerplate you’ll typically need when using the Tornado web server.  To get
a simple site running, create a file calledapplication.py:fromtornadobase.handlersimportBaseHandlerfromtornadobase.applicationimportApplicationclassIndexHandler(BaseHandler):defget(self):self.write('Hello, World!')classMyApp(Application):definit_handlers(self):self.handlers=[(r'/',IndexHandler)]Then start the web server:python application.py
Package: tornado-basic-auth
tornado-basic-auth=================.. class:: no-web no-pdfbasic authentication for the Tornado_ web framework.Installation------------The latest stable version of tornado-basic-auth can be installed from pypi:.. code-block:: bash$ pip install tornado-basic-authLicense-------This project is released under the terms of the `MIT License`_... _Tornado: http://www.tornadoweb.org/en/stable/.. _`MIT License`: https://raw.github.com/zhangyangjing/tornado-basic-auth/master/LICENSE
Package: tornado_bufferx_improved
Tornado=======Tornado is an open source version of the scalable, non-blocking web serverand and tools that power FriendFeed. Documentation and downloads areavailable at http://www.tornadoweb.org/Tornado is licensed under the Apache Licence, Version 2.0(http://www.apache.org/licenses/LICENSE-2.0.html).Automatic installation----------------------Tornado is listed in PyPI and can be installed with pip oreasy_install. Note that the source distribution includes demoapplications that are not present when Tornado is installed in thisway, so you may wish to download a copy of the source tarball as well.Manual installation-------------------Download https://github.com/downloads/facebook/tornado/tornado-2.3.tar.gztar xvzf tornado-2.3.tar.gzcd tornado-2.3python setup.py buildsudo python setup.py installThe Tornado source code is hosted on GitHub: https://github.com/facebook/tornadoOn Python 2.6 and 2.7, it is also possible to simply add the tornadodirectory to your PYTHONPATH instead of building with setup.py, sincethe standard library includes epoll support.Prerequisites-------------Tornado runs on Python 2.5, 2.6, 2.7 and 3.2.On Python 2.6 and 2.7, there are no dependencies outside the Pythonstandard library, although PycURL (version 7.18.2 or higher required;version 7.21.1 or higher recommended) may be used if desired.On Python 2.5, PycURL is required, along with simplejson and thePython development headers (typically obtained by installing a packagenamed something like python-dev from your operating system).On Python 3.2, the distribute package is required. Note that Python 3support is relatively new and may have bugs.Platforms---------Tornado should run on any Unix-like platform, although for the bestperformance and scalability only Linux and BSD (including BSDderivatives like Mac OS X) are recommended.
Package: tornado_circus
circus_tornadoA tornado application implementation compatible with circus sockets.As tornado is not WSGI complient, we cannot use chaussette to run
tornado applications with circus sockets.This project package a compatible version of tornado Application so you
can easily run tornado with all circus awesomeness.Use circus_tornadoLet’s take a simple example, the hello world:import tornado.ioloop
import tornado.web

from tornado.web import Application

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

application = Application([
    (r"/", MainHandler),
])

if __name__ == "__main__":
    application.listen(8888)
    tornado.ioloop.IOLoop.instance().start()If you want to run it with circus, you can’t use socket web and fallback
to launch them and let it bind its socket:[watcher:hello]
cmd = python hello_world.pyBut good news, with circus_tornado, it’s no longer true. Just import
Application from circus_tornado package:import tornado.ioloop
import tornado.web

from tornado_circus import Application

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

application = Application([
    (r"/", MainHandler),
])

if __name__ == "__main__":
    parse_command_line()
    application.listen(8888)
    tornado.ioloop.IOLoop.instance().start()One last requirement, you must call tornado.options.parse_command_linebeforecalling application.listen or it will doesn’t works.And finally the circus configuration:[watcher:hello]
cmd = python hello_world.py --fd=$(circus.sockets.hello)
use_sockets = True

[socket:hello]
host = 127.0.0.1
port = 9000And you’re done. You can go tohttp://localhost:9000to check if it
works.You can even launch a quick benchmark and check that it holds the load:$> boom -n 10000 -c 100 http://localhost:9000                       10:38:48
Server Software: TornadoServer/2.4.1
Running GET http://127.0.0.1:9000
    Host: localhost
Running 10000 times per 100 workers.
Starting the load [===...===] Done

-------- Errors --------

-------- Results --------
Successful calls        10000
Total time              9.3364 s
Average                 0.0656 s
Fastest                 0.0228 s
Slowest                 0.1009 s
Amplitude               0.0781 s
RPS                     1071
BSI                     Woooooo Fast

-------- Status codes --------
Code 200                10000 times.

-------- Legend --------
RPS: Request Per Second
BSI: Boom Speed Index
Package: tornadocliff-env
Tornado Cliff WalkingCliff Walking with Tornados is a variation of the original Cliff Walking environment.
It involves crossing a grid world while simultaneously avoiding falling off a cliff
and encountering a tornado which blows away the character to a random square in the
grid (including the cliff).DescriptionThe game starts with the Elf at the top left corner of a gridworld (i.e. [0,0]).
The goal location is always at the bottom right corner
(i.e. [-1,-1]), and if the Elf reaches the goal the episode ends.A cliff runs along the middle of the grid. If the player moves to a cliff location it
returns to the start location.A tornado begins from a random square, excluding the cliff, and it makes a random walk through
the grid at a given pace (default is 1). If the Elf crosses the tornado, it will
be blown away by a random square in the grid including the cliff.The player makes moves until they reach the goal.
Resembles Example 6.6 (page 132) from Reinforcement Learning: An Introduction
by Sutton and Barto [1].It is an adaptation of Gymnasium's Cliff Walking [2].Action SpaceThe action shape is(1,)in the range{0, 3}indicating
which direction to move the player.0: Move up1: Move right2: Move down3: Move leftObservation SpaceThe observation depends on the shape of the grid. For a(6,8)grid there are 48*48 possible states, corresponding to the position of the Elf and the position of
the tornado. The player cannot be at the cliff, nor at the goal as the latter
results in the end of the episode.The observation is a tuple representing the player's and the tornado's current
position as current_row * nrows + current_col (where both the row and col start at 0).The observation is returned as aTuple[int, int]. The first number being the state of the Elf and the second one corresponding to the state of the tornado.Starting StateThe episode starts with the player in state[0](location [0, 0]). And the tornado
begins at a random state.RewardEach time step incurs a -1 reward unless the player stepped into the cliff,
which incurs a -100 reward.Episode EndThe episode terminates when the player reaches the goal at the bottom left corner.Informationstep()andreset()return a dict with the following keys:"p" - transition probability for the state.As cliff walking is not stochastic, the transition probability returned always 1.0.Installationgitclonehttps://github.com/davera-017/TornadoCliffWalkingcdTornadoCliffWalking
pipinstall-e.References[1] R. Sutton and A. Barto, “Reinforcement Learning:
An Introduction” 2020. [Online].
Available:http://www.incompleteideas.net/book/RLbook2020.pdf[2] Farama Foundation, “Gymnasium” 2023. (v0.28.1).
See:https://github.com/Farama-Foundation/Gymnasium/blob/main/gymnasium/envs/toy_text/cliffwalking.pyVersion Historyv0.0.1: Initial version release