{ "info": { "author": "['snower']", "author_email": "sujian199@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "torpeewee\n=========\n\n|Build Status|\n\nTornado and asyncio asynchronous ORM by peewee\n\nAbout\n=====\n\ntorpeewee - Tornado and asyncio asynchronous ORM by peewee.\n\nInstallation\n============\n\n::\n\n pip install torpeewee\n\nExamples\n========\n\n.. code:: python\n\n # -*- coding: utf-8 -*-\n # 16/7/7\n # create by: snower\n\n import datetime\n import asyncio\n from torpeewee import *\n\n db = MySQLDatabase(\"test\", host=\"127.0.0.1\", port=3306, user=\"root\", passwd=\"123456\")\n\n class BaseModel(Model):\n class Meta:\n database = db\n\n class Test(BaseModel):\n id = IntegerField(primary_key= True)\n data = CharField(max_length=64, null=False)\n count = IntegerField(default=0)\n created_at = DateTimeField()\n updated_at = DateTimeField()\n\n @db.transaction()\n async def run_transaction(transaction):\n async for i in Test.use(transaction).select().order_by(Test.id.desc()).limit(2):\n print(i.id, i.data)\n\n print(\"\")\n t = await Test.use(transaction).create(data=\"test\", created_at=datetime.datetime.now(),\n updated_at=datetime.datetime.now())\n print(t.id, t.data)\n\n async for i in Test.select().order_by(Test.id.desc()).limit(2):\n print(i.id, i.data)\n\n print(\"\")\n for i in (await Test.use(transaction).select().order_by(Test.id.desc()).limit(2)):\n print(i.id, i.data)\n\n async def run():\n t = await Test.select().where(Test.id == 5).first()\n print(t)\n\n c = await Test.select().where(Test.id > 5).count()\n print(c)\n\n c = await Test.select().where(Test.id > 5).group_by(Test.data).count()\n print(c)\n\n for i in (await Test.select().where(Test.id > 5).where(Test.id<=10)):\n print(i.id, i.data)\n\n async for i in Test.select().order_by(Test.id.desc()).limit(2):\n print(i.id, i.data)\n t = await Test.create(data = \"test\", created_at=datetime.datetime.now(), updated_at=datetime.datetime.now())\n print(t.id, t.data)\n async for i in Test.select().order_by(Test.id.desc()).limit(2):\n print(i.id, i.data)\n\n print(\"\")\n print(\"\")\n\n t = await Test.select().order_by(Test.id.desc()).limit(1)[0]\n print(t.id, t.data, t.count)\n t.count += 1\n await t.save()\n t = await Test.select().order_by(Test.id.desc()).limit(1)[0]\n print(t.id, t.data, t.count)\n\n print(\"\")\n print(\"\")\n\n async with await db.transaction() as transaction:\n t = await Test.use(transaction).select().order_by(Test.id.desc()).limit(1)[0]\n print(t.id, t.data, t.count)\n t.count += 1\n await t.use(transaction).save()\n\n async for i in Test.use(transaction).select().order_by(Test.id.desc()).limit(2):\n print(i.id, i.data)\n\n print(\"\")\n t = await Test.use(transaction).create(data=\"test\", created_at=datetime.datetime.now(), updated_at=datetime.datetime.now())\n print(t.id, t.data)\n\n async for i in Test.select().order_by(Test.id.desc()).limit(2):\n print(i.id, i.data)\n\n print(\"\")\n for i in (await Test.use(transaction).select().order_by(Test.id.desc()).limit(2)):\n print(i.id, i.data)\n\n print(\"\")\n print(\"\")\n\n await run_transaction()\n\n loop = asyncio.get_event_loop()\n loop.run_until_complete(run())\n\nLicense\n=======\n\ntorpeewee uses the MIT license, see LICENSE file for the details.\n\n.. |Build Status| image:: https://travis-ci.org/snower/torpeewee.svg?branch=master\n :target: https://travis-ci.org/snower/torpeewee", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/snower/torpeewee", "keywords": "tornado", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "torpeewee", "package_url": "https://pypi.org/project/torpeewee/", "platform": "", "project_url": "https://pypi.org/project/torpeewee/", "project_urls": { "Homepage": "https://github.com/snower/torpeewee" }, "release_url": "https://pypi.org/project/torpeewee/1.0.1/", "requires_dist": null, "requires_python": "", "summary": "Tornado and asyncio asynchronous ORM by peewee", "version": "1.0.1" }, "last_serial": 3886599, "releases": { "0.0.1": [], "0.0.3": [ { "comment_text": "", "digests": { "md5": "505d448ba087f00cab6593946bef3300", "sha256": "fc67bc43f15853ce50e5249228c33ed8f6656cb986bc99a131166790ca397b46" }, "downloads": -1, "filename": "torpeewee-0.0.3.tar.gz", "has_sig": false, "md5_digest": "505d448ba087f00cab6593946bef3300", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10864, "upload_time": "2016-11-07T08:10:49", "url": "https://files.pythonhosted.org/packages/6d/78/050043680e9d27b8373c7abd7b7b14cd826fbbc00d5a04e9a38fdaaeff81/torpeewee-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "12c1cdf8e0d4586ed05737a8199f9a33", "sha256": "128cf8835d95907b1660b375d6f52a890c67321788573d99225d6bb96d0538bf" }, "downloads": -1, "filename": "torpeewee-0.0.4.tar.gz", "has_sig": false, "md5_digest": "12c1cdf8e0d4586ed05737a8199f9a33", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11222, "upload_time": "2017-01-17T05:12:14", "url": "https://files.pythonhosted.org/packages/51/d1/2dc0fc721e09d4ba7320acb69c5360806d483ae37ad8afc51f16073b8460/torpeewee-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "4afb43d48cbdf64cc1423bb48d85e676", "sha256": "3d562292cc274dac16dd4c3d00ce06714429e830125f0c51377f45128da7d307" }, "downloads": -1, "filename": "torpeewee-0.0.5.tar.gz", "has_sig": false, "md5_digest": "4afb43d48cbdf64cc1423bb48d85e676", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11337, "upload_time": "2017-03-23T06:54:31", "url": "https://files.pythonhosted.org/packages/dd/d0/26f3527631faf114ba90b2e1245dadbbd697fcff06cdbac5a28e758604d2/torpeewee-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "046dd976b3dc4f0c32e797b44e1a9324", "sha256": "2a868f0b05c9dc2ab6137e2b861bc95fb3373a4813269d52e54bbdb972484fdf" }, "downloads": -1, "filename": "torpeewee-0.0.6.tar.gz", "has_sig": false, "md5_digest": "046dd976b3dc4f0c32e797b44e1a9324", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11398, "upload_time": "2018-03-13T08:19:05", "url": "https://files.pythonhosted.org/packages/dd/ec/316a6b888b13b4fa03035b1a543f4f37ec8a6b1e0cb84b2516f0c58345c5/torpeewee-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "f2b5aee153636337018d84dccdb824f5", "sha256": "af7a26e1d8eaab0da1bd16d9396e51408ab14e149f7edd450a411df49c2ec388" }, "downloads": -1, "filename": "torpeewee-0.0.7.tar.gz", "has_sig": false, "md5_digest": "f2b5aee153636337018d84dccdb824f5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11477, "upload_time": "2018-04-28T09:48:02", "url": "https://files.pythonhosted.org/packages/1d/13/390a4664e9781a75f4a176c5ce911530a740e9f079c530a6e71d81cd57ce/torpeewee-0.0.7.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "19b156e53c43d93c06d677d4d92aa5a8", "sha256": "b60a50f6a429d30b7d75c3bbda267bbdf2596e52ebe76ce1f72246671ebb01e5" }, "downloads": -1, "filename": "torpeewee-1.0.1.tar.gz", "has_sig": false, "md5_digest": "19b156e53c43d93c06d677d4d92aa5a8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10917, "upload_time": "2018-05-22T07:28:49", "url": "https://files.pythonhosted.org/packages/69/91/8b6e4963482a0e84aa9e9a25e167aa1e0ab6262ab0b3e1cee02f74552e34/torpeewee-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "19b156e53c43d93c06d677d4d92aa5a8", "sha256": "b60a50f6a429d30b7d75c3bbda267bbdf2596e52ebe76ce1f72246671ebb01e5" }, "downloads": -1, "filename": "torpeewee-1.0.1.tar.gz", "has_sig": false, "md5_digest": "19b156e53c43d93c06d677d4d92aa5a8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10917, "upload_time": "2018-05-22T07:28:49", "url": "https://files.pythonhosted.org/packages/69/91/8b6e4963482a0e84aa9e9a25e167aa1e0ab6262ab0b3e1cee02f74552e34/torpeewee-1.0.1.tar.gz" } ] }