{ "info": { "author": "lsenta", "author_email": "UNKNOWN", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5" ], "description": "baconql\n=======\n\n[![Build Status](https://travis-ci.org/lsenta/baconql.svg?branch=master)](https://travis-ci.org/lsenta/baconql)\n\n[![Coverage Status](https://coveralls.io/repos/github/lsenta/baconql/badge.svg?branch=master)](https://coveralls.io/github/lsenta/baconql?branch=master)\n\n\nbaconql is an attempt at reconciling myself, Python and SQL.\n\nIt provides:\n\n - an SQL interface without ORM or weird Python DSL,\n - a simple migration system, no boilerplate needed.\n\n\n### No ORM?!\n\nTry something:\nSearch for `ORM bad`. Have you read any of these articles?\nThen, search for `Python SQL` or `Python SQL without ORM`. ORMs, ORMs and ORMs.\n\nbaconql is an attempt at providing an ORM free library to interact with a relational\ndatabase. It doesn't do abstract stuff away, you don't have to learn a specific Python\nsyntax. You write SQL, you execute SQL.\n\n- baconql is of the opinion that SQL is the right tool for the job\n when working with a relational database. Python DSLs don't count.\n- baconql uses simple conventions in your SQL files to define (at compile time)\n database functions in your Python module,\n creating a clean separation of Python and SQL code.\n- _(this is stolen from HugSQL, see the notes below)_\n\nIt provides:\n\n## Compiler\n\nTurns .sql files into python functions.\n\nYou write a `users.sql` file:\n\n```\n-- count_all :? :s\nSELECT COUNT(*)\nFROM users;\n\n-- list_all :? :*\nSELECT *\nFROM users;\n```\n\nIt's a regular SQL file, your editor already knows how to handle it and autocomplete it\nfor you.\n\nbaconql generates a `users.py` file that you can import and `assert user.count_all(db) == 42`.\n\nThe exact syntax will be describe later, but basically:\n\n- one file = one module\n- one block = description header + SQL body\n- description header = name + type of operation (query, mutation, returning) + cardinality of the result (one, many, scalar, affected)\n\nThat's it.\n\n\n## Migration manager\n\nthat makes writing SQL migrations easiers to write and to track.\n\nWIP.\n\n## Notes\n\nIf you find a clever idea, it's probably a ripoff of [HugSQL](http://www.hugsql.org/),\nsilly stuffs are mine.\n\nbaconql relies on SQLAlchemy, my Python is rusty and I'm no SQL expert,\nso SQLAlchemy provides the basics to interact with the database.\nI'd love to replace it with a more focused library. Handling typing seem's to be the tricky part.\n\nIf you dig into the internals you'll see that it's more of a quick & dirty POC than a well\nthought codebase. Comments & issues, good or bad, will be highly appreciated.\n\n## Release\n\n- requires `pypandoc` package to convert this Markdown to reStructuredText.\n\n## TODOs\n\n- [ ] Setup tox and make this 2.6 & 3.. compatible\n- [ ] Set a license\n- [ ] Shorten this readme, add usage documentation and a demo,\n- [ ] Find a solution to avoid repeating every argument type\n - parse the sql to figure out the inputs?\n - allow user to provide default input/output mappings, used when doing `SELECT *' for example.\n- [ ] Add option to specify a docstring and prefixes (special imports) for a module\n- [ ] Clean parsing phase, maybe with a real grammar (?),\n- [ ] Exceptions system with a consistent way to raise with line numbers,\n- [ ] More unit-testing,\n- [x] Pypi-ize,\n- [ ] Split into 2 different projects.", "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/lsenta/baconql", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "baconql", "package_url": "https://pypi.org/project/baconql/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/baconql/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/lsenta/baconql" }, "release_url": "https://pypi.org/project/baconql/0.0.2/", "requires_dist": null, "requires_python": null, "summary": "Python SQL without ORM & easy migrations", "version": "0.0.2" }, "last_serial": 2175257, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "2479c0990f1b8aeadb7eaa1b37233f70", "sha256": "299c7772caa2bbbacad515cdc144fc1ac37d6aafc24f86927d6abf7516c4f246" }, "downloads": -1, "filename": "baconql-0.0.1.tar.gz", "has_sig": false, "md5_digest": "2479c0990f1b8aeadb7eaa1b37233f70", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12828, "upload_time": "2016-06-11T07:17:35", "url": "https://files.pythonhosted.org/packages/14/88/96d8677382d4b9413a5629ed35b281d111c89cfc5abd0dbe40054262985a/baconql-0.0.1.tar.gz" } ], "0.0.1.post2": [], "0.0.2": [ { "comment_text": "", "digests": { "md5": "d0b570877270a7235b0ff0a37bddb9bd", "sha256": "5854900eabbbd00dfbd020903c789233dfbcb41b23035ae1812fd29750437ead" }, "downloads": -1, "filename": "baconql-0.0.2.tar.gz", "has_sig": false, "md5_digest": "d0b570877270a7235b0ff0a37bddb9bd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14141, "upload_time": "2016-06-18T23:00:41", "url": "https://files.pythonhosted.org/packages/6f/1a/014f4fe02d7bf3c0cad7d4e75063d7a40daef765305523ed06aab66bdfa3/baconql-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d0b570877270a7235b0ff0a37bddb9bd", "sha256": "5854900eabbbd00dfbd020903c789233dfbcb41b23035ae1812fd29750437ead" }, "downloads": -1, "filename": "baconql-0.0.2.tar.gz", "has_sig": false, "md5_digest": "d0b570877270a7235b0ff0a37bddb9bd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14141, "upload_time": "2016-06-18T23:00:41", "url": "https://files.pythonhosted.org/packages/6f/1a/014f4fe02d7bf3c0cad7d4e75063d7a40daef765305523ed06aab66bdfa3/baconql-0.0.2.tar.gz" } ] }