{ "info": { "author": "Yohan Boniface, Zhou Qi", "author_email": "yohan.boniface@data.gouv.fr, bitwolaiye@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Topic :: Scientific/Engineering :: GIS" ], "description": "[![Circle CI](https://img.shields.io/circleci/project/yohanboniface/psycopg-postgis.svg)](https://circleci.com/gh/yohanboniface/psycopg-postgis) [![PyPI](https://img.shields.io/pypi/v/psycopg-postgis.svg)](https://pypi.python.org/pypi/psycopg-postgis) [![PyPI](https://img.shields.io/pypi/pyversions/psycopg-postgis.svg)](https://pypi.python.org/pypi/psycopg-postgis) [![PyPI](https://img.shields.io/pypi/implementation/psycopg-postgis.svg)](https://pypi.python.org/pypi/psycopg-postgis) [![PyPI](https://img.shields.io/pypi/status/psycopg-postgis.svg)](https://pypi.python.org/pypi/psycopg-postgis)\n\n# psycopg-postgis\n\nPostGIS helpers for psycopg2.\n\n## Install\n\n pip install psycopg-postgis\n\nIf you want a compiled version, first install `cython`:\n\n pip install cython\n pip install psycopg-postgis\n\n\n## Usage\n\nYou need to register the extension:\n\n > import postgis\n > postgis.register(mydatabase.get_cursor())\n\nThen you can pass python geometries instance to psycopg:\n\n > cursor.execute('INSERT INTO table (geom) VALUES (%s)', [Point(x=1, y=2, srid=4326)])\n\nAnd retrieve data as python geometries instances:\n\n > cursor.execute('SELECT geom FROM points LIMIT 1')\n > geom = cursor.fetchone()[0]\n > geom\n \n\n\n## Example\n\n > import psycopg2\n > from postgis import register, LineString\n > db = psycopg2.connect(dbname=\"test\")\n > cursor = db.cursor()\n > register(cursor)\n > cursor.execute('CREATE TABLE IF NOT EXISTS mytable (\"geom\" geometry(LineString) NOT NULL)')\n > cursor.execute('INSERT INTO mytable (geom) VALUES (%s)', [LineString([(1, 2), (3, 4)], srid=4326)])\n > cursor.execute('SELECT geom FROM mytable LIMIT 1')\n > geom = cursor.fetchone()[0]\n > geom\n \n > geom[0]\n \n > geom.coords\n ((1.0, 2.0), (3.0, 4.0))\n > geom.geojson\n {'coordinates': ((1.0, 2.0), (3.0, 4.0)), 'type': 'LineString'}\n > str(geom.geojson)\n '{\"type\": \"LineString\", \"coordinates\": [[1, 2], [3, 4]]}'", "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/bitwolaiye/psycopg-postgis", "keywords": "psycopg postgis gis python2", "license": "WTFPL", "maintainer": null, "maintainer_email": null, "name": "psycopg-postgis2", "package_url": "https://pypi.org/project/psycopg-postgis2/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/psycopg-postgis2/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/bitwolaiye/psycopg-postgis" }, "release_url": "https://pypi.org/project/psycopg-postgis2/0.0.2/", "requires_dist": null, "requires_python": null, "summary": "Pyscopg helpers to work with PostGIS.", "version": "0.0.2" }, "last_serial": 2486135, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "b57e3f7a64773df09f524af65cd05330", "sha256": "b8fd24dc675f83c8f3d258ece3080e42deda3b2a9f32ae4b1201dea88fbb3ed3" }, "downloads": -1, "filename": "psycopg-postgis2-0.0.1.tar.gz", "has_sig": false, "md5_digest": "b57e3f7a64773df09f524af65cd05330", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5480, "upload_time": "2016-11-24T12:24:46", "url": "https://files.pythonhosted.org/packages/0b/46/27e0885c49c713ea7043442e04be040a80b1ea317cb6b9b8dedee8930974/psycopg-postgis2-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "dc7d4fe8876b7969e6f01fb044135dbe", "sha256": "2d85f501158dc9ef68e541a647a95d3ddc4d23681a6024cebda63b6584b6ee68" }, "downloads": -1, "filename": "psycopg-postgis2-0.0.2.tar.gz", "has_sig": false, "md5_digest": "dc7d4fe8876b7969e6f01fb044135dbe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5599, "upload_time": "2016-11-28T11:25:56", "url": "https://files.pythonhosted.org/packages/15/d1/5d431a9c924aba279cf017599ba133ea022f1270d01d50e760a222648417/psycopg-postgis2-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dc7d4fe8876b7969e6f01fb044135dbe", "sha256": "2d85f501158dc9ef68e541a647a95d3ddc4d23681a6024cebda63b6584b6ee68" }, "downloads": -1, "filename": "psycopg-postgis2-0.0.2.tar.gz", "has_sig": false, "md5_digest": "dc7d4fe8876b7969e6f01fb044135dbe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5599, "upload_time": "2016-11-28T11:25:56", "url": "https://files.pythonhosted.org/packages/15/d1/5d431a9c924aba279cf017599ba133ea022f1270d01d50e760a222648417/psycopg-postgis2-0.0.2.tar.gz" } ] }