{ "info": { "author": "Alex Gr\u00f6nholm", "author_email": "alex.gronholm@nextday.fi", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Topic :: Database", "Topic :: Software Development :: Code Generators" ], "description": "This is a tool that reads the structure of an existing database and generates the appropriate\nSQLAlchemy model code, using the declarative style if possible.\n\nThis tool was written as a replacement for `sqlautocode`_, which was suffering from several issues\n(including, but not limited to, incompatibility with Python 3 and the latest SQLAlchemy version).\n\n.. _sqlautocode: http://code.google.com/p/sqlautocode/\n\n\nFeatures\n========\n\n* Supports SQLAlchemy 0.8.x - 1.3.x\n* Produces declarative code that almost looks like it was hand written\n* Produces `PEP 8`_ compliant code\n* Accurately determines relationships, including many-to-many, one-to-one\n* Automatically detects joined table inheritance\n* Excellent test coverage\n\n.. _PEP 8: http://www.python.org/dev/peps/pep-0008/\n\n\nUsage instructions\n==================\n\nInstallation\n------------\n\nTo install, do::\n\n pip install sqlacodegen\n\n\nExample usage\n-------------\n\nAt the minimum, you have to give sqlacodegen a database URL. The URL is passed directly to\nSQLAlchemy's `create_engine()`_ method so please refer to `SQLAlchemy's documentation`_ for\ninstructions on how to construct a proper URL.\n\nExamples::\n\n sqlacodegen postgresql:///some_local_db\n sqlacodegen mysql+oursql://user:password@localhost/dbname\n sqlacodegen sqlite:///database.db\n\nTo see the full list of options::\n\n sqlacodegen --help\n\n\n.. _create_engine(): http://docs.sqlalchemy.org/en/latest/core/engines.html#sqlalchemy.create_engine\n.. _SQLAlchemy's documentation: http://docs.sqlalchemy.org/en/latest/core/engines.html\n\n\nWhy does it sometimes generate classes and sometimes Tables?\n------------------------------------------------------------\n\nUnless the ``--noclasses`` option is used, sqlacodegen tries to generate declarative model classes\nfrom each table. There are two circumstances in which a ``Table`` is generated instead:\n\n* the table has no primary key constraint (which is required by SQLAlchemy for every model class)\n* the table is an association table between two other tables (see below for the specifics)\n\n\nModel class naming logic\n------------------------\n\nThe table name (which is assumed to be in English) is converted to singular form using the\n\"inflect\" library. Then, every underscore is removed while transforming the next letter to upper\ncase. For example, ``sales_invoices`` becomes ``SalesInvoice``.\n\n\nRelationship detection logic\n----------------------------\n\nRelationships are detected based on existing foreign key constraints as follows:\n\n* **many-to-one**: a foreign key constraint exists on the table\n* **one-to-one**: same as **many-to-one**, but a unique constraint exists on the column(s) involved\n* **many-to-many**: an association table is found to exist between two tables\n\nA table is considered an association table if it satisfies all of the following conditions:\n\n#. has exactly two foreign key constraints\n#. all its columns are involved in said constraints\n\n\nRelationship naming logic\n-------------------------\n\nRelationships are typically named based on the opposite class name. For example, if an ``Employee``\nclass has a column named ``employer`` which has a foreign key to ``Company.id``, the relationship\nis named ``company``.\n\nA special case for single column many-to-one and one-to-one relationships, however, is if the\ncolumn is named like ``employer_id``. Then the relationship is named ``employer`` due to that\n``_id`` suffix.\n\nIf more than one relationship would be created with the same name, the latter ones are appended\nnumeric suffixes, starting from 1.\n\n\nGetting help\n============\n\nIf you have problems or other questions, you can either:\n\n* Ask on the `SQLAlchemy Google group`_, or\n* Ask on the ``#sqlalchemy`` channel on `Freenode IRC`_\n\n.. _SQLAlchemy Google group: http://groups.google.com/group/sqlalchemy\n.. _Freenode IRC: http://freenode.net/irc_servers.shtml\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "sqlalchemy", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "sqlacodegen", "package_url": "https://pypi.org/project/sqlacodegen/", "platform": "", "project_url": "https://pypi.org/project/sqlacodegen/", "project_urls": { "Bug Tracker": "https://github.com/agronholm/sqlacodegen/issues", "Source Code": "https://github.com/agronholm/sqlacodegen" }, "release_url": "https://pypi.org/project/sqlacodegen/2.1.0/", "requires_dist": [ "SQLAlchemy (>=0.9.0)", "inflect (>=0.2.0)", "pytest ; extra == 'test'", "pytest-cov ; extra == 'test'", "psycopg2-binary ; extra == 'test'", "mysql-connector-python ; extra == 'test'" ], "requires_python": ">=2.7, !=3.0, !=3.1, !=3.2, !=3.3, != 3.4", "summary": "Automatic model code generator for SQLAlchemy", "version": "2.1.0" }, "last_serial": 5592991, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "3d40bf3a772c6be81e19eaa0f579c7c4", "sha256": "01bd24574d23c04ca76703933a6356d0e6e99b8fcdf1a422903f4fd5552d3be5" }, "downloads": -1, "filename": "sqlacodegen-1.0.0.tar.gz", "has_sig": false, "md5_digest": "3d40bf3a772c6be81e19eaa0f579c7c4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9238, "upload_time": "2013-05-18T00:11:26", "url": "https://files.pythonhosted.org/packages/e2/0f/dfb445f0c5e9ba8150bec6806321943650efe2d46a893d5336c4785625f4/sqlacodegen-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "33c1e4aae01ce0118efd5cc86e4ea24c", "sha256": "ef267f1742883bfbfeb960a330564e83922192933b11bfdc191b9e2e7ef567c2" }, "downloads": -1, "filename": "sqlacodegen-1.1.0.tar.gz", "has_sig": false, "md5_digest": "33c1e4aae01ce0118efd5cc86e4ea24c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11554, "upload_time": "2013-05-26T05:28:44", "url": "https://files.pythonhosted.org/packages/42/3b/a97da27ceef1f531e9e209baf722c1e89bc00deb542e6eae52e0f1eb9328/sqlacodegen-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "ac0f687c1d1ed0410964746575e37df9", "sha256": "198b2cf3c011f1d46e09e8100e1e2ae3587335e0cb8d2fc62983d3d25eb8061b" }, "downloads": -1, "filename": "sqlacodegen-1.1.1.tar.gz", "has_sig": false, "md5_digest": "ac0f687c1d1ed0410964746575e37df9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11664, "upload_time": "2013-06-12T19:49:14", "url": "https://files.pythonhosted.org/packages/4b/6d/729ecb324a6f0fae1ef0191e4b6ee43715f494ec6a7058028b72b23fabb0/sqlacodegen-1.1.1.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "b8b25fcb9fbc3f26d0f70b6e5d7b602d", "sha256": "852f5a8444558a034fd86f7cb3fcc75c467eb987d37cf3edd3e0b61dce763dcb" }, "downloads": -1, "filename": "sqlacodegen-1.1.2.tar.gz", "has_sig": false, "md5_digest": "b8b25fcb9fbc3f26d0f70b6e5d7b602d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12331, "upload_time": "2013-09-01T14:15:59", "url": "https://files.pythonhosted.org/packages/e5/c7/6a794dc556bd7426bc5836b3ef687e31909fa75d1c2dbf345f8e75c7209b/sqlacodegen-1.1.2.tar.gz" } ], "1.1.3": [ { "comment_text": "", "digests": { "md5": "06183b28163a2333144c68a234737ed5", "sha256": "86c61e7aad8cd9db4ca0ef5af547bae6d9f4683e5007596ca9b9db53bd5e298d" }, "downloads": -1, "filename": "sqlacodegen-1.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "06183b28163a2333144c68a234737ed5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 12989, "upload_time": "2013-12-11T15:10:13", "url": "https://files.pythonhosted.org/packages/9e/19/69b82126067352e3c42fd77fcab8b9db37e5d6f18b40b2e54b0598ca7b00/sqlacodegen-1.1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8c04581206218fb95df9fbe61edda0a4", "sha256": "eb2b57ed090eb4faf5f31e8c7aab90202e851c3dd9545635e2cc00e66fa0b404" }, "downloads": -1, "filename": "sqlacodegen-1.1.3.tar.gz", "has_sig": false, "md5_digest": "8c04581206218fb95df9fbe61edda0a4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12350, "upload_time": "2013-12-11T15:10:22", "url": "https://files.pythonhosted.org/packages/dd/6a/fe7e28e366948673b0ad84b854c04995df7ff2bfe8d2d070894508a986c2/sqlacodegen-1.1.3.tar.gz" } ], "1.1.4": [ { "comment_text": "", "digests": { "md5": "8bfc4f4ed55c25314074cdc542a1d256", "sha256": "8009503945f4fdbb922247076eea5dde491c35f2e64dc6a25433ce51aa5e5f16" }, "downloads": -1, "filename": "sqlacodegen-1.1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8bfc4f4ed55c25314074cdc542a1d256", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13079, "upload_time": "2014-01-02T20:36:52", "url": "https://files.pythonhosted.org/packages/fc/cc/4b15e36d02b125d12f6ae439e64fbcbaebde29326bd6df87da2083c75017/sqlacodegen-1.1.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cbc631539fe04024c2debc2d0c6feb7b", "sha256": "3dcde72573b5e0a15ee3aa01a550c1e554d1909b2a895a1e038253e8dbed38e4" }, "downloads": -1, "filename": "sqlacodegen-1.1.4.tar.gz", "has_sig": false, "md5_digest": "cbc631539fe04024c2debc2d0c6feb7b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12452, "upload_time": "2014-01-02T20:36:54", "url": "https://files.pythonhosted.org/packages/e9/35/32997097e108c5268b3fccfd133853d459e704c57cdf113caa75159bb6a5/sqlacodegen-1.1.4.tar.gz" } ], "1.1.5": [ { "comment_text": "", "digests": { "md5": "f93a9de11ea1971a43f8ce49b5fe1605", "sha256": "d616b98f59094488cb2cac64b5ec06fa46761a44241dc70a6a75634fbd1fd32d" }, "downloads": -1, "filename": "sqlacodegen-1.1.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f93a9de11ea1971a43f8ce49b5fe1605", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13013, "upload_time": "2014-08-10T12:14:50", "url": "https://files.pythonhosted.org/packages/1f/81/ba16509b7b1e6987be17c636f689b525db27406cc9a7e2b2abbf6755a7a9/sqlacodegen-1.1.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bb892c35594c1ebb5e94690683cc75bb", "sha256": "a8c23aea9930522027a3f76b590ed6f57e22edc1c3d2f999c58d7caf7884c9ea" }, "downloads": -1, "filename": "sqlacodegen-1.1.5.tar.gz", "has_sig": false, "md5_digest": "bb892c35594c1ebb5e94690683cc75bb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13062, "upload_time": "2014-08-10T12:15:02", "url": "https://files.pythonhosted.org/packages/35/ed/63465f452d6c60d927948013fa54f416facca91e80d46fd086febaa08021/sqlacodegen-1.1.5.tar.gz" } ], "1.1.6": [ { "comment_text": "", "digests": { "md5": "720240f096f5078de94ac24208abe4c0", "sha256": "abd8ca8405158dec1b5ebd831a5866a1819bac4c0bf8653f6a8e8cea9d265fa4" }, "downloads": -1, "filename": "sqlacodegen-1.1.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "720240f096f5078de94ac24208abe4c0", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13411, "upload_time": "2015-05-15T19:13:01", "url": "https://files.pythonhosted.org/packages/63/1a/1fe2c7cf4f44262b1f7535a8ac75634f7b3f1453819248b9799d5d81cab5/sqlacodegen-1.1.6-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "33673ad850398bb2d50c7f7f1707034c", "sha256": "3e025a49cd2430b6919e77d99cf5ad94ec80a88296b9a22984d9335f817373de" }, "downloads": -1, "filename": "sqlacodegen-1.1.6.tar.gz", "has_sig": false, "md5_digest": "33673ad850398bb2d50c7f7f1707034c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15517, "upload_time": "2015-05-15T19:13:05", "url": "https://files.pythonhosted.org/packages/c6/88/7de326dc81fbfb2184c13d00b9c450951223a1d72d6e16f7087ba16d8c11/sqlacodegen-1.1.6.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "9fe0a7c5b632b01e912064d5171e853e", "sha256": "45e49dc83b85327e5148cf4d0891249fd3d8b1725c4952cf2f34fce488f88e30" }, "downloads": -1, "filename": "sqlacodegen-2.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9fe0a7c5b632b01e912064d5171e853e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0, !=3.1, !=3.2, !=3.3", "size": 12490, "upload_time": "2018-05-20T19:47:28", "url": "https://files.pythonhosted.org/packages/f2/85/83ed8babb7c55ad22e8d8b22f3c7eccc8fc71a1f0630ca84e05485e22ddd/sqlacodegen-2.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "886252dee553de2f5e60dcdc1b76e00e", "sha256": "e9ca5ee839421616f1113b728d1c67a2bdb0ecd08b02a1d57819eee819929559" }, "downloads": -1, "filename": "sqlacodegen-2.0.0.tar.gz", "has_sig": false, "md5_digest": "886252dee553de2f5e60dcdc1b76e00e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0, !=3.1, !=3.2, !=3.3", "size": 19674, "upload_time": "2018-05-20T19:47:29", "url": "https://files.pythonhosted.org/packages/cd/7b/c3637bc7e97b770ec148f0a2e61e0b025ad7954c51487dc8ad4a9d836d42/sqlacodegen-2.0.0.tar.gz" } ], "2.0.1": [ { "comment_text": "", "digests": { "md5": "e68c2487675503625bcf3ec46b915806", "sha256": "1e73fe68d47c3e5717a919c873c29772f5689b069ecc53397da26a17ea94ce6d" }, "downloads": -1, "filename": "sqlacodegen-2.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e68c2487675503625bcf3ec46b915806", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0, !=3.1, !=3.2, !=3.3", "size": 12789, "upload_time": "2018-09-09T07:46:57", "url": "https://files.pythonhosted.org/packages/20/50/23bb1df26808f4dacf8387a6098c5a14686ca463e607e93e56f47c07da74/sqlacodegen-2.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "31295bb4df2f547a8cc6057e9e93a896", "sha256": "160bbb269902607212a1e70ccc5374ceb41804e642c172cd230d88b974f620f5" }, "downloads": -1, "filename": "sqlacodegen-2.0.1.tar.gz", "has_sig": false, "md5_digest": "31295bb4df2f547a8cc6057e9e93a896", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0, !=3.1, !=3.2, !=3.3", "size": 20152, "upload_time": "2018-09-09T07:46:59", "url": "https://files.pythonhosted.org/packages/78/31/7e6b5c6d3d098f209e1e759dc276009474731879055d0fe6d41549ebcc9e/sqlacodegen-2.0.1.tar.gz" } ], "2.1.0": [ { "comment_text": "", "digests": { "md5": "5048894ee91824bd83f9a2f6cbc004ac", "sha256": "69daffff1524f51dde946706289c608a2e7f0a5171d0050945a5eec29dbbaca1" }, "downloads": -1, "filename": "sqlacodegen-2.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5048894ee91824bd83f9a2f6cbc004ac", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0, !=3.1, !=3.2, !=3.3, != 3.4", "size": 12894, "upload_time": "2019-07-27T13:17:05", "url": "https://files.pythonhosted.org/packages/37/e9/3af8a387ad640fa92e9916f5e0e9fa4c603b18de77e4f80671d1359159b4/sqlacodegen-2.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "53a0d5c5a6ab72bbddfdd8526b5bebdb", "sha256": "eae258e36c3dce8dd9543d35a234552d4e37ab5561072b3fb08543c7e881107c" }, "downloads": -1, "filename": "sqlacodegen-2.1.0.tar.gz", "has_sig": false, "md5_digest": "53a0d5c5a6ab72bbddfdd8526b5bebdb", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0, !=3.1, !=3.2, !=3.3, != 3.4", "size": 21822, "upload_time": "2019-07-27T13:17:06", "url": "https://files.pythonhosted.org/packages/75/e1/cf19321bc2d0b5c5bb77cff3da366efb571f1a02c41630c9859608cad2ec/sqlacodegen-2.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5048894ee91824bd83f9a2f6cbc004ac", "sha256": "69daffff1524f51dde946706289c608a2e7f0a5171d0050945a5eec29dbbaca1" }, "downloads": -1, "filename": "sqlacodegen-2.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5048894ee91824bd83f9a2f6cbc004ac", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0, !=3.1, !=3.2, !=3.3, != 3.4", "size": 12894, "upload_time": "2019-07-27T13:17:05", "url": "https://files.pythonhosted.org/packages/37/e9/3af8a387ad640fa92e9916f5e0e9fa4c603b18de77e4f80671d1359159b4/sqlacodegen-2.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "53a0d5c5a6ab72bbddfdd8526b5bebdb", "sha256": "eae258e36c3dce8dd9543d35a234552d4e37ab5561072b3fb08543c7e881107c" }, "downloads": -1, "filename": "sqlacodegen-2.1.0.tar.gz", "has_sig": false, "md5_digest": "53a0d5c5a6ab72bbddfdd8526b5bebdb", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0, !=3.1, !=3.2, !=3.3, != 3.4", "size": 21822, "upload_time": "2019-07-27T13:17:06", "url": "https://files.pythonhosted.org/packages/75/e1/cf19321bc2d0b5c5bb77cff3da366efb571f1a02c41630c9859608cad2ec/sqlacodegen-2.1.0.tar.gz" } ] }