{ "info": { "author": "IST-SUPSI", "author_email": "geoservice@supsi.ch", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Programming Language :: Python :: 3 :: Only" ], "description": "# istSOS\ud835\udf07 protocol buffer repository.\n\nThis module contains all the proto files of istsos.\n\n## Qry Utils\n\n## Simple usage example\n\n```python\n\nfrom istsosproto import qry\n\nconditions = qry(\n {\n \"value\": \"value_obs\",\n \"updated\": \"updated_obs\"\n }\n).get_conditions(\n Where(\n operator=Where.AND,\n where=[\n Where(\n operator=Where.GREATER_THAN,\n property='value',\n measure=2.0\n ),\n Where(\n operator=Where.NOT_NULL,\n property='updated'\n )\n ]\n )\n)\n\nprint(conditions)\n\n```\n\n*get_conditions* call returns a tuple with the SQL and a list of parameters: \n\n```python\n('(value_obs > $1 AND updated_obs IS NOT NULL)', [2.0])\n```\n\n## Comparison operators\n\nSupported operators:\n\n- NULL\n- NOT_NULL\n- EQUALS\n- NOT_EQUALS\n- LIKE\n- GREATER_THAN\n- GREATER_THAN_OR_EQUAL_TO\n- LESS_THAN\n- LESS_THAN_OR_EQUAL_TO\n\n### NULL\n\n```python\nWhere(\n operator=Where.NULL,\n property='updated'\n)\n```\nresult:\n\n```python\n(\n \"updated IS NULL\",\n []\n)\n```\n\n### NOT_NULL\n\n```python\nWhere(\n operator=Where.EQUALS,\n property='updated'\n)\n```\nresult:\n\n```python\n(\n \"updated IS NOT NULL\",\n []\n)\n```\n\n### EQUALS\n\n```python\nWhere(\n operator=Where.EQUALS,\n property='value',\n mesaure=10.9\n)\n```\nresult:\n\n```python\n(\n \"value = $1\",\n [10.9]\n)\n```\n\n### NOT_EQUALS\n\n```python\nWhere(\n operator=Where.NOT_EQUALS,\n property='value',\n mesaure=10.9\n)\n```\nresult:\n\n```python\n(\n \"value <> $1\",\n [10.9]\n)\n```\n\n### LIKE\n\n```python\nWhere(\n operator=Where.LIKE,\n property='name',\n text='%foo'\n)\n```\nresult:\n\n```python\n(\n \"name IS LIKE $1\",\n ['%foo]\n)\n```\n\n## Usage with function\n\nSupported functions are:\n\n- STARTS_WITH\n- ST_INTERSECTS\n- ST_DWITHIN\n- ST_CONTAINS\n\n\n### INTERSECTS\n\n```python\n\nfrom qry import *\n\nconditions = qry(\n {\n \"geom\": \"geom_loc\"\n }\n).get_conditions(\n Where(\n function=Where.ST_INTERSECTS,\n property='geom',\n ewkt='SRID=4326;BOX(-180 -90, 180 90)'\n )\n)\n\nprint(conditions)\n\n```\n*get_conditions* call returns a tuple with the SQL and a list of parameters: \n\n```python\n(\n \"ST_Intersects(geom_loc, ST_GeomFromEWKT($1))\",\n ['SRID=4326;BOX(-180 -90, 180 90)']\n)\n```\n\n### DWITHIN\n\n```python\n\nfrom qry import *\n\nconditions = qry(\n {\n \"geom\": \"geom_loc\"\n }\n).get_conditions(\n Where(\n function=Where.ST_DWITHIN,\n property='geom',\n ewkt='SRID=3857;POINT(3072163.4 7159374.1)',\n xmeasure=200\n )\n)\n\nprint(conditions)\n\n```\n\n*get_conditions* call returns a tuple with the SQL and a list of parameters: \n\n```python\n(\n \"ST_DWithin(geom_loc, ST_GeomFromEWKT($1), $2)\",\n ['SRID=4326;BOX(-180 -90, 180 90)', 200]\n)\n```\n\n### CONTAINS\n\n```python\n\nfrom qry import *\n\nconditions = qry(\n {\n \"geom\": \"geom_loc\"\n }\n).get_conditions(\n Where(\n function=Where.ST_CONTAINS,\n property='geom',\n ewkt='SRID=3857;POINT(3072163.4 7159374.1)',\n xmeasure=200\n )\n)\n\nprint(conditions)\n\n```\n\n*get_conditions* call returns a tuple with the SQL and a list of parameters: \n\n```python\n(\n \"ST_Contains(geom_loc, ST_GeomFromEWKT($1))\",\n ['SRID=3857;POINT(3072163.4 7159374.1)']\n)\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://gitlab.com/ist-supsi/istsosm/libs/istsos-grpc", "keywords": "istsos grpc", "license": "", "maintainer": "", "maintainer_email": "", "name": "istsos-proto", "package_url": "https://pypi.org/project/istsos-proto/", "platform": "", "project_url": "https://pypi.org/project/istsos-proto/", "project_urls": { "Documentation": "https://gitlab.com/ist-supsi/istsosm/libs/istsos-grpc", "Homepage": "https://gitlab.com/ist-supsi/istsosm/libs/istsos-grpc", "Source": "https://gitlab.com/ist-supsi/istsosm/libs/istsos-grpc", "Tracker": "https://gitlab.com/ist-supsi/istsosm/libs/istsos-grpc/issues" }, "release_url": "https://pypi.org/project/istsos-proto/0.0.1b3/", "requires_dist": [ "googleapis-common-protos", "grpcio-tools", "grpclib", "protobuf" ], "requires_python": ">=3, <4", "summary": "Module containing all istsos compiled proto files.", "version": "0.0.1b3" }, "last_serial": 5613549, "releases": { "0.0.1b2": [ { "comment_text": "", "digests": { "md5": "5a55541a2786bec6f58d73d5b08a70cd", "sha256": "e26090bf306ce2922efa6e99778b8e59fe3be7c1a845c1e2ec4c17e329d8f3cb" }, "downloads": -1, "filename": "istsos_proto-0.0.1b2-py3-none-any.whl", "has_sig": false, "md5_digest": "5a55541a2786bec6f58d73d5b08a70cd", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3, <4", "size": 19429, "upload_time": "2019-07-25T16:23:05", "url": "https://files.pythonhosted.org/packages/16/90/e3034ba53df9b26d29ade223c699b3f5ac3ee6ba5ba525d32c92336ce357/istsos_proto-0.0.1b2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "76ee768e4d5f0fc75f473d75bf0fcd83", "sha256": "4a4384671a0785d12e0580f8f06c17819bc447c46f04779a34f719b80d3ebc87" }, "downloads": -1, "filename": "istsos-proto-0.0.1b2.tar.gz", "has_sig": false, "md5_digest": "76ee768e4d5f0fc75f473d75bf0fcd83", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3, <4", "size": 12651, "upload_time": "2019-07-25T16:23:07", "url": "https://files.pythonhosted.org/packages/51/10/82a85c1d16860c1d8969d90b5d40ac18a3b23bb44e663189f1a3834432e5/istsos-proto-0.0.1b2.tar.gz" } ], "0.0.1b3": [ { "comment_text": "", "digests": { "md5": "9ba350dfd31c589348d3f57816ba744a", "sha256": "b4d245aebe4ab0d84f9a4f6c27b4c096810225409514384fdda968724394ac4d" }, "downloads": -1, "filename": "istsos_proto-0.0.1b3-py3-none-any.whl", "has_sig": false, "md5_digest": "9ba350dfd31c589348d3f57816ba744a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3, <4", "size": 21513, "upload_time": "2019-07-31T13:53:51", "url": "https://files.pythonhosted.org/packages/60/80/40711b7b3313d6516cde6caeaea7e7fb06d121b1c17397db403ba8825d4d/istsos_proto-0.0.1b3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0334a154caee6bd334039573d1a63c40", "sha256": "b3d1a52908c4c611fa8796b2edce4146f627558da3fd35a36ced04b9c5a1fe52" }, "downloads": -1, "filename": "istsos-proto-0.0.1b3.tar.gz", "has_sig": false, "md5_digest": "0334a154caee6bd334039573d1a63c40", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3, <4", "size": 15063, "upload_time": "2019-07-31T13:53:53", "url": "https://files.pythonhosted.org/packages/7e/6c/0c75f1f434e03dc3c5e6423c5e2ef16e1b908592f75a3f67ef801c6e9a1d/istsos-proto-0.0.1b3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9ba350dfd31c589348d3f57816ba744a", "sha256": "b4d245aebe4ab0d84f9a4f6c27b4c096810225409514384fdda968724394ac4d" }, "downloads": -1, "filename": "istsos_proto-0.0.1b3-py3-none-any.whl", "has_sig": false, "md5_digest": "9ba350dfd31c589348d3f57816ba744a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3, <4", "size": 21513, "upload_time": "2019-07-31T13:53:51", "url": "https://files.pythonhosted.org/packages/60/80/40711b7b3313d6516cde6caeaea7e7fb06d121b1c17397db403ba8825d4d/istsos_proto-0.0.1b3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0334a154caee6bd334039573d1a63c40", "sha256": "b3d1a52908c4c611fa8796b2edce4146f627558da3fd35a36ced04b9c5a1fe52" }, "downloads": -1, "filename": "istsos-proto-0.0.1b3.tar.gz", "has_sig": false, "md5_digest": "0334a154caee6bd334039573d1a63c40", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3, <4", "size": 15063, "upload_time": "2019-07-31T13:53:53", "url": "https://files.pythonhosted.org/packages/7e/6c/0c75f1f434e03dc3c5e6423c5e2ef16e1b908592f75a3f67ef801c6e9a1d/istsos-proto-0.0.1b3.tar.gz" } ] }