{ "info": { "author": "Valeryi Savich", "author_email": "Relrin78@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Natural Language :: Russian", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: Testing", "Topic :: Utilities" ], "description": "# Sanic-PW\n\nA port of the [Flask-PW](https://github.com/klen/flask-pw) package for [Sanic framework](https://github.com/channelcat/sanic).\n\n# Features\n- Configuring Peewee ORM like in Flask with SQLAlchemy\n- Migrate commands (create, rollback, etc.) via:\n - using commands as a part of Sanic-Script\n - click CLI\n- Pre- and post-signals support for saving and deleting\n\n# Requirements\n- Python 3.6+ (older not tested)\n\n# Dependency note\nFor using the 2nd version of Peewee ORM, please use `sanic-pw==0.1.0`.\n\n# Using\n## Installing\nFor installing Sanic-PW use the following command:\n```\npip install sanic-pw\n```\n\n## List of available settings\n| Config parameter | Description | Default value |\n|------------------|-------------|----------------|\n| PEEWEE_DATABASE_URI | A connection URI | `'sqlite:///peewee.sqlite'` |\n| PEEWEE_CONNECTION_PARAMS | Connection parameters for Peewee ORM | `{}` |\n| PEEWEE_MIGRATE_DIR | Path to directory with migrations | `'migrations'` |\n| PEEWEE_MIGRATE_TABLE | Name of database table with migrations | `'migratehistory'` | \n| PEEWEE_MODELS_MODULE | Path to module which contains you applications' Models | `''` |\n| PEEWEE_MODELS_IGNORE | Models which should be ignored in migrations | `[]` |\n| PEEWEE_MODELS_CLASS | Base models class | `` | \n| PEEWEE_MANUAL | Don't connect to db when request starts and close when it ends automatically | `False` | \n| PEEWEE_USE_READ_SLAVES | Use database slaves for reading data when coming `SELECT ...` queries | `True` | \n| PEEWEE_READ_SLAVES | A list of nodes which can be used for reading | `[]` | \n\n## Migrations\nIf you're using the Sanic-Script package, then append a new command to your manager:\n```python\nfrom sanic_pw import Peewee\n\n# ...\napp.db = Peewee(app)\n\nmanager = Manager(app)\nmanager.add_command('db', app.db.manager)\n```\nFor a case when you're prefer to use click it almost the same:\n```python\nfrom sanic_pw import Peewee\n\n# ...\napp.db = Peewee(app)\napp.db.cli() \n```\nAfter it, you can use database `create`, `migrate` or `rollback` commands.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Relrin/sanic-pw", "keywords": "sanic,peewee,migrations,migrate,signals", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "sanic-pw", "package_url": "https://pypi.org/project/sanic-pw/", "platform": "Any", "project_url": "https://pypi.org/project/sanic-pw/", "project_urls": { "Homepage": "https://github.com/Relrin/sanic-pw" }, "release_url": "https://pypi.org/project/sanic-pw/0.2.0/", "requires_dist": [ "peewee (==3.3.4)", "cached-property (==1.4.2)", "peewee-migrate (==1.0.0)" ], "requires_python": "", "summary": "Peewee ORM integration for Sanic framework", "version": "0.2.0" }, "last_serial": 3871340, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "f37febb24b0f266978826ec14cbe38f6", "sha256": "8743393a94e0465fbe9cecde67860d69f197fd2c1a7967eeb86997227889dd85" }, "downloads": -1, "filename": "sanic_pw-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "f37febb24b0f266978826ec14cbe38f6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7890, "upload_time": "2018-02-26T19:34:01", "url": "https://files.pythonhosted.org/packages/18/ad/2132bc16a238be95f051577162ab7ff8a6b1308016f1dbb668323705804a/sanic_pw-0.1.0-py3-none-any.whl" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "e14d9b4ef09e30c539d375b3acb7de16", "sha256": "7d76fa19fe6a2dc1b3908b343a92af234bbbee6ccb2653078ffc4426c3282720" }, "downloads": -1, "filename": "sanic_pw-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "e14d9b4ef09e30c539d375b3acb7de16", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5824, "upload_time": "2018-05-17T07:55:47", "url": "https://files.pythonhosted.org/packages/f3/8d/f136c2e5ccc635dca61ca2a5602d8e21a4b670f088a9c582ce425a11998f/sanic_pw-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "933b72d99bddd5f7887b7a2b0e881fab", "sha256": "7c33c7091970d48549c07abdefa134b1b019df388cc76f76e19215251cdc1146" }, "downloads": -1, "filename": "sanic-pw-0.2.0.tar.gz", "has_sig": false, "md5_digest": "933b72d99bddd5f7887b7a2b0e881fab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5275, "upload_time": "2018-05-17T07:55:49", "url": "https://files.pythonhosted.org/packages/08/99/f5124955f5292e32acfab26e4e59befa989be756d7332c162d70d2ab1168/sanic-pw-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e14d9b4ef09e30c539d375b3acb7de16", "sha256": "7d76fa19fe6a2dc1b3908b343a92af234bbbee6ccb2653078ffc4426c3282720" }, "downloads": -1, "filename": "sanic_pw-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "e14d9b4ef09e30c539d375b3acb7de16", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5824, "upload_time": "2018-05-17T07:55:47", "url": "https://files.pythonhosted.org/packages/f3/8d/f136c2e5ccc635dca61ca2a5602d8e21a4b670f088a9c582ce425a11998f/sanic_pw-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "933b72d99bddd5f7887b7a2b0e881fab", "sha256": "7c33c7091970d48549c07abdefa134b1b019df388cc76f76e19215251cdc1146" }, "downloads": -1, "filename": "sanic-pw-0.2.0.tar.gz", "has_sig": false, "md5_digest": "933b72d99bddd5f7887b7a2b0e881fab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5275, "upload_time": "2018-05-17T07:55:49", "url": "https://files.pythonhosted.org/packages/08/99/f5124955f5292e32acfab26e4e59befa989be756d7332c162d70d2ab1168/sanic-pw-0.2.0.tar.gz" } ] }