{ "info": { "author": "Cologler", "author_email": "skyoflw@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "\nlquery\n======\n\nTry bring C# linq to python \u9983\u5dff.\n\nThe library is a demo, not for production (yet).\n\nCompare with Others\n-------------------\n\nDifferent between lquery and others (linq for python like asq):\n\n**lquery try convert func (from bytecode) to SQL and query from database process.**\n\nCompare with CSharp\n-------------------\n\nFor C#:\n\n.. code-block:: cs\n\n IQueryable query = null;\n var items = query.Where(z => z.Name == 's').Select(z => z.Value).ToList();\n\nSo for python:\n\n.. code-block:: py\n\n query: Queryable = None;\n expr = query.where(z => z.name == 's').select(z => z.value).to_list();\n\nfor in-memory iterable\n^^^^^^^^^^^^^^^^^^^^^^\n\n.. code-block:: py\n\n from lquery import enumerable\n query: Queryable = enumerable([1, 2, 3])\n # then query it\n\nfor mongodb\n^^^^^^^^^^^\n\n.. code-block:: py\n\n from lquery.extras.mongodb import MongoDbQuery\n collection = # get a collection from pymongo\n query: Queryable = MongoDbQuery(collection)\n # then query it\n\nlinq APIs\n---------\n\n\n* ``to_memory`` - same as ``AsEnumerable()`` from C#\n* ``where``\n* ``select``\n* ``select_many``\n* ``take``\n* ``skip``\n\nread more examples from unittests.\n\nOthers\n------\n\nprint reduce info\n^^^^^^^^^^^^^^^^^\n\nPrint reduce info is easy way to check what query will compile to SQL.\n\ncode example:\n\n.. code-block:: py\n\n >>> from lquery.extras.mongodb import MongoDbQuery\n >>> mongo_query = MongoDbQuery(None)\n >>> reduce_info = mongo_query\\\n ... .where(lambda x: (x['size']['h'] == 14) & (x['size']['uom'] == 'cm'))\\\n ... .skip(1)\\\n ... .where(lambda x: x['size']['w'] > 15)\\\n ... .get_reduce_info()\n >>> reduce_info.print()\n reduce info of:\n Queryable()\n .where( at 0x0000025DBC661EA0>)\n .skip(1)\n .where( at 0x0000025DBE957840>)\n =>\n [SQL] where( at 0x0000025DBC661EA0>)\n [SQL] skip(1)\n [MEM] where( at 0x0000025DBE957840>)\n\nyou can see the 1st ``where()`` and 1st ``skip()`` was success compile to SQL, and 2nd ``where()`` only work inside python process.\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Cologler/lquery-python", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "lquery", "package_url": "https://pypi.org/project/lquery/", "platform": "", "project_url": "https://pypi.org/project/lquery/", "project_urls": { "Homepage": "https://github.com/Cologler/lquery-python" }, "release_url": "https://pypi.org/project/lquery/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "", "version": "0.1.1" }, "last_serial": 4134557, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "e8656bb986776d7833822f0890e333e4", "sha256": "c66632ec02c6a55abeee0cffd03d60bc0808b6be3170e6b2e83a8983f0d5c946" }, "downloads": -1, "filename": "lquery-0.1.0-py3.6.egg", "has_sig": false, "md5_digest": "e8656bb986776d7833822f0890e333e4", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 26672, "upload_time": "2018-08-01T16:56:34", "url": "https://files.pythonhosted.org/packages/a2/e3/cd3822a94c9ca6463e9f0d23a560189d59cdc6161702b319383aa3f78d80/lquery-0.1.0-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "5d500337f4e1d4cbf67f2e25d2a5d679", "sha256": "6a454d4e8d952ff130a7cc4d0137edfa3897f4fd4c220e5b4bc3be9ec3f8bc41" }, "downloads": -1, "filename": "lquery-0.1.0.tar.gz", "has_sig": false, "md5_digest": "5d500337f4e1d4cbf67f2e25d2a5d679", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7773, "upload_time": "2018-08-01T16:56:31", "url": "https://files.pythonhosted.org/packages/d9/28/384ec12cffeccf6342baf685cbf2895aa1f27a88afb2c508d38ea21e060d/lquery-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "de7cc411c03cb820ec316cd0d651c52a", "sha256": "5fc3b6232ffbcb07dce1c7e6c1801ba9a9c19cab9f4ec50f30afdaf385bdc5f0" }, "downloads": -1, "filename": "lquery-0.1.1-py3.6.egg", "has_sig": false, "md5_digest": "de7cc411c03cb820ec316cd0d651c52a", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 71608, "upload_time": "2018-08-04T00:47:22", "url": "https://files.pythonhosted.org/packages/b5/15/69a167153e2421b288ffc6e3d8b72bbf0335452e8fdc1100e7d9b759f7a6/lquery-0.1.1-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "4647c26b5453b34fe91ece1e8b763ab6", "sha256": "ec5a8d2accba628fbf7695c869ce4c6e1f96dfa5caa8dc0c53d7a37e2bfdf2ed" }, "downloads": -1, "filename": "lquery-0.1.1.tar.gz", "has_sig": false, "md5_digest": "4647c26b5453b34fe91ece1e8b763ab6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14704, "upload_time": "2018-08-04T00:47:20", "url": "https://files.pythonhosted.org/packages/71/a7/9f2bad5b662b1954893b636fa9210b6a2e474368b87fe14ba4bcd503a8ca/lquery-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "de7cc411c03cb820ec316cd0d651c52a", "sha256": "5fc3b6232ffbcb07dce1c7e6c1801ba9a9c19cab9f4ec50f30afdaf385bdc5f0" }, "downloads": -1, "filename": "lquery-0.1.1-py3.6.egg", "has_sig": false, "md5_digest": "de7cc411c03cb820ec316cd0d651c52a", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 71608, "upload_time": "2018-08-04T00:47:22", "url": "https://files.pythonhosted.org/packages/b5/15/69a167153e2421b288ffc6e3d8b72bbf0335452e8fdc1100e7d9b759f7a6/lquery-0.1.1-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "4647c26b5453b34fe91ece1e8b763ab6", "sha256": "ec5a8d2accba628fbf7695c869ce4c6e1f96dfa5caa8dc0c53d7a37e2bfdf2ed" }, "downloads": -1, "filename": "lquery-0.1.1.tar.gz", "has_sig": false, "md5_digest": "4647c26b5453b34fe91ece1e8b763ab6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14704, "upload_time": "2018-08-04T00:47:20", "url": "https://files.pythonhosted.org/packages/71/a7/9f2bad5b662b1954893b636fa9210b6a2e474368b87fe14ba4bcd503a8ca/lquery-0.1.1.tar.gz" } ] }