{ "info": { "author": "rdj", "author_email": "fumble.to.victory@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "python-sqloose\n==============\n\nsqloose is a SQL-like query language that maps directly to SQL. This module does not implement a\ndatabase itself, but is instead a translator from sqloose to SQL.\n\nInstallation\n------------\n\npip install python-sqloose\n\nUsage\n-----\n\n.. code-block:: python\n\n from sqloose import sqloose\n\n sql = sqloose.to_sql(\"SELECT age, race, gender, count(*) AS num FROM stats GROUP BY [1:3] ORDER BY -1 DESC\")\n\nUse Case\n--------\n\nsqloose is designed as a less rigid SQL, offering a more convenient syntax. In particular, it\nallows ranges and negative indices to be used in GROUP BY and ORDER BY statements. The right index\nin the range specifies the final item, unlike Python in which the right index is the final item +\n1.\n\nTake the following SQL statement:\n\n.. code-block:: sql\n\n SELECT age, race, gender, count(*) AS num FROM stats GROUP BY 1,2,3 ORDER BY 4 DESC\n\nIn sqloose this can be represented many ways, such as:\n\n.. code-block:: sql\n\n SELECT age, race, gender, count(*) AS num FROM stats GROUP BY [1:3] ORDER BY -1 DESC\n SELECT age, race, gender, count(*) AS num FROM stats GROUP BY [:3] ORDER BY -1 DESC\n SELECT age, race, gender, count(*) AS num FROM stats GROUP BY [:-2] ORDER BY -1 DESC\n\nFurther, sqloose defines the GROUP TO and GROUP THROUGH constructs, which can be used in the same\nscenario:\n\n.. code-block:: sql\n\n SELECT age, race, gender, count(*) AS num FROM stats GROUP TO -1 ORDER BY -1 DESC\n SELECT age, race, gender, count(*) AS num FROM stats GROUP TO 4 ORDER BY -1 DESC\n SELECT age, race, gender, count(*) AS num FROM stats GROUP THROUGH 3 ORDER BY -1 DESC\n\nSQL is often used in an interactive fashion, where data is being explored rather than simply being\ngathered. Queries are discovered, rather than being innately known. The pattern usually involves\nlooking at aggregates (counts, sums, means), while changing both the selection of columns and the\ndepth to find the most meaningful insights. The frustration in using this pattern is that we often\nmust change the start of the query (the column list) and also the near end (the grouping indices).\nThis can be made largely unnecessary by expanding SQL syntax to be more expressive.\n\nsqloose does not validate the correctness of your SQL, but does validate the correctness of the\nconstructs that are specific to sqloose, including the ranges and use of GROUP TO and GROUP\nTHROUGH.\n\nAuthors\n-------\n\nrdj - https://oddacious.github.io\n\n\n=======\nHistory\n=======\n\n0.1.0a1 (2016-09-25)\n--------------------\n\n* First pre-release on Github.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/oddacious/sqloose", "keywords": "sqloose", "license": "Apache Software License 2.0", "maintainer": null, "maintainer_email": null, "name": "sqloose", "package_url": "https://pypi.org/project/sqloose/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/sqloose/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/oddacious/sqloose" }, "release_url": "https://pypi.org/project/sqloose/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "sqloose is a less rigid SQL that allows ranges and negative indices.", "version": "0.1.0" }, "last_serial": 2762831, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "f24e730a33a13a526f8de1a971ab560f", "sha256": "d404af4a344dd3abd5b6e7a27ad175a2086de7cfbf53f76adf619d14eef3a9c4" }, "downloads": -1, "filename": "sqloose-0.1.0.tar.gz", "has_sig": false, "md5_digest": "f24e730a33a13a526f8de1a971ab560f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24632, "upload_time": "2017-04-08T17:31:35", "url": "https://files.pythonhosted.org/packages/c2/36/4705a4ad422cb070c14c70705413cb730a685274c5af1ccd20a059e91ea3/sqloose-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f24e730a33a13a526f8de1a971ab560f", "sha256": "d404af4a344dd3abd5b6e7a27ad175a2086de7cfbf53f76adf619d14eef3a9c4" }, "downloads": -1, "filename": "sqloose-0.1.0.tar.gz", "has_sig": false, "md5_digest": "f24e730a33a13a526f8de1a971ab560f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24632, "upload_time": "2017-04-08T17:31:35", "url": "https://files.pythonhosted.org/packages/c2/36/4705a4ad422cb070c14c70705413cb730a685274c5af1ccd20a059e91ea3/sqloose-0.1.0.tar.gz" } ] }