100+ results for 'sqlalchemy tornado'

Not the results you expected?

Alerts.py (https://gitlab.com/fdemian/Shelob) Python · 160 lines

2 from api.model.models import Notification

3 from api.authentication.AuthenticatedHandler import AuthenticatedHandler

4 from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound

5 from tornado.gen import coroutine

Story.py (https://gitlab.com/fdemian/Shelob) Python · 113 lines

1 import json

2 from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound

3 from api.model.models import Story

4 from api.authentication.AuthenticatedHandler import AuthenticatedHandler

5 from tornado.gen import coroutine

6

7

env.py (https://gitlab.com/fdemian/Shelob) Python · 86 lines

1 from __future__ import with_statement

2 from alembic import context

3 from sqlalchemy import engine_from_config, pool

4 from logging.config import fileConfig

5 from tornado.options import define, options, parse_config_file

51

52 """

53 #url = config.get_main_option("sqlalchemy.url")

54 url = get_database_url()

55

68 """

69 config_section = config.get_section(config.config_ini_section)

70 config_section["sqlalchemy.url"] = get_database_url()

71

72 connectable = engine_from_config(

Comments.py (https://gitlab.com/fdemian/Shelob) Python · 203 lines

2 from api.model.sessionHelper import get_session

3 from api.model.models import Story, Comment, Notification, User

4 from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound

5 from api.authentication.AuthenticatedHandler import AuthenticatedHandler

6 from tornado.gen import coroutine

createPlots.sh (https://gitlab.com/wurssb/NG-Tax) Shell · 25 lines

2

3 #As galaxy runs in a virtual env the user python path is reset... therefor I (jasper) used this uqly hacky solution... (for now...)

4 PYTHONPATH=/home/QIIME_deploy/qiime_180/qiime-galaxy-0.0.1-repository-c2814c3c/lib/:/home/QIIME_deploy/qiime_180/qiime-1.8.0-release/lib/python2.7/site-packages:/home/QIIME_deploy/qiime_180/tax2tree-1.0-release/lib/python2.7/site-packages:/home/QIIME_deploy/qiime_180/biom-format-1.3.1-release/lib/python2.7/site-packages:/home/QIIME_deploy/qiime_180/pynast-1.2.2-release/lib/python2.7/site-packages:/home/QIIME_deploy/qiime_180/pprospector-1.0.1-release/lib/python2.7/site-packages:/home/QIIME_deploy/qiime_180/qiime-1.8.0-release/lib/:/home/QIIME_deploy/qiime_180/emperor-0.9.3-release/lib/python2.7/site-packages:/home/QIIME_deploy/qiime_180/matplotlib-1.3.1-release/lib/python2.7/site-packages:/home/QIIME_deploy/qiime_180/sphinx-1.0.4-release/lib/python2.7/site-packages:/home/QIIME_deploy/qiime_180/pyqi-0.3.1-release/lib/python2.7/site-packages:/home/QIIME_deploy/qiime_180/pycogent-1.5.3-release/lib/python2.7/site-packages:/home/QIIME_deploy/qiime_180/MySQL-python-1.2.3-release/lib/python2.7/site-packages:/home/QIIME_deploy/qiime_180/mpi4py-1.2.2-release/lib/python2.7/site-packages:/home/QIIME_deploy/qiime_180/setuptools-0.6c11-release/lib/python2.7/site-packages:/home/QIIME_deploy/qiime_180/gdata-2.0.17-release/lib/python2.7/site-packages:/home/QIIME_deploy/qiime_180/pysqlite-2.6.3-release/lib/python2.7/site-packages:/home/QIIME_deploy/qiime_180/tornado-3.1.1-release/lib/python2.7/site-packages:/home/QIIME_deploy/qiime_180/qcli-0.1.0-release/lib/python2.7/site-packages:/home/QIIME_deploy/qiime_180/ipython-latest-repository-126bd580/lib/python2.7/site-packages:/home/QIIME_deploy/qiime_180/pyzmq-2.1.11-release/lib/python2.7/site-packages:/home/QIIME_deploy/qiime_180/SQLAlchemy-0.7.1-release/lib/python2.7/site-packages:/home/QIIME_deploy/qiime_180/pysqlite-2.6.3-release/lib/:/home/QIIME_deploy/qiime_180/numpy-1.7.1-release/lib/python2.7/site-packages:

5

6 #Get path of script

GlobalOptions.py (https://gitlab.com/fdemian/Shelob) Python · 118 lines

1 import json

2 from tornado.web import RequestHandler

3 from tornado.gen import coroutine

4 from api.model.models import GlobalConfiguration

5 # from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound

6

7 class GlobalConfigurationHandler(RequestHandler):

setup.py (https://bitbucket.org/bendikro/deluge-yarss-plugin.git) Python · 86 lines

9 base_path = os.path.dirname(__file__)

10

11 # Get the version (borrowed from SQLAlchemy)

12 with open(os.path.join(base_path, "src", "urllib3", "__init__.py")) as fp:

13 VERSION = (

70 "pytest",

71 "mock",

72 "tornado",

73 ],

74 test_suite="test",

__init__.py (https://github.com/thecowboy/apollo.git) Python · 103 lines

29 import logging

30

31 from sqlalchemy.engine import create_engine

32

33 from apollo.server.models.meta import bindSession

34

35 from tornado.options import define, options, parse_config_file, parse_command_line

36 from tornado.options import Error as OptionsError

51 def setupOptions():

52 """

53 Initialize options for use with Tornado.

54 """

55 define("debug", default=False, help="run in debug mode", type=bool, metavar="DEBUG")

83 def setupDBSession():

84 """

85 Set up the session for SQLAlchemy.

86 """

87 # netloc

index.py (https://gitlab.com/sphaso/weiqi.gs) Python · 79 lines

15 # along with this program. If not, see <http://www.gnu.org/licenses/>.

16

17 from tornado.web import HTTPError

18 from sqlalchemy.orm import undefer

README.rst (https://gitlab.com/carmes/aiomysql) ReStructuredText · 146 lines

19 Internally **aiomysql** is copy of PyMySQL, underlying io calls switched

20 to async, basically ``yield from`` and ``asyncio.coroutine`` added in

21 proper places)). `sqlalchemy` support ported from aiopg_.

22

23

95

96

97 Example of SQLAlchemy optional integration

98 ------------------------------------------

99 Sqlalchemy support has been ported from aiopg_ so api should be very familiar

104 import asyncio

105 from aiomysql.sa import create_engine

106 import sqlalchemy as sa

107

108

144 .. _aiopg: https://github.com/aio-libs/aiopg

145 .. _PyMySQL: https://github.com/PyMySQL/PyMySQL

146 .. _Tornado-MySQL: https://github.com/PyMySQL/Tornado-MySQL

147

install.sh (https://github.com/mkb218/wub-machine.git) Shell · 133 lines

45 apt-get install git-core python-setuptools python-dev build-essential python-pip

46

47 # Install server-specific stuff: SQLAlchemy, Tornadio, Tornadio from HEADs

48 apt-get install python-mysqldb

49 pip install sqlalchemy

50

51 git clone https://github.com/facebook/tornado.git

52 cd tornado

53 python setup.py install

54 cd ..

55 rm -rf tornado/

56

57 git clone https://github.com/MrJoes/tornadio.git

87 hash pip 2>&- || easy_install pip

88

89 # Install server-specific stuff: SQLAlchemy, Tornadio, Tornadio from HEADs

90 pip install python-mysqldb

91 pip install sqlalchemy

Activation.py (https://gitlab.com/fdemian/Shelob) Python · 118 lines

1 import json

2 from api.model.models import User, UserActivation

3 from tornado.web import RequestHandler

4 from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound

5 from tornado.gen import coroutine

6

7

README.rst (https://github.com/fhats/partify.git) ReStructuredText · 21 lines

12 * Flask, a python microframework for web development

13 * Flask-WTF, a Flask extension for WTForms supporpt

14 * Flask-SQLAlchemy, a Flask extension for SQLAlchemy support

15 * SQLAlchemy, a SQL abstraction framework

16 * WTForms

17 * CoffeeScript (optional), required to build the javascript assets

18 * Tornado (recommended), a fast Python web server

19 * Testify (optional), to run the unit tests

20

OAuthService.py (https://gitlab.com/fdemian/Shelob) Python · 91 lines

1 from tornado import gen

2 from .FacebookService import FacebookAuthService

3 from .GoogleService import GoogleAuthService

4 from api.authentication.AuthExceptions import OAuthFailedException, NoSuchServiceException

5 from sqlalchemy.orm.exc import MultipleResultsFound

6 from api.model.sessionHelper import get_session

7 from api.model.models import User, OAuthAccount

TwitterService.py (https://gitlab.com/fdemian/Shelob) Python · 53 lines

1 import tornado

2 import tornado.web

3 import tornado.auth

4 from sqlalchemy.orm.exc import MultipleResultsFound, NoResultFound

7

8

9 class TwitterService(tornado.web.RequestHandler, tornado.auth.TwitterMixin):

10

11 @tornado.gen.coroutine

base.py (https://github.com/garethdmm/gryphon.git) Python · 152 lines

4 import traceback

5

6 import sqlalchemy.exc

7 import tornado.web

8 from tornadotoad import api

9 from tornadotoad import my

18

19

20 class BaseHandler(tornado.web.RequestHandler):

21 """

22 A class to collect common handler methods - all other handlers should subclass this

49 return super(BaseHandler, self).send_error(status_code, **kwargs)

50

51 tornado_toad = api.TornadoToad()

52 exception = kwargs.get('exc_info')

53

Dockerfile (https://gitlab.com/rbax81/VisTrails) Dockerfile · 54 lines

12 apt-get install -y python python-dateutil python-dev python-docutils \

13 python-mako python-matplotlib python-mysqldb python-numpy python-paramiko \

14 python-pip python-scipy python-setuptools python-sphinx python-sqlalchemy \

15 python-suds python-tz python-unittest2 python-virtualenv \

16 python-xlrd python-xlwt

18 apt-get install -y python-qt4 python-qt4-gl python-qt4-sql python-vtk \

19 imagemagick xvfb

20 # Install IPython deps. python-tornado is too old, so we'll get it from pip

21 RUN \

22 apt-get install -y python-zmq

37 . venv/bin/activate && \

38 pip install -r requirements.txt && \

39 pip install 'tornado>=4.0' jsonschema

40

41 # Warning: using 'setup.py develop' will make setuptools add dist-packages to

FacebookService.py (https://gitlab.com/fdemian/Shelob) Python · 103 lines

1 from tornado.auth import FacebookGraphMixin

2 from tornado.gen import coroutine

3 from sqlalchemy.orm.exc import MultipleResultsFound, NoResultFound

4 from api.model.sessionHelper import get_session

5 from api.model.models import User

setup.py (https://gitlab.com/czm1129/pyspider) Python · 124 lines

27 'pyquery',

28 'requests>=2.2',

29 'tornado>=3.2',

30 'Flask-Login>=0.2.11',

31 'u-msgpack-python>=1.6',

42 'amqp>=1.3.0',

43 'pymongo>=2.7.2',

44 'SQLAlchemy>=0.9.7',

45 'redis',

46 'kombu',

app_frontend_base.pp (https://gitlab.com/karambir/zulip) Puppet · 136 lines

16 # Needed for mock objects in decorators

17 "python-mock",

18 # Tornado dependencies

19 "python-tornado",

20 "python-sockjs-tornado",

21 # Needed for our fastcgi setup

22 "python-flup",

30 "python-psycopg2",

31 # Needed for building complex DB queries

32 "python-sqlalchemy",

33 # Needed for integrations

34 "python-twitter",

110 notify => Service["supervisor"],

111 }

112 file { "/home/zulip/tornado":

113 ensure => directory,

114 owner => "zulip",

setup.py (https://github.com/jupyter/nbgrader.git) Python · 108 lines

88 },

89 install_requires=[

90 "sqlalchemy",

91 "python-dateutil",

92 "jupyter",

97 "jupyter_core",

98 "jupyter_client",

99 "tornado",

100 "requests",

101 "jsonschema",

GoogleService.py (https://gitlab.com/fdemian/Shelob) Python · 80 lines

1 import tornado

2 import tornado.web

3 from tornado.auth import GoogleOAuth2Mixin

4 from tornado.web import RequestHandler

5 from sqlalchemy.orm.exc import MultipleResultsFound, NoResultFound

6 from api.model.sessionHelper import get_session

7 from api.model.models import User

setup.py (https://gitlab.com/e0/luigi) Python · 90 lines

38

39 install_requires = [

40 'tornado>=4.0,<5',

41 'python-daemon<3.0',

42 ]

44 if os.environ.get('READTHEDOCS', None) == 'True':

45 # So that we can build documentation for luigi.db_task_history and luigi.contrib.sqla

46 install_requires.append('sqlalchemy')

47 # readthedocs don't like python-daemon, see #1342

48 install_requires.remove('python-daemon<3.0')

ROADMAP.md (https://github.com/graphql-python/graphene.git) Markdown · 54 lines

46 | ...[flask](https://github.com/graphql-python/flask-graphql) | | | | | |

47 | ...[webob](https://github.com/graphql-python/webob-graphql) | | | | | |

48 | ...[tornado](https://github.com/graphql-python/graphene-tornado) | ewhauser | | PR created | ✅ | |

49 | ...[ws](https://github.com/graphql-python/graphql-ws) | Cito/dfee | | ✅ | ✅ | |

50 | ...[gae](https://github.com/graphql-python/graphene-gae) | ekampf | | PR created | ✅ | |

51 | ...[sqlalchemy](https://github.com/graphql-python/graphene-sqlalchemy) | jnak/Nabell | ✅ | ✅ | ✅ | |

52 | ...[mongo](https://github.com/graphql-python/graphene-mongo) | | | ✅ | ✅ | |

53 | ...[relay-py](https://github.com/graphql-python/graphql-relay-py) | Cito | | | | |

Drafts.py (https://gitlab.com/fdemian/Shelob) Python · 281 lines

1 import json

2 from api.model.models import Story, User, Category

3 from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound

4 from api.authentication.AuthenticatedHandler import AuthenticatedHandler

5 from tornado.gen import coroutine

__init__.py (https://github.com/araddon/demisauce.git) Python · 23 lines

1 #!/usr/bin/env python

2 import tornado.options

3 from tornado.options import define, options

20 define("port", default=4950, help="run on the given port", type=int)

21

22 define("sqlalchemy_default_url", default=("mysql://root:demisauce@192.168.1.7/demisauce"))

23 define("sqlalchemy_default_echo", default=True, type=bool,help="run in echo mode")

base.py (https://gitlab.com/forevercat/Project) Python · 75 lines

4 import json

5

6 import tornado.web

7 from tornado import httputil

8

9 import sqlalchemy

10 from sqlalchemy import create_engine

11 from sqlalchemy.orm import sessionmaker

12 from sqlalchemy import func

20 sys.setdefaultencoding('utf-8')

21

22 class BaseHandler(tornado.web.RequestHandler):

23 __model__ = '__base__'

24

README.rst (https://github.com/araddon/demisauce.git) ReStructuredText · 67 lines

8

9

10 Powered By `Tornado <http://www.tornadoweb.org>`_, MySql, `Gearman <http://www.gearman.org>`_, `Redis <http://www.tornadoweb.org>`_

11

12 Make a config file as follows::

27 Development

28 ======================

29 After making changes to the model, if you are using SQLAlchemy to

30 create db, you can write changes to db using: (runs websetup.py setup_config())::

31

__init__.py (https://github.com/stan1y/MrHide.git) Python · 50 lines

8 import logging

9

10 import tornado.web

11

12 import mgen.model

14 import mgen.util

15

16 import sqlalchemy.orm.exc

17

18

20

21

22 class BaseRequestHandler(tornado.web.RequestHandler):

23

24 def get_current_user(self):

talk.rst (https://bitbucket.org/pypy/extradoc/) ReStructuredText · 202 lines

114

115 * RPython ``psycopg2`` compatible lib, requires compiling your own PyPy

116 * ``pg8000`` and tons of other random libraries, Django doesn't work with them, but if they're pure Python they'll work with other stuff (e.g. SQLAlchemy)

117

118 MySQL

164 * PyPy trunk: about 1.35x faster than CPython

165

166 Tornado web app

167 ---------------

168

setup.py (https://bitbucket.org/marcelm/exomate.git) Python · 69 lines

36 ./exomate/ {prefix}/exomate/

37 rsync -p \\

38 ./run_tornado.py {prefix}/

39 echo "git_revision='$(date +"%Y-%m-%d") $(git rev-parse --short HEAD)'" >> {prefix}/exomate/__init__.py

40 chmod -R o+r {prefix}

54 scripts = [ s for s in glob(os.path.join("bin", "exomate-*")) if not s.endswith('~') ],

55 install_requires = [

56 "SQLalchemy >= 0.8.0b2",

57 "Flask-SQLAlchemy"

models.py (https://github.com/openhatch/oh-mainline.git) Python · 61 lines

1 """Tornado SQLAlchemy ORM models for Social Auth"""

2 from sqlalchemy import Column, Integer, String, ForeignKey

4

5 from social.utils import setting_name, module_member

6 from social.storage.sqlalchemy_orm import SQLAlchemyUserMixin, \

7 SQLAlchemyAssociationMixin, \

11

12

13 class TornadoStorage(BaseSQLAlchemyStorage):

14 user = None

15 nonce = None

44 return User

45

46 class Nonce(_AppSession, Base, SQLAlchemyNonceMixin):

47 """One use numbers"""

48 pass

create_database.py (https://gitlab.com/fdemian/Shelob) Python · 38 lines

1 from sqlalchemy import create_engine

2 from tornado.options import define, options, parse_config_file

index.html (https://bitbucket.org/frank418/tblog.git) HTML · 123 lines

69 <li><a href="http://0418.me">Flask Blog</a></li>

70 </ul>

71 <h3 class="muted">Tornado Blog by Frank</h3>

72 </div>

73

75

76 <div class="jumbotron">

77 <h1>开始用Tornado重写博客系统!</h1>

78 <a class="btn btn-large btn-success" href="http://git.0418.me/tblog">查看源码</a>

79 </div>

83 <div class="row-fluid marketing">

84 <div class="span6">

85 <h4>Tornado</h4>

86

87 <p>强力异步网络框架兼Web开发框架</p>

sessionHelper.py (https://gitlab.com/fdemian/Shelob) Python · 35 lines

1 from sqlalchemy import create_engine

2 from sqlalchemy.orm import sessionmaker

3 from tornado.options import options, parse_config_file

4 from os import path

5

index.py (https://gitlab.com/duonggit/weiqi.gs) Python · 82 lines

15 # along with this program. If not, see <http://www.gnu.org/licenses/>.

16

17 from sqlalchemy.orm import undefer

18 from tornado.web import HTTPError

web_server.py (https://github.com/kramer314/sagecell.git) Python · 64 lines

9

10 from trusted_kernel_manager import TrustedMultiKernelManager as TMKM

11 from db_sqlalchemy import DB

12

13 # Tornado / zmq imports

14 import zmq

15 from zmq.eventloop import ioloop

16 import tornado.web

17

18 ioloop.install()

22 _kernel_id_regex = r"(?P<kernel_id>\w+-\w+-\w+-\w+-\w+)"

23

24 # Tornado Web Server

25 import handlers

26

753ec9bc0d27_init_v1_0.py (https://github.com/xtg20121013/blog_xtg.git) Python · 170 lines

8 """

9 from alembic import op

10 import sqlalchemy as sa

11 from model.constants import Constants

12

126 dict(id=1,

127 title=u'开源分布式博客系统blog_xtg',

128 signature=u'基于tornado的分布式博客!— by xtg',

129 navbar='inverse')

130 ])

index.rst (https://gitlab.com/carmes/aiomysql) ReStructuredText · 141 lines

10 .. _asyncio: http://docs.python.org/3.4/library/asyncio.html

11 .. _aiopg: https://github.com/aio-libs/aiopg

12 .. _Tornado-MySQL: https://github.com/PyMySQL/Tornado-MySQL

13 .. _aio-libs: https://github.com/aio-libs

14

21 Internally **aiomysql** is copy of PyMySQL, underlying io calls switched

22 to async, basically ``yield from`` and ``asyncio.coroutine`` added in

23 proper places. :term:`sqlalchemy` support ported from aiopg_.

24

25

84

85 :mod:`aiomysql.sa` module is **optional** and requires

86 :term:`sqlalchemy`. You can install *sqlalchemy* by running::

87

88 pip3 install sqlalchemy

py3torch3cuda9.yml (https://github.com/pcyin/tranX.git) YAML · 124 lines

84 - testpath=0.3.1

85 - tk=8.6.7

86 - tornado=5.1

87 - traitlets=4.3.2

88 - wcwidth=0.1.7

112 - pyyaml==3.12

113 - records==0.5.2

114 - sqlalchemy==1.2.7

115 - tablib==0.12.1

116 - tabulate==0.8.2

__init__.py (https://gitlab.com/duonggit/weiqi.gs) Python · 42 lines

17 import os

18

19 from sqlalchemy.orm import scoped_session

20 from weiqi import settings

21 from weiqi.db import Session, create_db, create_schema

33 # Patch the `weiqi.db.sessions` contextmanager to use the same session as other parts of the testing framework, such as

34 # in factory boy.

35 # This is mainly used to test tornado request handlers.

36 from contextlib import contextmanager

37 @contextmanager

python-libs.yaml (https://github.com/pjotrp/cloudbiolinux.git) YAML · 83 lines

69 - scikit-learn

70 - scipy

71 - SQLAlchemy

72 - statsmodels

73 - tornado

utils.py (https://github.com/quantopian/pgcontents.git) Python · 141 lines

14 from IPython.utils import py3compat

15 from nose.tools import nottest

16 from sqlalchemy import create_engine

17 from tornado.web import HTTPError

setup.py (https://github.com/fhats/partify.git) Python · 34 lines

28 "Flask == 0.9",

29 "Flask-WTF == 0.8",

30 "Flask-SQLAlchemy == 0.16",

31 "tornado == 2.4"

GithubService.py (https://gitlab.com/fdemian/Shelob) Python · 112 lines

1 import tornado

2 import tornado.web

3 from .GithubMixin import GithubOAuth2Mixin

4 from tornado.web import RequestHandler

5 from sqlalchemy.orm.exc import MultipleResultsFound, NoResultFound

6 from api.model.sessionHelper import get_session

7 from api.model.models import User

8 from tornado.httpclient import AsyncHTTPClient

9 from urllib.parse import urlencode

10

15 class GithubAuthService(RequestHandler, GithubOAuth2Mixin):

16

17 @tornado.gen.coroutine

18 def get(self, auth_code, redirect_url):

19

main.py (https://gitlab.com/forevercat/Project) Python · 60 lines

3 import api

4 import types

5 import tornado.ioloop

6 import tornado.web

7 import sqlalchemy

8 from sqlalchemy import create_engine

9 from sqlalchemy.orm import sessionmaker

10 from sqlalchemy import func

14 sys.setdefaultencoding('utf-8')

15

16 class ESApplication(tornado.web.Application):

17 def __init__(self, api_entry, **settings):

18 handlers = self.load_handlers(api_entry)

models.py (https://github.com/priyaank/python-social-auth.git) Python · 86 lines

1 """Tornado SQLAlchemy ORM models for Social Auth"""

2 from sqlalchemy import Column, Integer, String, ForeignKey

5

6 from social.utils import setting_name, module_member

7 from social.storage.sqlalchemy_orm import SQLAlchemyUserMixin, \

8 SQLAlchemyAssociationMixin, \

9 SQLAlchemyNonceMixin, \

10 SQLAlchemyCodeMixin, \

11 BaseSQLAlchemyStorage

12 from social.apps.tornado_app.fields import JSONType

13

14

15 class TornadoStorage(BaseSQLAlchemyStorage):

16 user = None

17 nonce = None

TwitterRedirect.py (https://gitlab.com/fdemian/Shelob) Python · 63 lines

1 from tornado import gen

2 from tornado.web import RequestHandler

3 from tornado.auth import TwitterMixin, AuthError

4 from tornado.escape import json_encode

5 from api.model.sessionHelper import get_session

6 from api.model.models import User

7 from sqlalchemy.orm.exc import MultipleResultsFound, NoResultFound

8

9

Categories.py (https://gitlab.com/fdemian/Shelob) Python · 201 lines

2 from api.model.models import Category, Story

3 from api.authentication.AuthenticatedHandler import AuthenticatedHandler

4 from tornado.web import RequestHandler

5 from tornado.gen import coroutine

6 from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound

7 from api.Utils import authenticated

8

default.nix (https://github.com/NixOS/nixpkgs-channels.git) Nix · 64 lines

5 , pytest

6 , pytestcov

7 , sqlalchemy

8 , tornado

35 pytest

36 pytestcov

37 sqlalchemy

38 tornado

NoticiaViews.py (https://hg.codeplex.com/hackathon) Python · 97 lines

16 from ..models import Tema

17 from ..models import DBSession

18 from sqlalchemy import desc

19 from ..ws import notify

20

package.py (https://github.com/LLNL/spack.git) Python · 35 lines

20 depends_on('py-python-dateutil', type=('build', 'run'))

21 depends_on('py-jinja2', type=('build', 'run'))

22 depends_on('py-sqlalchemy@1.1:', type=('build', 'run'))

23 depends_on('py-tornado@5.0:', type=('build', 'run'))

README.md (https://gitlab.com/lcp0578/FrameworkBenchmarks.git) Markdown · 126 lines

69

70

71 ### Gunicorn + Tornado

72

73 uWSGI + PyPy is difficult to setup.

74 Meinheld doesn't so fast with PyPy because it uses Python/C API heavily.

75 So we use Tornado as HTTP/WSGI server.

76

77 It supports keep-alive. So it have nice performance about json or plaintext benchmark.

92 Simple json or plaintext test is enough.

93

94 If your framework uses SQLAlchemy, Flask may be enough to know performance of SQLAlchemy.

95

96

appbase.py (https://github.com/peter-the-tea-drinker/tornado-base.git) Python · 57 lines

1 import config

2 import sqlalchemy

3 import sqlalchemy.orm

4 from sqlalchemy.ext.declarative import declarative_base

5

6 # to upgrade live

17 def __init__(self):

18 self.engine = None

19 self.Session = sqlalchemy.orm.sessionmaker()

20 self.Base = declarative_base()

21

25

26 orm = ORM()

27 orm.initialize(sqlalchemy.create_engine(config.DB))#, encoding='utf-8'))

28

29 sql = sqlalchemy

config.py (https://github.com/qunarcorp/open_dnsdb.git) Python · 137 lines

96 default='sync',

97 help='The type of workers to use.',

98 choices=('sync', 'eventlet', 'gevent', 'tornado'))

99 ], 'gunicorn')

100

128

129 self.SECRET_KEY = os.environ.get('SECRET_KEY') or CONF.etc.secret_key

130 self.SQLALCHEMY_DATABASE_URI = CONF.DB.connection

131 self.SQLALCHEMY_TRACK_MODIFICATIONS = False

133

134 # SECRET_KEY = os.environ.get('SECRET_KEY') or CONF.etc.secret_key

135 # SQLALCHEMY_DATABASE_URI = CONF.DB.connection

136 # SQLALCHEMY_TRACK_MODIFICATIONS = False

HOWTO.md (https://bitbucket.org/mixedpower/tordos.git) Markdown · 51 lines

17 |-templates

18 |-tordos -- web项目python模块的顶层包

19 |-core -- 放了一些收集到tornado做web项目需要用到的外部支持模块

20 |-http

21 |-base_request.py -- 每个RequestHandler的父类,有自己的特定修改,可在此处做修改

24 |-session.py -- session的支持:memcached, redis, mongodb, dict等方式(配置参数SESSION_TYPE)

25 |-orm

26 |-sqlalchemy.py -- 集成SQLAlchemy orm框架(配置参数:ORM_TYPE)

27 |-peewee.py -- 集成peeweee orm框架

28 |-mongo.py -- 集成mongodb数据库的支持

41 |-controller.py -- 每个请求的处理handler

42 |-model.py -- 该模块用到的自定义数据类

43 |-uimodules.py -- 若使用了tornado模板,可以定义该文件

44 |-static

45 |-template

2017_04_08-gunicorn.md (https://github.com/jiajunhuang/blog.git) Markdown · 56 lines

50 通过gevent打patch实现的协程相比Tornado有以下不同:

51

52 - Tornado内置IOLoop,但是很多第三方库不支持,例如不能愉快的使用requests和SQLAlchemy,

53 否则就是阻塞,虽然网上有一些解决方案但是都不完美

54 - gevent性能比Tornado稍高

README.rst (https://github.com/thecowboy/apollo.git) ReStructuredText · 47 lines

9 http://www.python.org

10

11 * Tornado

12 http://www.tornadoweb.org

13

14 * SQLAlchemy

15 http://www.sqlalchemy.org

24 http://www.pythonware.com/products/pil

25

26 And any form of RDBMS SQLAlchemy supports (PostgreSQL, MySQL, etc.).

27

28 *Note:* MySQL may not be supported, due to functional indexes.

2019_03_29-python_golang_best_practice.md (https://github.com/jiajunhuang/blog.git) Markdown · 66 lines

25 - gunicorn + gevent异步比asyncio/tornado等更加方便

26 - [Flask](http://flask.pocoo.org/) 总体来说是一个好用的web框架

27 - ORM使用 [SQLAlchemy](https://www.sqlalchemy.org/) ,migration使用 [alembic](https://alembic.sqlalchemy.org/en/latest/)

28 - 参数校验使用 [marshmallow](https://github.com/marshmallow-code/marshmallow)

29 - 异步任务使用 gevent + python-rq,celery并发一高就容易遇到莫名假死的问题

README.rst (https://github.com/fantix/gino.git) ReStructuredText · 93 lines

29

30 GINO - GINO Is Not ORM - is a lightweight asynchronous ORM built on top of

31 SQLAlchemy_ core for Python asyncio_. GINO 1.0 supports only PostgreSQL_ with asyncpg_.

32

33 * Free software: BSD license

71

72

73 .. _SQLAlchemy: https://www.sqlalchemy.org/

74 .. _asyncpg: https://github.com/MagicStack/asyncpg

75 .. _PostgreSQL: https://www.postgresql.org/

77 .. _Alembic: https://bitbucket.org/zzzeek/alembic

78 .. _Sanic: https://github.com/channelcat/sanic

79 .. _Tornado: http://www.tornadoweb.org/

80 .. _Quart: https://gitlab.com/pgjones/quart/

81 .. _English: https://python-gino.org/docs/en/

pyproject.toml (https://github.com/DataDog/dd-trace-py.git) TOML · 164 lines

76 | session.py

77 )

78 | sqlalchemy

79 | sqlite3

80 | tornado

149 | rediscluster

150 | requests

151 | sqlalchemy

152 | sqlite3

153 | test_utils.py

154 | tornado

155 )

156 | ddtrace_run.py

activity.py (https://github.com/bcampbell/unsourced.git) Python · 62 lines

5 import urllib

6

7 import tornado.auth

8 from sqlalchemy import Date,not_

9 from sqlalchemy.sql.expression import cast,func

10 from sqlalchemy.orm import subqueryload,joinedload

setup.py (https://github.com/uber-common/opentracing-python-instrumentation.git) Python · 66 lines

34 'future',

35 'wrapt',

36 'tornado>=4.1,<6',

37 'contextlib2',

38 'opentracing>=2,<3',

51 'MySQL-python; python_version=="2.7"',

52 'psycopg2-binary',

53 'sqlalchemy>=1.3.7',

54 'pytest',

55 'pytest-cov',

56 'pytest-localserver',

57 'pytest-mock',

58 'pytest-tornado',

59 'basictracer>=3,<4',

60 'redis',

config.py (https://github.com/araddon/demisauce.git) Python · 120 lines

1 import logging, json

2 from sqlalchemy import Column, MetaData, ForeignKey, Table, \

3 func, UniqueConstraint

4 from sqlalchemy import Integer, String as DBString, DateTime, Boolean, \

5 Text as DBText

6 from sqlalchemy import engine, orm

7 from sqlalchemy.orm import mapper, relation, class_mapper, synonym, dynamic_loader

8 from sqlalchemy.sql import and_, text

9 from datetime import datetime

10 import formencode

14 IntegerField, validators

15 from wtforms.validators import ValidationError

16 from tornado import escape

17 from tornado.options import options

proxy.py (https://github.com/dropbox/merou.git) Python · 144 lines

11 from sshpubkeys import SSHKey

12 from ssl import SSLContext

13 from sqlalchemy.orm import Session

14 from tornado.httpserver import HTTPRequest

tranx-py2.yml (https://github.com/pcyin/tranX.git) YAML · 123 lines

84 - testpath

85 - tk

86 - tornado

87 - traitlets

88 - wcwidth

112 - pyyaml

113 - records

114 - sqlalchemy

115 - tablib

116 - tabulate

__init__.py (https://github.com/uber-common/opentracing-python-instrumentation.git) Python · 133 lines

42 from . import psycopg2

43 from . import strict_redis

44 from . import sqlalchemy

45 from . import tornado_http

53 psycopg2.install_patches()

54 strict_redis.install_patches()

55 sqlalchemy.install_patches()

56 tornado_http.install_patches()

Makefile (https://github.com/freebsd/freebsd-ports.git) Makefile · 25 lines

13

14 RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}psycopg2>0:databases/py-psycopg2@${PY_FLAVOR} \

15 ${PYTHON_PKGNAMEPREFIX}sqlalchemy10>=1.0:databases/py-sqlalchemy10@${PY_FLAVOR} \

16 ${PYTHON_PKGNAMEPREFIX}tornado>=2.0:www/py-tornado@${PY_FLAVOR}

__init__.py (https://github.com/cliqz-oss/browser-f.git) Python · 183 lines

62 "sentry_sdk.integrations.rq.RqIntegration",

63 "sentry_sdk.integrations.aiohttp.AioHttpIntegration",

64 "sentry_sdk.integrations.tornado.TornadoIntegration",

65 "sentry_sdk.integrations.sqlalchemy.SqlalchemyIntegration",

run_server.py (https://gitlab.com/lotaku/tornado_jinja.git) Python · 69 lines

6 from july.web import init_options, run_server, JulyHandler

7 import motor

8 import tornado

9 from tornado.options import options

29 # reset_option('locale_path', os.path.join(PROJDIR, 'locale'))

30 #todo ?

31 reset_option('sqlalchemy_kwargs', {}, type=dict)

32

33 def create_application():

64 init_options()

65 parse_config_file(os.path.join(PROJDIR, 'etc/server.conf'))

66 tornado.options.parse_command_line()

67 application = create_application()

68

test_request_handlers.py (https://github.com/siddhantgoel/tornado-sqlalchemy.git) Python · 94 lines

1 from http import HTTPStatus

2

3 from tornado.gen import coroutine

4 from tornado.testing import AsyncHTTPTestCase

5 from tornado.web import Application, RequestHandler

6

7 from tornado_sqlalchemy import SessionMixin, as_future

8

9 from ._common import BaseTestCase, User, mysql_url, db

requirements.in (https://github.com/python/performance.git) Autoconf · 33 lines

16 Genshi # bm_genshi

17 Mako # bm_mako

18 SQLAlchemy # bm_sqlalchemy_declarative

19 # FIXME: reenable hg_startup

20 # mercurial # bm_hg_startup

22 pyaes # bm_crypto_pyaes

23 sympy # bm_sympy

24 tornado # bm_tornado_http

25

26

setup.py (https://github.com/Nextdoor/ndscheduler.git) Python · 91 lines

82 install_requires=[

83 'APScheduler >= 3.0.0',

84 'SQLAlchemy >= 1.0.0',

85 'future >= 0.15.2',

86 'tornado < 6',

base.py (https://github.com/GuozhuHe/webspider.git) Python · 205 lines

3 import logging

4

5 from sqlalchemy import MetaData, inspect, func, text

6 from sqlalchemy.ext.declarative import declarative_base

7 from tornado.util import ObjectDict

8

9 from webspider.utils import sql

42

43 def dict(self):

44 """sqlalchemy object -> dict"""

45 columns = self.__table__.columns.keys()

46 return ObjectDict((column, getattr(self, column)) for column in columns)

README.md (https://github.com/quangIO/FrameworkBenchmarks.git) Markdown · 46 lines

14 ## Description

15

16 Flask + Flask-SQLAlchemy

17

18 ### Database

23

24 * gunicorn+meinheld on CPython

25 * Tornado on PyPy

26

27 ## Test URLs

generate_envs.py (https://github.com/MolSSI/QCFractal.git) Python · 146 lines

23 - pydantic >=1.4.0

24 - requests

25 - tornado

26

27 # Security dependencies

33 - psycopg2 >=2.7

34 - postgresql

35 - sqlalchemy >=1.3

36

37 # QCPortal dependencies

index.rst (https://github.com/aio-libs/aiomysql.git) ReStructuredText · 141 lines

10 .. _asyncio: http://docs.python.org/3.5/library/asyncio.html

11 .. _aiopg: https://github.com/aio-libs/aiopg

12 .. _Tornado-MySQL: https://github.com/PyMySQL/Tornado-MySQL

13 .. _aio-libs: https://github.com/aio-libs

14

21 Internally **aiomysql** is copy of PyMySQL, underlying io calls switched

22 to async, basically ``await`` and ``async def coroutine`` added in

23 proper places. :term:`sqlalchemy` support ported from aiopg_.

24

25

84

85 :mod:`aiomysql.sa` module is **optional** and requires

86 :term:`sqlalchemy`. You can install *sqlalchemy* by running::

87

88 pip3 install sqlalchemy

log.py (https://github.com/andrewcooke/choochoo.git) Python · 68 lines

25 'matplotlib': DEBUG,

26 'sentinelsat': DEBUG,

27 'sqlalchemy': WARNING,

28 'tornado': DEBUG,

Dockerfile (https://github.com/keylime/keylime.git) Dockerfile · 68 lines

46 python3-requests \

47 python3-setuptools \

48 python3-sqlalchemy \

49 python3-tornado \

install.rst (https://github.com/dask/dask.git) ReStructuredText · 140 lines

32 You can also install only the Dask library. Modules like ``dask.array``,

33 ``dask.dataframe``, ``dask.delayed``, or ``dask.distributed`` won't work until you also install NumPy,

34 Pandas, Toolz, or Tornado, respectively. This is common for downstream library

35 maintainers::

36

47 We have these options so that users of the lightweight core Dask scheduler

48 aren't required to download the more exotic dependencies of the collections

49 (Numpy, Pandas, Tornado, etc.).

50

51

115 | s3fs | >=0.4.0 | Reading from Amazon S3 |

116 +---------------+----------+--------------------------------------------------------------+

117 | sqlalchemy | | Writing and reading from SQL databases |

118 +---------------+----------+--------------------------------------------------------------+

119 | cytoolz/toolz | >=0.8.2 | Utility functions for iterators, functions, and dictionaries |

Slides.js (https://bitbucket.org/benluo/shlug_slides_201205) JavaScript · 113 lines

17 {content:"Enyo 简介"},

18 {content:"Python Web 框架选型"},

19 {content:"Enyo + Zerkzeug + SQLAlchemy 框架"},

20 {content:"问答"}

21 ]

88 {tag: "a href='http://www.pylonsproject.org/projects'", content:"Pyride -- 轻量级 Python Web 框架,Zope 血统"},

89 {tag: 'br'},

90 {tag: "a href='http://http://www.tornadoweb.org/'", content:"Tornado -- 从 FaceBook 来的 Python Web 框架"},

91 {tag: 'br'},

92 {tag: "a href='http://Zerkzeug.pocoo.org'", content:"Zerkzeug -- Flask 的底层库"},

93 {tag: 'br'},

94 {tag: "a href='http://http://www.sqlalchemy.org/'", content:"SQLAlchemy -- Python 中最流行的 ORM 库"}

95 ]

96 },

UsuarioViews.py (https://hg.codeplex.com/hackathon) Python · 116 lines

76 import mmap

77 import transaction

78 from sqlalchemy.orm import undefer

79 from pyramid.httpexceptions import HTTPFound

80

INSTALL.sh (https://github.com/hisaki/nova-scripts.git) Shell · 141 lines

45 echo 'tornado-1.1'

46 wget http://github.com/downloads/facebook/tornado/tornado-1.1.tar.gz

47 echo 'gflags'

48 wget http://google-gflags.googlecode.com/files/gflags-1.3.tar.gz

53 echo 'python-sqlalchemy'

54 wget http://downloads.sourceforge.net/project/sqlalchemy/sqlalchemy/0.6.5/SQLAlchemy-0.6.5.tar.gz

55 popd

56

57 #echo "- Manual Install for python-redis, tornado, gflags and python-gflags" >> $TODO_FILE

58 echo "- Manual Install for tornado, gflags, python-gflags,

59 python-eventlet and python-sqlalchemy from $TEMP_DIR

60 If you use Ubuntu 10.10, you can install with apt-get" >> $TODO_FILE

61

CHANGELOG.rst (https://github.com/siddhantgoel/tornado-sqlalchemy.git) ReStructuredText · 82 lines

7

8 1. Drop :code:`session_factory` and :code:`make_session_factory` in favor of

9 the new :code:`SQLAlchemy` instance

10 2. Drop :code:`declarative_base` in favor of the new :code:`SQLAlchemy.Model`

58 v0.2.2

59 ------

60 - Support SQLAlchemy's :code:`use_native_unicode` argument

61 - Remove unused code

62 - Improve documentation

80

81 .. _@dingyaguang117: https://github.com/dingyaguang117

82 .. _UPGRADING.rst: https://github.com/siddhantgoel/tornado-sqlalchemy/blob/master/UPGRADING.rst

83

index.rst (https://github.com/DataDog/dd-trace-py.git) ReStructuredText · 158 lines

119 | :ref:`sanic` | >= 19.6.0 | Yes [4]_ |

120 +--------------------------------------------------+---------------+----------------+

121 | :ref:`sqlalchemy` | >= 1.0 | No |

122 +--------------------------------------------------+---------------+----------------+

123 | :ref:`tornado` | >= 4.0 | No |

application.py (https://github.com/ss1917/ops_sdk.git) Python · 73 lines

8

9 from shortuuid import uuid

10 from tornado import httpserver, ioloop

11 from tornado import options as tnd_options

12 from tornado.options import options, define

13 from tornado.web import Application as tornadoApp

14 from tornado.web import RequestHandler

18 define("addr", default='0.0.0.0', help="run on the given ip address", type=str)

19 define("port", default=8000, help="run on the given port", type=int)

20 define("progid", default=str(uuid()), help="tornado progress id", type=str)

21

22 urls_meta_list = []

23

24

25 class Application(tornadoApp):

26 """ 定制 Tornado Application 集成日志、sqlalchemy 等功能 """

README.rst (https://github.com/agronholm/apscheduler.git) ReStructuredText · 76 lines

32

33 * Memory

34 * `SQLAlchemy <http://www.sqlalchemy.org/>`_ (any RDBMS supported by SQLAlchemy works)

35 * `MongoDB <http://www.mongodb.org/>`_

36 * `Redis <http://redis.io/>`_

42 * `asyncio <http://docs.python.org/3.4/library/asyncio.html>`_ (:pep:`3156`)

43 * `gevent <http://www.gevent.org/>`_

44 * `Tornado <http://www.tornadoweb.org/>`_

45 * `Twisted <http://twistedmatrix.com/>`_

46

base.py (https://github.com/dropbox/merou.git) Python · 225 lines

7 from sshpubkeys import SSHKey

8 from ssl import SSLContext

9 from sqlalchemy.orm import Session

10 from tornado.httpserver import HTTPRequest

131

132 Args:

133 request: The request being handled (None for non-Tornado exceptions)

134 status: The response status (None for non-Tornado exceptions)

165 status: the response status of the request (e.g., 200, 404, etc.)

166 duration_ms: the request processing latency

167 request: the Tornado request that was handled

168 """

169 pass

index.md (https://github.com/encode/databases.git) Markdown · 104 lines

12 Databases gives you simple asyncio support for a range of databases.

13

14 It allows you to make queries using the powerful [SQLAlchemy Core][sqlalchemy-core]

15 expression language, and provides support for PostgreSQL, MySQL, and SQLite.

16

17 Databases is suitable for integrating against any async Web framework, such as [Starlette][starlette],

18 [Sanic][sanic], [Responder][responder], [Quart][quart], [aiohttp][aiohttp], [Tornado][tornado], or [FastAPI][fastapi].

19

20 **Community**: [https://discuss.encode.io/c/databases](https://discuss.encode.io/c/databases)

101 [quart]: https://gitlab.com/pgjones/quart

102 [aiohttp]: https://github.com/aio-libs/aiohttp

103 [tornado]: https://github.com/tornadoweb/tornado

104 [fastapi]: https://github.com/tiangolo/fastapi

105

fpage.py (https://github.com/fy0/fpage.git) Python · 140 lines

15

16 def help():

17 print('FPage v1.2 - tornado classic project generator(cli)')

18 print('repo: github.com/fy0/fpage\n')

19 print('Usage:')

31 if tmpl_engine == 'mako':

32 shutil.rmtree(join(project_dir, 'templates_jinja2'))

33 shutil.rmtree(join(project_dir, 'templates_tornado'))

34 elif tmpl_engine == 'jinja2':

35 shutil.rmtree(join(project_dir, 'templates'))

36 shutil.rmtree(join(project_dir, 'templates_tornado'))

37 shutil.move(join(project_dir, 'templates_jinja2'), join(project_dir, 'templates'))

38 elif tmpl_engine == 'tornado':

README.md (https://github.com/mlrun/mlrun.git) Markdown · 116 lines

100 six 1.14.0

101 smmap 3.0.1

102 SQLAlchemy 1.3.15

103 strip-hints 0.1.8

104 tabulate 0.8.3

105 terminado 0.8.3

106 testpath 0.4.4

107 tornado 6.0.4

108 traitlets 4.3.3

109 urllib3 1.24.3

setup.py (https://github.com/cliqz-oss/browser-f.git) Python · 58 lines

35 "rq": ["0.6"],

36 "aiohttp": ["aiohttp>=3.5"],

37 "tornado": ["tornado>=5"],

38 "sqlalchemy": ["sqlalchemy>=1.2"],

setup.py (https://github.com/MolSSI/QCFractal.git) Python · 79 lines

28 "numpy >=1.17",

29 "msgpack >=0.6.1",

30 "tornado",

31 "requests",

32 "pyyaml >=5.1",

36 "cryptography",

37 # Storage dependencies

38 "sqlalchemy >=1.3,<1.4",

39 "alembic",

40 "psycopg2 >=2.7",

deeplearningproject_environment.yml (https://github.com/Spandan-Madan/DeepLearningProject.git) YAML · 100 lines

39 - tk=8.5.18=0

40 - torchvision=0.1.8=py27_0

41 - tornado=4.5.1=py27_0

42 - traitlets=4.3.2=py27_0

43 - wcwidth=0.1.7=py27_0

86 - sklearn==0.0

87 - smart-open==1.5.3

88 - sqlalchemy==1.1.11

89 - sqlalchemy-migrate==0.11.0

conda_gpu.yaml (https://github.com/miguelgfierro/sciblog_support.git) YAML · 43 lines

22 - scipy==1.1.0

23 - scikit-learn==0.19.1

24 - tornado==4.5.3

25 - jupyter==1.0.0

26 # In case you want to install LigthGBM with GPU, make sure you add the correct path

30 - asyncio==3.4.3

31 - aiohttp==2.0.3

32 - SQLAlchemy==1.2.4

33 # For websockets, add flask-socketio, gevent-websocket, wsaccel and ujson

34 - flask-socketio>=3.0.1

SupportPlan.md (https://github.com/naver/pinpoint-c-agent.git) Markdown · 29 lines

6 django | ✔ | https://github.com/django/django/<br>star:50.8k

7 flask | ✔ | https://github.com/pallets/flask<br>star:51.3k

8 tornado| ✔ | https://github.com/tornadoweb/tornado<br>star:19.3k

9 aiohttp| todo |https://github.com/aio-libs/aiohttp<br>star:10k

10 bottle| todo | https://github.com/bottlepy/bottle<br>star:6.9k

22 PyMongo| todo | -

23 UrlLib| todo | -

24 SQLAlchemy| todo | -

25 Celery| todo | -

26 Scrapy| todo | -

asset_operational_audit_handler.py (https://github.com/opendevops-cn/codo-cmdb.git) Python · 67 lines

8

9 import json

10 from sqlalchemy import or_

11 from libs.base_handler import BaseHandler

12 from models.server import model_to_dict, AssetOperationalAudit

13 from websdk.db_context import DBContext

14 import tornado.web

15 import time, datetime

16 from dateutil.relativedelta import relativedelta

17

18

19 class AssetOperationalAuditHandler(tornado.web.RequestHandler):

20 def get(self, *args, **kwargs):

21 id = self.get_argument('id', default=None, strip=True)

map-DevLang-Python.md (https://github.com/TeamStuQ/skill-map.git) Markdown · 156 lines

74 - Bottle

75 * RESTful

76 - Tornado

77 * RESTful

78 * gevent

88 * mock

89 - DB

90 * SQLAlchemy

91 - PEP8

92 * PyLint

app.py (https://github.com/klen/py-frameworks-bench.git) Python · 103 lines

6 import logging

7

8 from tornado import web, gen, httpclient, httpserver, ioloop, template

9

10 logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)

28

29

30 from sqlalchemy import create_engine, schema, Column

31 from sqlalchemy.sql.expression import func

32 from sqlalchemy.types import Integer, String

33 from sqlalchemy.orm import sessionmaker

34 from sqlalchemy.ext.declarative import declarative_base

35

36 engine = create_engine('postgres://benchmark:benchmark@%s:5432/benchmark' % HOST, pool_size=10)

G.py (https://github.com/xiaowan/pyadmin.git) Python · 56 lines

1 from sqlalchemy.orm import scoped_session

2 from mapper.init import UnitymobSession

3 from conf import conf

6 from library.RPCClient import RPCClient

7 from library.Utils import Utils

8 from tornado.ioloop import IOLoop

9

10

__init__.py (https://github.com/andrewcooke/choochoo.git) Python · 42 lines

20 def setUp(self):

21 configure_log(PROGNAME, '/tmp/ch2-test.log', verbosity=5, levels={

22 'sqlalchemy': WARNING,

23 'matplotlib': INFO,

24 'bokeh': DEBUG,

25 'tornado': INFO,

26 'sentinelsat': DEBUG,

27 'werkzeug': DEBUG,

conda.yaml (https://github.com/miguelgfierro/sciblog_support.git) YAML · 40 lines

23 - scipy==1.1.0

24 - scikit-learn==0.19.1

25 - tornado==4.5.3

26 - jupyter==1.0.0

27 - lightgbm==2.1.1

30 - asyncio==3.4.3

31 - aiohttp==2.0.3

32 - SQLAlchemy==1.2.4

33 # For websockets, add flask-socketio, gevent-websocket, wsaccel and ujson

34 - flask-socketio>=3.0.1

managerbase.py (https://github.com/quantopian/pgcontents.git) Python · 101 lines

3 """

4 from getpass import getuser

5 from sqlalchemy import (

6 create_engine,

7 )

8 from sqlalchemy.engine.base import Engine

9 from tornado.web import HTTPError

DESCRIPTION.rst (https://bitbucket.org/lina_wang_veeva/vone.git) ReStructuredText · 75 lines

27

28 * Memory

29 * `SQLAlchemy <http://www.sqlalchemy.org/>`_ (any RDBMS supported by SQLAlchemy works)

30 * `MongoDB <http://www.mongodb.org/>`_

31 * `Redis <http://redis.io/>`_

37 * `asyncio <http://docs.python.org/3.4/library/asyncio.html>`_ (:pep:`3156`)

38 * `gevent <http://www.gevent.org/>`_

39 * `Tornado <http://www.tornadoweb.org/>`_

40 * `Twisted <http://twistedmatrix.com/>`_

41 * `Qt <http://qt-project.org/>`_ (using either `PyQt <http://www.riverbankcomputing.com/software/pyqt/intro>`_

setup.py (https://github.com/dalibo/temboard.git) Python · 85 lines

15 __version__ = __version__.replace('+', '.')

16

17 # Accept Tornado 5.X on Python 2.7.9+

18 BLEEDING_EDGE_TORNADO = '4.5' if sys.version_info < (2, 7, 9) else '6'

36 'sqlalchemy>=0.9.8',

37 'tornado>=3.2,<' + BLEEDING_EDGE_TORNADO,

38 ],

39 include_package_data=True,

README.md (https://github.com/encode/databases.git) Markdown · 106 lines

12 Databases gives you simple asyncio support for a range of databases.

13

14 It allows you to make queries using the powerful [SQLAlchemy Core][sqlalchemy-core]

15 expression language, and provides support for PostgreSQL, MySQL, and SQLite.

16

17 Databases is suitable for integrating against any async Web framework, such as [Starlette][starlette],

18 [Sanic][sanic], [Responder][responder], [Quart][quart], [aiohttp][aiohttp], [Tornado][tornado], or [FastAPI][fastapi].

19

20 **Documentation**: [https://www.encode.io/databases/](https://www.encode.io/databases/)

103 [quart]: https://gitlab.com/pgjones/quart

104 [aiohttp]: https://github.com/aio-libs/aiohttp

105 [tornado]: https://github.com/tornadoweb/tornado

106 [fastapi]: https://github.com/tiangolo/fastapi

107

test_session.py (https://github.com/siddhantgoel/tornado-sqlalchemy.git) Python · 59 lines

4 from tornado.testing import AsyncTestCase, gen_test

5 from tornado_sqlalchemy import as_future, set_max_workers

6

7 from ._common import db, User, mysql_url

root.py (https://github.com/LamCiuLoeng/BookStore.git) Python · 132 lines

11 import urllib

12 import traceback

13 import tornado

14

15

16 from sqlalchemy.sql import and_

17 from sqlalchemy.orm.exc import NoResultFound

environment.py-3.5.frozen.yml (https://github.com/jupyter/repo2docker.git) YAML · 86 lines

60 - testpath=0.3.1=py35_1

61 - tk=8.6.9=ha92aebf_0

62 - tornado=5.1.1=py35h470a237_0

63 - traitlets=4.3.2=py35_0

64 - wcwidth=0.1.7=py_1

82 - python-oauth2==1.1.0

83 - requests==2.20.1

84 - sqlalchemy==1.2.14

85 - urllib3==1.24.1

86 prefix: /opt/conda/envs/r2d

adapter_parsl.yaml (https://github.com/MolSSI/QCFractal.git) YAML · 48 lines

12 - pydantic >=1.4.0

13 - requests

14 - tornado

15

16 # Security dependencies

22 - psycopg2 >=2.7

23 - postgresql

24 - sqlalchemy >=1.3,<1.4

25

26 # QCPortal dependencies