{ "info": { "author": "Tom Malkin", "author_email": "tommalkin28@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "# SimQLe\n\n> The simple way to SQL\n\n\n[![build status](http://img.shields.io/travis/Harlekuin/SimQLe/master.svg?style=flat)](https://travis-ci.org/Harlekuin/SimQLe)\n[![codecov](https://codecov.io/gh/Harlekuin/SimQLe/branch/master/graph/badge.svg)](https://codecov.io/gh/Harlekuin/SimQLe)\n\n\nPerfect for no fuss SQL in your Python projects. Execute SQL and return simple\nrecord sets with named parameters. Manage several connections, and switch \nbetween production, development and testing modes.\n\n## Installation\n\n### Repository\nhttps://github.com/Harlekuin/SimQLe\n\nOr choose your poison:\n\n- `$ pip install simqle`\n- `$ poetry add simqle`\n- `$ pipenv install simqle`\n\nSimQLe reads from a connections file in yaml format. See the \n`.connections.yaml` file section for more details.\n\n## Usage\n\n### In Production\n\nGet a result from the name of your connection, the SQL statement, and a dict\nof parameters:\n\n```python\nfrom simqle import ConnectionManager\n\n# Intialise your connections\ncm = ConnectionManager(\".connections.yaml\")\n\n# Write some simple SQL\nsql = \"SELECT name, age FROM people WHERE category = :category\"\nparams = {\"category\": 5}\nresult = cm.recordset(con_name=\"my-database\", sql=sql, params=params)\n\n# result.headings == [\"name\", \"age\"]\n\n# result.data == [\n# (\"Jim\", 30),\n# (\"Bones\", 35)\n# ]\n\n# result.as_dict == [\n# {\"name\": \"Jim\", \"age\": 30},\n# {\"name\": \"Bones\", \"age\": 35}\n# ]\n\n# result.column[\"name\"] == [\"Jim\", \"Bones\"]\n```\n\nThe `recordset()` method returns a RecordSet object with a bunch of handy methods for getting at the data.\nThere is also a `cm.record()` method for queries you know only return a single record, and\na `cm.record_scalar()` method for queries where you're after a single datum. \n\n### In Development\n\nSet the SIMQLE_MODE environment variable to \"development\". This will use your\ndevelopment connections in place of the production ones, without changing\nyour code.\n\n\n### In Integration Tests\n\nSet the SIMQLE_MODE environment variable to \"testing\".\n\n## Testing this package\n\nTests require the behave package:\n\n`> pip install behave`\n\nTo run, simply:\n\n`> behave`\n\n\n## The .connections.yaml File\nDefine the connection strings for production, development and test servers. The\nnames of the `test-connections` and `dev-connections` should mirror the \n`connections` names. Each connection is be referred to by its name.\n\nExample file:\n\n```yaml\nconnections:\n \n # The name of the connection - this is what will be used in your project\n # to reference this connection.\n - name: my-sql-server-database\n driver: mssql+pyodbc:///?odbc_connect=\n connection: DRIVER={SQL Server};UID=;PWD=;SERVER=\n \n # some odbc connections require urls to be escaped, this is managed by\n # setting url_escaped = true:\n url_escape: true\n\n # File based databases like sqlite are slightly different - the driver\n # is very simple.\n - name: my-sqlite-database\n driver: sqlite:///\n # put a leading '/' before the connection for an absolute path, or omit\n # if it's relative to the project path\n connection: databases/my-database.db\n # This connection will be used if no name is given if the default \n # parameter is used:\n default: true\n\n\ndev-connections:\n # the names of the dev-connections should mirror the connections above.\n - name: my-sql-server-database\n driver: mssql+pyodbc:///?odbc_connect=\n # connecting to a different server here\n connection: DRIVER={SQL Server};UID=;PWD=;SERVER=\n url_escape: true \n\n - name: my-sqlite-database\n driver: sqlite:///\n connection: /tmp/my-dev-database.db\n default: true\n\n\ntest-connections:\n - name: my-sql-server-database\n driver: mssql+pyodbc:///?odbc_connect=\n connection: DRIVER={SQL Server};UID=;PWD=;SERVER=\n url_escape: true \n\n - name: my-sqlite-database\n driver: sqlite:///\n connection: /tmp/my-test-database.db\n default: true\n```\n\n## Chat\n\nSay hello in the Gary: https://gitter.im/SimQLe/community\n\n\n## Author\n\n[Tom Malkin](https://github.com/Harlekuin)\n\n## Contributors\n\n[Zack Botkin](https://github.com/ZackBotkin)\n\n## Release History\n\n- 0.1.0\n\t- Add the basic skeleton of the project\n- 0.1.1\n - Unit tests\n - Integration tests for sqlite added.\n - 100% coverage\n- 0.2.0\n - Added url_escape option in connections.yaml file\n - Integration tests added for mysql and postgresql\n- 0.3.0\n - Project refactored into classes\n - Default parameter added\n- 0.4.0\n - Development added as a connection mode\n- 0.5.0\n - RecordSet, Record and RecordScalar objects added", "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/Harlekuin/SimQLe", "keywords": "sql", "license": "MIT", "maintainer": "Tom Malkin", "maintainer_email": "tommalkin28@gmail.com", "name": "simqle", "package_url": "https://pypi.org/project/simqle/", "platform": "", "project_url": "https://pypi.org/project/simqle/", "project_urls": { "Homepage": "https://github.com/Harlekuin/SimQLe" }, "release_url": "https://pypi.org/project/simqle/0.5.0/", "requires_dist": null, "requires_python": "", "summary": "The simple way to SQL", "version": "0.5.0" }, "last_serial": 5766237, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "7925cedaaa6ff9de00d55c3159955838", "sha256": "4e7e82b769e051a80ae4374f470f0076784cade045d5912511f63b029a6cc1df" }, "downloads": -1, "filename": "simqle-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "7925cedaaa6ff9de00d55c3159955838", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9531, "upload_time": "2019-04-28T13:15:25", "url": "https://files.pythonhosted.org/packages/88/ad/747d2b862bb8d8e092040857e78c095a7b6bca1dda061f32c86f52e93438/simqle-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3eb1c1022fcc7a0cb60392f9bf2a004a", "sha256": "873a8915295dcfc713a19b426f9dd3f96c70f3adf30e23f59c618cd8078eba9c" }, "downloads": -1, "filename": "simqle-0.1.1.tar.gz", "has_sig": false, "md5_digest": "3eb1c1022fcc7a0cb60392f9bf2a004a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6075, "upload_time": "2019-04-28T13:15:37", "url": "https://files.pythonhosted.org/packages/dc/71/8f7c1f36384bdcaaab4d17d870c83f834e7e592ec42e8c8f349481644286/simqle-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "f46e660896ded9b24dea67d504ac42de", "sha256": "fce987a8a1655e057f0329cab96a07bd150b9505deb06d1faf9ce42961fba65e" }, "downloads": -1, "filename": "simqle-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "f46e660896ded9b24dea67d504ac42de", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9794, "upload_time": "2019-05-11T11:56:33", "url": "https://files.pythonhosted.org/packages/23/f4/2658be482d852ba6333c2b8d2a3514b154a0f158cc9450bc1be66e6a5244/simqle-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d41b62379c1d566fb1da14a2494fc309", "sha256": "ada249955aa7227e215936bec33d843adbaef9b0b954ab60fe05a1a00427a5da" }, "downloads": -1, "filename": "simqle-0.2.0.tar.gz", "has_sig": false, "md5_digest": "d41b62379c1d566fb1da14a2494fc309", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5607, "upload_time": "2019-05-11T11:56:36", "url": "https://files.pythonhosted.org/packages/65/cd/f353c5a23202982a99455ff1123395279a6727fb8c9f60afb0bb7cfdba96/simqle-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "17c31b31e86a488352caf9ad1fc15693", "sha256": "8baf9a4da2a624d458cbbd50c670eaf63ebcae14be0860624af78f2eb0184e90" }, "downloads": -1, "filename": "simqle-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "17c31b31e86a488352caf9ad1fc15693", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13484, "upload_time": "2019-06-16T08:37:59", "url": "https://files.pythonhosted.org/packages/65/cf/866053c0bd1dc29d4b2d9f12df003fb7d7fcb99cf03489f86dc4ff37b807/simqle-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "67f1e84da4dad4cf996e4e39eb61476a", "sha256": "df8202028da6b8bc89f84b75186cdfabde1511c04758fb2936c12b080b418db6" }, "downloads": -1, "filename": "simqle-0.3.0.tar.gz", "has_sig": false, "md5_digest": "67f1e84da4dad4cf996e4e39eb61476a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6369, "upload_time": "2019-06-16T08:38:04", "url": "https://files.pythonhosted.org/packages/f0/04/128bcd90140ccd242f6dad5f8ac421da8f9c5e9ee241ac600700730b64c8/simqle-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "9099e2851335b4f51fac89989d5e6832", "sha256": "e301b59b2136d0923692eedceb605929000e836a622dc6b54515f143d3c2ae7c" }, "downloads": -1, "filename": "simqle-0.3.1.tar.gz", "has_sig": false, "md5_digest": "9099e2851335b4f51fac89989d5e6832", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6422, "upload_time": "2019-06-16T10:41:09", "url": "https://files.pythonhosted.org/packages/0a/0b/f7c40823e15452c8aff0bf9da0cffd3f1d9e63574fdf0ed1b611c2dcf86f/simqle-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "3126406299309b464996ea30ae909816", "sha256": "d4516abed962ad7eb6893de2a6d9e33addfcd0ffad35824f13c90319e56368cf" }, "downloads": -1, "filename": "simqle-0.3.2.tar.gz", "has_sig": false, "md5_digest": "3126406299309b464996ea30ae909816", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6423, "upload_time": "2019-06-16T10:58:45", "url": "https://files.pythonhosted.org/packages/d4/cd/29443b2821f9e58d62248a2b1fb07e73ebfe6fee786e43fb9379fd68abc5/simqle-0.3.2.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "d063b3469a10f9af29690ce1f7a8d261", "sha256": "7dad67d77ba71ca9deddec8c57c24263e00f6574c1402ac056196efe8a3f8ea5" }, "downloads": -1, "filename": "simqle-0.3.3.tar.gz", "has_sig": false, "md5_digest": "d063b3469a10f9af29690ce1f7a8d261", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6433, "upload_time": "2019-06-16T12:21:58", "url": "https://files.pythonhosted.org/packages/4c/7a/3afff882528718f2272b4024ef6575656fb1a8561b2b558bce4beb6f7853/simqle-0.3.3.tar.gz" } ], "0.3.4": [ { "comment_text": "", "digests": { "md5": "cbe85c893934f6276bfc3677686a3932", "sha256": "2a583192809fbc508e3f926b1a491de0f8c8f09410daf14713c223f276b8c8e5" }, "downloads": -1, "filename": "simqle-0.3.4.tar.gz", "has_sig": false, "md5_digest": "cbe85c893934f6276bfc3677686a3932", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6810, "upload_time": "2019-07-04T10:17:45", "url": "https://files.pythonhosted.org/packages/54/f1/4a1df7e2da05ce645970c9fb62105c1927c57169561c706d3523f10a3187/simqle-0.3.4.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "2bef43d54fd3e7887b73a08d5586fa27", "sha256": "8ac17858e5a96145fc5195b119f4d5fe3c36d425b2dea22836e79472332324b8" }, "downloads": -1, "filename": "simqle-0.4.0.tar.gz", "has_sig": false, "md5_digest": "2bef43d54fd3e7887b73a08d5586fa27", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6972, "upload_time": "2019-07-06T14:32:02", "url": "https://files.pythonhosted.org/packages/0a/aa/8cd1dd1426175ba9807618726aa337a7b2c87d9829e9a5a62d1e48aa7951/simqle-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "764036364fa39742ab4ba3b9beac3c3f", "sha256": "32cd5d3cee985547394696af94e7554d2176387cd94490d4352c11d6c23b088b" }, "downloads": -1, "filename": "simqle-0.4.1.tar.gz", "has_sig": false, "md5_digest": "764036364fa39742ab4ba3b9beac3c3f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6860, "upload_time": "2019-07-07T00:04:54", "url": "https://files.pythonhosted.org/packages/13/42/8b533e015fee95816d1121845fed29ee5a369d0bb67834567c15b2b2b6d5/simqle-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "5fc2d24e2e8499577b194eb858741e89", "sha256": "3e042c536f646d0b67ba2c1a3dc4a30f45873d977bbb88d4468d387d37212e23" }, "downloads": -1, "filename": "simqle-0.4.2.tar.gz", "has_sig": false, "md5_digest": "5fc2d24e2e8499577b194eb858741e89", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6856, "upload_time": "2019-07-07T02:38:05", "url": "https://files.pythonhosted.org/packages/e3/9e/aecf7c53bd6641de55a5893bcdfd887fa8f9f118a62a9f501725fdcefcd2/simqle-0.4.2.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "ed54d874188a51bbf74ac9c159172aa6", "sha256": "19003e2909624fc7d4163f08d4cc312e5e12f4a6c325d77962468149cd340e49" }, "downloads": -1, "filename": "simqle-0.5.0.tar.gz", "has_sig": false, "md5_digest": "ed54d874188a51bbf74ac9c159172aa6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8386, "upload_time": "2019-09-01T06:13:37", "url": "https://files.pythonhosted.org/packages/89/d3/2dde625d867bbf898bea73ed03c9cc1edd7571921fab62edc8ff33a31c78/simqle-0.5.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ed54d874188a51bbf74ac9c159172aa6", "sha256": "19003e2909624fc7d4163f08d4cc312e5e12f4a6c325d77962468149cd340e49" }, "downloads": -1, "filename": "simqle-0.5.0.tar.gz", "has_sig": false, "md5_digest": "ed54d874188a51bbf74ac9c159172aa6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8386, "upload_time": "2019-09-01T06:13:37", "url": "https://files.pythonhosted.org/packages/89/d3/2dde625d867bbf898bea73ed03c9cc1edd7571921fab62edc8ff33a31c78/simqle-0.5.0.tar.gz" } ] }