{ "info": { "author": "MonetDB BV", "author_email": "info@monetdb.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: Other/Proprietary License", "Topic :: Database", "Topic :: Database :: Database Engines/Servers" ], "description": ".. The contents of this file are subject to the MonetDB Public License\n.. Version 1.1 (the \"License\"); you may not use this file except in\n.. compliance with the License. You may obtain a copy of the License at\n.. http://www.monetdb.org/Legal/MonetDBLicense\n..\n.. Software distributed under the License is distributed on an \"AS IS\"\n.. basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the\n.. License for the specific language governing rights and limitations\n.. under the License.\n..\n.. The Original Code is the MonetDB Database System.\n..\n.. The Initial Developer of the Original Code is CWI.\n.. Portions created by CWI are Copyright (C) 1997-July 2008 CWI.\n.. Copyright August 2008-2015 MonetDB B.V.\n.. All Rights Reserved.\n\n.. This document is written in reStructuredText (see\n http://docutils.sourceforge.net/ for more information).\n Use ``rst2html.py`` to convert this file to HTML.\n\n=======================================================================\nThe MonetDB MAPI and SQL client Python API, with Async and COPY support\n=======================================================================\n\nThis version of the Python 3 MonetDB client includes some additional features to support bulk copy operations\n\nIntroduction\n============\n\nThis is the new native Python client API. This API is cross-platform,\nand doesn't depend on any monetdb libraries. It has support for\nPython 3.2+ and is Python DBAPI 2.0 compatible.\n\nThis is a fork of the code distributed with MonetDB that adds support\nfor asynchronous operation (requires greenlet_) and bulk I/O\nwith ``COPY``.\n\n.. _greenlet: https://greenlet.readthedocs.org/en/latest/\n\n\nInstallation\n============\n\nTo install the MonetDB Python API run the following command from the\npython source directory::\n\n # python setup.py install\n\nThat's all, now you are ready to start using the API.\n\n\nDocumentation\n=============\n\nThe Python code is well documented, so if you need to find\ndocumentation you should have a look at the source code. Below is an\ninteractive example on how to use the MonetDB SQL API which should get\nyou started quite fast.\n\n\nExamples\n========\n\nThere are some examples in the 'examples' folder, but here are is a\nline by line example of the SQL API::\n\n > # import the SQL module\n > import monetdb.sql\n >\n > # set up a connection. arguments below are the defaults\n > connection = monetdb.sql.connect(username=\"monetdb\", password=\"monetdb\", hostname=\"localhost\", database=\"demo\")\n >\n > # create a cursor\n > cursor = connection.cursor()\n >\n > # increase the rows fetched to increase performance (optional)\n > cursor.arraysize = 100\n >\n > # execute a query (return the number of rows to fetch)\n > cursor.execute('SELECT * FROM tables')\n 26\n >\n > # fetch only one row\n > cursor.fetchone()\n [1062, 'schemas', 1061, None, 0, True, 0, 0]\n >\n > # fetch the remaining rows\n > cursor.fetchall()\n [[1067, 'types', 1061, None, 0, True, 0, 0],\n [1076, 'functions', 1061, None, 0, True, 0, 0],\n [1085, 'args', 1061, None, 0, True, 0, 0],\n [1093, 'sequences', 1061, None, 0, True, 0, 0],\n [1103, 'dependencies', 1061, None, 0, True, 0, 0],\n [1107, 'connections', 1061, None, 0, True, 0, 0],\n [1116, '_tables', 1061, None, 0, True, 0, 0],\n ...\n [4141, 'user_role', 1061, None, 0, True, 0, 0],\n [4144, 'auths', 1061, None, 0, True, 0, 0],\n [4148, 'privileges', 1061, None, 0, True, 0, 0]]\n >\n > # Show the table meta data\n > cursor.description\n [('id', 'int', 4, 4, None, None, None),\n ('name', 'varchar', 12, 12, None, None, None),\n ('schema_id', 'int', 4, 4, None, None, None),\n ('query', 'varchar', 168, 168, None, None, None),\n ('type', 'smallint', 1, 1, None, None, None),\n ('system', 'boolean', 5, 5, None, None, None),\n ('commit_action', 'smallint', 1, 1, None, None, None),\n ('temporary', 'tinyint', 1, 1, None, None, None)]\n\n\nIf you would like to communicate with the database at a lower level\nyou can use the MAPI library::\n\n > from monetdb import mapi\n > server = mapi.Server()\n > server.connect(hostname=\"localhost\", port=50000, username=\"monetdb\", password=\"monetdb\", database=\"demo\", language=\"sql\")\n > server.cmd(\"sSELECT * FROM tables;\")\n ...\n\nCopying a table from PostgreSQL (using the Psycopg2 driver) to MonetDB::\n\n data = io.StringIO()\n\n pg_cursor = pg_conn.cursor()\n pg_cursor.copy_expert(\n \"\"\"COPY {} TO STDOUT WITH CSV QUOTE '\"' ESCAPE '\\\\' NULL ''\"\"\".format(pg_table), data)\n data.seek(0)\n\n monetdb_cursor = monetdb_conn.cursor()\n monetdb_cursor.copy_from(data, monetdb_table, string_quote='\"', null_string='')\n monetdb_conn.commit()\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "http://dev.monetdb.org/downloads/sources/Oct2014-SP2/python3-monetdb-11.19.9.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://www.monetdb.org/", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "dw-python-monetdb-async", "package_url": "https://pypi.org/project/dw-python-monetdb-async/", "platform": "", "project_url": "https://pypi.org/project/dw-python-monetdb-async/", "project_urls": { "Download": "http://dev.monetdb.org/downloads/sources/Oct2014-SP2/python3-monetdb-11.19.9.tar.gz", "Homepage": "http://www.monetdb.org/" }, "release_url": "https://pypi.org/project/dw-python-monetdb-async/12.0.2/", "requires_dist": [ "greenlet (==0.4.14)" ], "requires_python": "", "summary": "Native MonetDB client Python API", "version": "12.0.2" }, "last_serial": 4098062, "releases": { "11.19.9": [ { "comment_text": "", "digests": { "md5": "fff255740a1e092d38e7e47c4040d260", "sha256": "04bce94f57514b088a8338f0d5ecd2e8dd10ac1185434b142f97e1bb10b93797" }, "downloads": -1, "filename": "dw_python_monetdb_async-11.19.9-py3-none-any.whl", "has_sig": false, "md5_digest": "fff255740a1e092d38e7e47c4040d260", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 26468, "upload_time": "2018-07-18T00:52:21", "url": "https://files.pythonhosted.org/packages/9a/d4/b7656316c2b6e44d7b1284a742b0843f039cad3aa686758ac3f643877037/dw_python_monetdb_async-11.19.9-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7d71d080f2a7e394831eea3c4f3b9b0b", "sha256": "71799bc59ae3dace637bcfd27212c228bcd50ee3afc5e8647c4fb82e5f55cd5a" }, "downloads": -1, "filename": "dw-python-monetdb-async-11.19.9.tar.gz", "has_sig": false, "md5_digest": "7d71d080f2a7e394831eea3c4f3b9b0b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22275, "upload_time": "2018-07-18T00:52:22", "url": "https://files.pythonhosted.org/packages/97/a7/d843d5876a178f3f74d3af9d5b83cec0545fadce25eff9081627728f8a7d/dw-python-monetdb-async-11.19.9.tar.gz" } ], "12.0.1": [ { "comment_text": "", "digests": { "md5": "6275cd01b9bf0b5f64d21999b245b4e8", "sha256": "94c32c7bb05072f9f3485c543e8f13e1b0b1e41bf9a5fd4d9c910059e5126426" }, "downloads": -1, "filename": "dw_python_monetdb_async-12.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "6275cd01b9bf0b5f64d21999b245b4e8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 26474, "upload_time": "2018-07-18T01:02:39", "url": "https://files.pythonhosted.org/packages/20/7e/9a60596d849754e9071042fbf72da319898789f2dda49b802b69d9df3c3a/dw_python_monetdb_async-12.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b6aeeb0d0f245363ff4d25b1a2a522e5", "sha256": "c5132640f6ce1331d3428f419570258d986c08aec2f8a3cd6924449643b08453" }, "downloads": -1, "filename": "dw-python-monetdb-async-12.0.1.tar.gz", "has_sig": false, "md5_digest": "b6aeeb0d0f245363ff4d25b1a2a522e5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22310, "upload_time": "2018-07-18T01:02:40", "url": "https://files.pythonhosted.org/packages/7b/75/3fe459f04f0b331627cd8ccd4512506e1949782fa19e9744913816dc339b/dw-python-monetdb-async-12.0.1.tar.gz" } ], "12.0.2": [ { "comment_text": "", "digests": { "md5": "1c90930f21a03aa65a682052e358f90f", "sha256": "f3b3b63439317181637a4d7f49d8bce84681a9776b87fe5a36c0d173e88f70a7" }, "downloads": -1, "filename": "dw_python_monetdb_async-12.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "1c90930f21a03aa65a682052e358f90f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 26490, "upload_time": "2018-07-24T18:38:58", "url": "https://files.pythonhosted.org/packages/75/a6/9fd5d4bcff899395094b3bf829cc6e1563d40da5e2cbd8e14b07bb9713e4/dw_python_monetdb_async-12.0.2-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1c90930f21a03aa65a682052e358f90f", "sha256": "f3b3b63439317181637a4d7f49d8bce84681a9776b87fe5a36c0d173e88f70a7" }, "downloads": -1, "filename": "dw_python_monetdb_async-12.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "1c90930f21a03aa65a682052e358f90f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 26490, "upload_time": "2018-07-24T18:38:58", "url": "https://files.pythonhosted.org/packages/75/a6/9fd5d4bcff899395094b3bf829cc6e1563d40da5e2cbd8e14b07bb9713e4/dw_python_monetdb_async-12.0.2-py3-none-any.whl" } ] }