{ "info": { "author": "Henrique Bastos", "author_email": "henrique@bastos.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries" ], "description": "SQLFormatter: Beautiful colored SQL statements for logging\n==========================================================\n\nLogging your SQL to the console helps you understand whats going on under the ORM.\n\nHowever, queries can get pretty big resulting on a code wall.\n\n*SQLFormater* is a logging formatter that *idents* and *colorize* your SQL statements making everything legible again.\n\n.. image:: https://img.shields.io/pypi/v/sqlformatter.svg\n :alt: Latest PyPI version\n\n.. image:: https://img.shields.io/pypi/dm/sqlformatter.svg\n :alt: Number of PyPI downloads\n\n\nHow it looks like?\n------------------\n\n.. image:: https://raw.githubusercontent.com/henriquebastos/sqlformatter/master/screenshot.png\n :alt: Screenshot\n\n\nInstall\n-------\n\n.. code-block:: console\n\n pip install sqlformatter\n\nUsage\n-----\n\nThere are 2 ways of using it.\n\nTemporarily enable it during a console session\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nDuring a console session it maybe interesting to show your queries while experimenting.\n\nYou can toggle sql output logging by calling the helper function `logdb`.\n\n.. code-block:: python\n\n from sqlformatter import logdb\n # Enable\n logdb()\n \n # Run your query\n MyModel.objects.all() \n \n # Disable\n logdb()\n\nAdd it to your Django Logging settings\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nYou can add it to yout Django LOGGING settings:\n\n.. code-block:: python\n\n LOGGING = {\n 'version': 1,\n 'disable_existing_loggers': False,\n 'handlers': {\n 'sqlhandler': {\n 'level': 'DEBUG',\n 'class': 'logging.StreamHandler',\n 'formatter': 'sqlformatter'\n }\n },\n 'formatters': {\n 'sqlformatter': {\n '()': 'sqlformatter.SqlFormatter',\n 'format': '%(levelname)s %(message)s',\n },\n },\n 'loggers': {\n 'django.db.backends': {\n 'handlers': ['sqlhandler'],\n 'level': 'DEBUG',\n },\n }\n }\n\nCustomization\n-------------\n\nYou can passa many options to customize `SqlFormatter` either instantiating it \ndirectly or calling the `logdb` helper.\n\nCheck out the source code.\n\nLicense\n=======\n\nThe MIT License (MIT)\n\nCopyright (c) 2013 Henrique Bastos \n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/henriquebastos/sqlformatter/", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "sqlformatter", "package_url": "https://pypi.org/project/sqlformatter/", "platform": "any", "project_url": "https://pypi.org/project/sqlformatter/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/henriquebastos/sqlformatter/" }, "release_url": "https://pypi.org/project/sqlformatter/1.3/", "requires_dist": null, "requires_python": null, "summary": "SQLFormatter: Beautiful colored SQL staments for logging", "version": "1.3" }, "last_serial": 2385707, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "038199b371d207cf68f4fb45cb309aed", "sha256": "e7a53de96d0d1957c96bb95b9f82be351aa682dd53c1b76ab1ca96ef035eb4c6" }, "downloads": -1, "filename": "sqlformatter-1.0.tar.gz", "has_sig": false, "md5_digest": "038199b371d207cf68f4fb45cb309aed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3035, "upload_time": "2014-03-19T22:46:08", "url": "https://files.pythonhosted.org/packages/4e/a9/d7032a322b0b7c761fca950bdaebcde0236dda5a027caf56053d89b07c9e/sqlformatter-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "e33335ad9f9711cb728476fbf24b15b1", "sha256": "a3796aa718b87b8e6e61a894912deacabef4c2eef16c72e2e00aed3bad2a3893" }, "downloads": -1, "filename": "sqlformatter-1.1.tar.gz", "has_sig": false, "md5_digest": "e33335ad9f9711cb728476fbf24b15b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3683, "upload_time": "2016-01-21T01:18:44", "url": "https://files.pythonhosted.org/packages/96/7f/a2a33781cd69190ecb3b4ebc358be1a461e34fc2c3029f243bbcfb80b6d1/sqlformatter-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "c5398901a795d7690f260202482a5eb8", "sha256": "6fd3e987823375475b0f33c5647f77c0996163d07a9de58f8c791a6e62543785" }, "downloads": -1, "filename": "sqlformatter-1.2.tar.gz", "has_sig": false, "md5_digest": "c5398901a795d7690f260202482a5eb8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3793, "upload_time": "2016-10-06T23:49:14", "url": "https://files.pythonhosted.org/packages/57/17/10cb0f849c70e402b1511576d770551242b2ee0f0184e2feeb1635acdf03/sqlformatter-1.2.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "a6c24cee7b80332fbae7061d818342b1", "sha256": "8215a794e7282e10b6e7e2e25e097b6b8bb4f6f70c315030c5e0e1abb5993b53" }, "downloads": -1, "filename": "sqlformatter-1.3.tar.gz", "has_sig": false, "md5_digest": "a6c24cee7b80332fbae7061d818342b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3793, "upload_time": "2016-10-06T23:52:43", "url": "https://files.pythonhosted.org/packages/26/c1/fc5443ec70f1db944862bee08c10c1e54b3af804c60f3e86e1fed9c353a7/sqlformatter-1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a6c24cee7b80332fbae7061d818342b1", "sha256": "8215a794e7282e10b6e7e2e25e097b6b8bb4f6f70c315030c5e0e1abb5993b53" }, "downloads": -1, "filename": "sqlformatter-1.3.tar.gz", "has_sig": false, "md5_digest": "a6c24cee7b80332fbae7061d818342b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3793, "upload_time": "2016-10-06T23:52:43", "url": "https://files.pythonhosted.org/packages/26/c1/fc5443ec70f1db944862bee08c10c1e54b3af804c60f3e86e1fed9c353a7/sqlformatter-1.3.tar.gz" } ] }