{ "info": { "author": "Matt GdV", "author_email": "matthewgdv@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Programming Language :: Python :: 3.7" ], "description": "Overview\n====================\n\nProvides a thick wrapper around some SQLAlchemy operations with lots of conveniences:\n\nThe `Sql` class\n--------------------\n* Central handler class\n* Automatically start connections based on prior configuration\n* Preconfigured SQLAlchemy `Session` subclass bound which produces special `Query` objects with its `Session.query()` method.\n* Unique `Database` object bound to its `Sql.database` attribute, which manages the SQLAlchemy `MetaData`, `DeclarativeBase`, and `AutomapBase` objects\n* Produce a pre-configured alembic `Operations` object for simple programmatic migrations\n* Create a table from a Pandas `DataFrame` or subtypes `Frame`, with an autoincrementing primary key\n* Log class that captures raw SQL with inline literal binds from custom expression classes (`Select`, `Insert`, `Update`, `Delete`) when activated\n* Create and drop table operations that work on mapped classes and raw tables, which update the metadata and database accessors to keep everything in sync\n* Provides access to the most common parts of the SQLAlchemy API\n\nThe `Config` class\n--------------------\n* Simple API for configuring database URLs that can be easily reused\n* When Providing a default host and database, `Sql` will no longer require arguments when connecting\n* Add or remove config programatically as well as by importing/exporting JSON files\n\nThe `Model` class\n--------------------\n* A SQLAlchemy declarative base with a few utility methods\n* `Model.insert()`, `Model.update()`, and `Model.delete()` will perform the respective operations within their bound session\n* `Model.frame()` converts a record to a `subtypes.Frame` with a single row\n* Other classmethods: `Model.create()`, `Model.drop()`, `Model.query()`, `Model.join()` (for cleaner joins in expression constructs), `Model.c()` (easier access to the table\n columns), and `Model.alias()`\n\nThe `Query` class\n--------------------\n* Alias methods `Query.from_()` (`Query.select_from()`), `Query.where()` (`Query.filter()`), `Query.set_()` (`Query.update()`, with automatic 'fetch' behaviour)\n* `Query.frame()` method for conversion to `subtypes.Frame`\n* `Query.scalar_col()` method for conversion of a single column to a `list`\n* Implemented string magic method producing the query with inline literal binds\n\nThe `Database` class\n--------------------\n* `Database.orm` and `Database.objects` attributes can be used to access database objects via attribute access (eg `Database.orm.log.main`)\n* `Database.orm` yields mapped classes, but only for database objects with a primary key\n* `Database.objects` yields raw table objects, and should allow access to any database object, even those without a primary key, views, etc.\n* Database reflection occurs automatically when attempting to access a schema or database object using these accessors\n* The `MetaData` is automatically cached for 5 days after each reflection operation, causing the `Database` object to start with pre-populated schemas on subsequent instanciation\n\nCustom expression classes\n--------------------\n* `Select`, `Update`, `Insert`, and `Delete` subclasses with various extra methods\n* `.resolve()` method facilitates performing queries with user interaction\n\n\n\nInstallation\n====================\n\nTo install use pip:\n\n $ pip install [project_name]\n\n\nOr clone the repo:\n\n $ git clone https://github.com/matthewgdv/sqlhandler.git\n $ python setup.py install\n\n\nUsage\n====================\n\n[Usage]\n\nContributing\n====================\n\nContributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.\n\nYou can contribute in many ways:\n\nReport Bugs\n--------------------\n\nReport bugs at https://github.com/matthewgdv/sqlhandler/issues\n\nIf you are reporting a bug, please include:\n\n* Your operating system name and version.\n* Any details about your local setup that might be helpful in troubleshooting.\n* Detailed steps to reproduce the bug.\n\nFix Bugs\n--------------------\n\nLook through the GitHub issues for bugs. Anything tagged with \"bug\" and \"help wanted\" is open to whoever wants to implement a fix for it.\n\nImplement Features\n--------------------\n\nLook through the GitHub issues for features. Anything tagged with \"enhancement\" and \"help wanted\" is open to whoever wants to implement it.\n\nWrite Documentation\n--------------------\n\nThe repository could always use more documentation, whether as part of the official docs, in docstrings, or even on the web in blog posts, articles, and such.\n\nSubmit Feedback\n--------------------\n\nThe best way to send feedback is to file an issue at https://github.com/matthewgdv/sqlhandler/issues.\n\nIf you are proposing a new feature:\n\n* Explain in detail how it would work.\n* Keep the scope as narrow as possible, to make it easier to implement.\n* Remember that this is a volunteer-driven project, and that contributions are welcome :)\n\nGet Started!\n--------------------\n\nBefore you submit a pull request, check that it meets these guidelines:\n\n1. If the pull request adds functionality, it should include tests and the docs should be updated. Write docstrings for any functions that are part of the external API, and add\n the feature to the README.md.\n\n2. If the pull request fixes a bug, tests should be added proving that the bug has been fixed. However, no update to the docs is necessary for bugfixes.\n\n3. The pull request should work for the newest version of Python (currently 3.7). Older versions may incidentally work, but are not officially supported.\n\n4. Inline type hints should be used, with an emphasis on ensuring that introspection and autocompletion tools such as Jedi are able to understand the code wherever possible.\n\n5. PEP8 guidelines should be followed where possible, but deviations from it where it makes sense and improves legibility are encouraged. The following PEP8 error codes can be\n safely ignored: E121, E123, E126, E226, E24, E704, W503\n\n6. This repository intentionally disallows the PEP8 79-character limit. Therefore, any contributions adhering to this convention will be rejected. As a rule of thumb you should\n endeavor to stay under 200 characters except where going over preserves alignment, or where the line is mostly non-algorythmic code, such as extremely long strings or function\n calls.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/matthewgdv/sqlhandler", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "sqlhandler", "package_url": "https://pypi.org/project/sqlhandler/", "platform": "", "project_url": "https://pypi.org/project/sqlhandler/", "project_urls": { "Homepage": "https://github.com/matthewgdv/sqlhandler" }, "release_url": "https://pypi.org/project/sqlhandler/0.0.2/", "requires_dist": [ "maybe-else", "numpy", "pandas", "pathmagic", "pymiscutils", "pysubtypes", "sqlalchemy", "sqlparse" ], "requires_python": "", "summary": "Sql handler class controlling sqlalchemy resources and granting access to sqlalchemy object subclasses with additional convenience methods.", "version": "0.0.2" }, "last_serial": 5959779, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "4ec88de2f25999cce21c3bc37d591a37", "sha256": "8174ed4417b4c5c0f690872ae7ec204cb90de3dc51680a9e23b0584c9c244b79" }, "downloads": -1, "filename": "sqlhandler-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "4ec88de2f25999cce21c3bc37d591a37", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 19778, "upload_time": "2019-08-06T11:03:49", "url": "https://files.pythonhosted.org/packages/fc/d0/c6883eba1a68395aec4ef625bdfb60d025ca14e3e7e15edea28cb2fd57aa/sqlhandler-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4cd377d06cf96f11afdb6219feff89be", "sha256": "05eb3b493e6b8ae8059c1919fc5ca8864937253e69dda95ed9ddd7e8c5f0f6cd" }, "downloads": -1, "filename": "sqlhandler-0.0.1.tar.gz", "has_sig": false, "md5_digest": "4cd377d06cf96f11afdb6219feff89be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18203, "upload_time": "2019-08-06T11:03:51", "url": "https://files.pythonhosted.org/packages/f4/55/6b2df0f7c588fbfc61851432c6718d4db2f048cf28593df6d92a57bcf7f2/sqlhandler-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "78f8868c5604533b231d21723637f1f9", "sha256": "8f6267b85617ce9c1ead3814352d1e3926ad0678e77026e4a99d5b560bfba095" }, "downloads": -1, "filename": "sqlhandler-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "78f8868c5604533b231d21723637f1f9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 19094, "upload_time": "2019-10-11T11:00:58", "url": "https://files.pythonhosted.org/packages/c9/35/404613f0bed42cd97c9061b6f45426ea61d3fb86fe720fc9407a38bbf959/sqlhandler-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3bc5a93e856d7b38dea3a02f822b2b3d", "sha256": "e83f04a9d5d6f2501de7915f000d05dff2795342e14acf741361350c21ece8a2" }, "downloads": -1, "filename": "sqlhandler-0.0.2.tar.gz", "has_sig": false, "md5_digest": "3bc5a93e856d7b38dea3a02f822b2b3d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17944, "upload_time": "2019-10-11T11:00:59", "url": "https://files.pythonhosted.org/packages/56/49/abf640722d7c90402976ef28d919114107cade7e7a591775732da15d862e/sqlhandler-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "78f8868c5604533b231d21723637f1f9", "sha256": "8f6267b85617ce9c1ead3814352d1e3926ad0678e77026e4a99d5b560bfba095" }, "downloads": -1, "filename": "sqlhandler-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "78f8868c5604533b231d21723637f1f9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 19094, "upload_time": "2019-10-11T11:00:58", "url": "https://files.pythonhosted.org/packages/c9/35/404613f0bed42cd97c9061b6f45426ea61d3fb86fe720fc9407a38bbf959/sqlhandler-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3bc5a93e856d7b38dea3a02f822b2b3d", "sha256": "e83f04a9d5d6f2501de7915f000d05dff2795342e14acf741361350c21ece8a2" }, "downloads": -1, "filename": "sqlhandler-0.0.2.tar.gz", "has_sig": false, "md5_digest": "3bc5a93e856d7b38dea3a02f822b2b3d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17944, "upload_time": "2019-10-11T11:00:59", "url": "https://files.pythonhosted.org/packages/56/49/abf640722d7c90402976ef28d919114107cade7e7a591775732da15d862e/sqlhandler-0.0.2.tar.gz" } ] }