{ "info": { "author": "NAKAMORI Ryosuke", "author_email": "me@tpdn.kim", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Database :: Front-Ends" ], "description": "\n===========\nRetort\n===========\n\nRetort is a schema migration tool for\n`SQLAlchemy `__, compares DB schema against\ntable metadata, and updates DB schema according to this.\n\nIt depends on the `Alembic\nautogenerate `__.\n\nRequirements\n------------\n\nRetort works with\n\n- Python 3.3+\n- SQLAlchemy\n- Alembic\n- autopep8\n\nInstallation\n------------\n\nvia pip\n#######\n\n.. code:: bash\n\n $ pip install retort\n\nvia setup.py\n############\n\n.. code:: bash\n\n $ python setup.py install\n\nBasic Usage Examples\n---------------------\n\nGenerate config file (retort\\_config.py)\n\n.. code:: bash\n\n (venv) tpdn@example:~/retort_example$ retort init\n Create retort_conf.py.\n\nEdit config file\n\n.. code:: python\n\n # retort_config.py\n from model import user\n\n TARGETS = [\n {\n 'engine': user.engine, #sqlalchemy engine\n 'metadata': user.Base.metadata #sqlalchemy metadata\n },\n ]\n\n.. code:: python\n\n # model/user.py\n from sqlalchemy import Column, Integer, String, create_engine\n from sqlalchemy.ext.declarative import declarative_base\n\n\n engine = create_engine('mysql+pymysql://foobar:abcdef@localhost/retort_test_db')\n Base = declarative_base()\n\n\n class User(Base):\n __tablename__ = 'users'\n\n id = Column(Integer, primary_key=True)\n name = Column(String(255))\n fullname = Column(String(255))\n xyz = Column(String(255))\n\nApply\n\n.. code:: bash\n\n (venv) tpdn@example:~/retort_example$ retort apply\n ====================\n url: mysql+pymysql://foobar:abcdef@localhost/retort_test_db\n logging_name: None\n ====================\n op.create_table('users',\n sa.Column('id', sa.Integer(), nullable=False),\n sa.Column('name', sa.String(length=255), nullable=True),\n sa.Column('fullname', sa.String(length=255), nullable=True),\n sa.Column('xyz', sa.String(length=255), nullable=True),\n sa.PrimaryKeyConstraint('id')\n )\n\n Do you really want to apply this? [y/n]: y\n\n Applying migration......\n ====================\n url: mysql+pymysql://foobar:abcdef@localhost/retort_test_db\n logging_name: None\n ====================\n op.create_table('users',\n sa.Column('id', sa.Integer(), nullable=False),\n sa.Column('name', sa.String(length=255), nullable=True),\n sa.Column('fullname', sa.String(length=255), nullable=True),\n sa.Column('xyz', sa.String(length=255), nullable=True),\n sa.PrimaryKeyConstraint('id')\n )\n\n ---> Processing time: 0.0894(sec)\n Complete!\n\nUpdate model(remove xyz column)\n\n.. code:: python\n\n # model/user.py\n from sqlalchemy import Column, Integer, String, create_engine\n from sqlalchemy.ext.declarative import declarative_base\n\n\n engine = create_engine('mysql+pymysql://foobar:abcdef@localhost/retort_test_db')\n Base = declarative_base()\n\n\n class User(Base):\n __tablename__ = 'users'\n\n id = Column(Integer, primary_key=True)\n name = Column(String(255))\n fullname = Column(String(255))\n # xyz = Column(String(255))\n\nApply with --sql option\n\n.. code:: bash\n\n (venv) tpdn@example:~/retort_example$ retort apply --sql\n ====================\n url: mysql+pymysql://foobar:abcdef@localhost/retort_test_db\n logging_name: None\n ====================\n ALTER TABLE users DROP COLUMN xyz;\n\n Do you really want to apply this? [y/n]: y\n\n Applying migration......\n ====================\n url: mysql+pymysql://foobar:abcdef@localhost/retort_test_db\n logging_name: None\n ====================\n ALTER TABLE users DROP COLUMN xyz;\n\n ---> Processing time: 0.0745(sec)\n Complete!\n\nCommands and Options\n--------------------\n\n::\n\n retort init\n\n retort apply\n --sql # print sql mode\n --dry-run # dry run (no database update)\n --yes # skip confirmation\n --without-drop # without drop operations (DROP TABLE, DROP COLUMN, DROP INDEX, DROP CONSTRAINT)\n\n retort print_operations\n --sql\n --without-drop\n\nAuthor\n-------\n\n**NAKAMORI Ryosuke** - https://github.com/tpdn\n\nLicence\n-------\n\nBSD License (2-Clause)\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/tpdn/retort", "keywords": "SQLAlchemy migrations", "license": "BSD License (2-Clause)", "maintainer": "", "maintainer_email": "", "name": "retort", "package_url": "https://pypi.org/project/retort/", "platform": "", "project_url": "https://pypi.org/project/retort/", "project_urls": { "Homepage": "https://github.com/tpdn/retort" }, "release_url": "https://pypi.org/project/retort/0.1.0/", "requires_dist": [ "SQLAlchemy", "alembic", "autopep8" ], "requires_python": ">=3.3", "summary": "Retort is a schema migration tool for SQLAlchemy.", "version": "0.1.0" }, "last_serial": 3231771, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "93cbde2eff4d6679df7d75fd19748518", "sha256": "19e4fb928d573c69067354c96f3a139b0c5f52da98907dd5bc5012d7c3aa0158" }, "downloads": -1, "filename": "retort-0.1.0-py3.5.egg", "has_sig": false, "md5_digest": "93cbde2eff4d6679df7d75fd19748518", "packagetype": "bdist_egg", "python_version": "3.5", "requires_python": ">=3.3", "size": 12258, "upload_time": "2017-10-07T00:05:00", "url": "https://files.pythonhosted.org/packages/22/5b/3629f3126e221838f46be56e2f2b35c794252ec41ff617d619ff541620b0/retort-0.1.0-py3.5.egg" }, { "comment_text": "", "digests": { "md5": "2cc22a362c61e95b0bf7f8eca2207a9b", "sha256": "d280ec33c8f7421ea0cb1870b92e3f369b16639fa0188ca0bca297cb883616b6" }, "downloads": -1, "filename": "retort-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "2cc22a362c61e95b0bf7f8eca2207a9b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.3", "size": 8596, "upload_time": "2017-10-07T00:04:58", "url": "https://files.pythonhosted.org/packages/22/f3/32f8b819a6bc50a51ac999545165e45d794d876273137528b43e259a71ea/retort-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a5275ff50067b04df28868bcc7406d56", "sha256": "eba5262f8563b63e114d70ebb60ea4c452ac0c463d85614497080fc975353976" }, "downloads": -1, "filename": "retort-0.1.0.tar.gz", "has_sig": false, "md5_digest": "a5275ff50067b04df28868bcc7406d56", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.3", "size": 8103, "upload_time": "2017-10-07T00:05:02", "url": "https://files.pythonhosted.org/packages/8e/05/b753bef4f254d2511468818397f749e2b4520c76c189633f7933f231c630/retort-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "93cbde2eff4d6679df7d75fd19748518", "sha256": "19e4fb928d573c69067354c96f3a139b0c5f52da98907dd5bc5012d7c3aa0158" }, "downloads": -1, "filename": "retort-0.1.0-py3.5.egg", "has_sig": false, "md5_digest": "93cbde2eff4d6679df7d75fd19748518", "packagetype": "bdist_egg", "python_version": "3.5", "requires_python": ">=3.3", "size": 12258, "upload_time": "2017-10-07T00:05:00", "url": "https://files.pythonhosted.org/packages/22/5b/3629f3126e221838f46be56e2f2b35c794252ec41ff617d619ff541620b0/retort-0.1.0-py3.5.egg" }, { "comment_text": "", "digests": { "md5": "2cc22a362c61e95b0bf7f8eca2207a9b", "sha256": "d280ec33c8f7421ea0cb1870b92e3f369b16639fa0188ca0bca297cb883616b6" }, "downloads": -1, "filename": "retort-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "2cc22a362c61e95b0bf7f8eca2207a9b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.3", "size": 8596, "upload_time": "2017-10-07T00:04:58", "url": "https://files.pythonhosted.org/packages/22/f3/32f8b819a6bc50a51ac999545165e45d794d876273137528b43e259a71ea/retort-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a5275ff50067b04df28868bcc7406d56", "sha256": "eba5262f8563b63e114d70ebb60ea4c452ac0c463d85614497080fc975353976" }, "downloads": -1, "filename": "retort-0.1.0.tar.gz", "has_sig": false, "md5_digest": "a5275ff50067b04df28868bcc7406d56", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.3", "size": 8103, "upload_time": "2017-10-07T00:05:02", "url": "https://files.pythonhosted.org/packages/8e/05/b753bef4f254d2511468818397f749e2b4520c76c189633f7933f231c630/retort-0.1.0.tar.gz" } ] }