{ "info": { "author": "Alister Cordiner", "author_email": "alister@cordiner.net", "bugtrack_url": null, "classifiers": [], "description": "==============\nCSV Query Tool\n==============\n\nThis module provides a very simple command-line tool for running arbitrary SQL \nqueries on CSV files. It's useful for situations where you need to quickly \nexplore and manipulate CSV files, where using a full database is often overkill.\n\nSay we have the following two files:\n\n*employees.csv:*\n\n::\n\n surname,department_id\n Rafferty,31\n Jones,33\n Steinberg,33\n Robinson,34\n Smith,34\n John,\n\n*departments.csv:*\n\n::\n\n department_id,department_name\n 31,Sales\n 33,Engineering\n 34,Clerical\n 35,Marketing\n\nLet's load these two CSV files:\n\n::\n\n $ csvquery employees.csv departments.csv\n\nAt this point, you will be presented with an interactive SQL console:\n\n::\n\n * file 'employees.csv' loaded into table 'csv'\n * file 'departments.csv' loaded into table 'csv2'\n SQL Interactive Console\n =>\n\nYou can see that the file ``employees.csv`` was loaded into an SQL table named\n``csv`` and the file ``departments.csv`` into a table named ``csv2``. From here,\nyou can start running whatever SQL queries you want.\n\nLet's select all of the records from the employees table:\n\n::\n\n => SELECT * FROM csv\n surname,department_id\n Rafferty,31\n Jones,33\n Steinberg,33\n Robinson,34\n Smith,34\n John,None\n\nAnd now let's join the employees table to the departments table:\n\n::\n\n => SELECT csv.surname, csv2.department_name FROM csv NATURAL JOIN csv2\n surname,department_name\n Rafferty,Sales\n Jones,Engineering\n Steinberg,Engineering\n Robinson,Clerical\n Smith,Clerical\n\nPress ^D to exit the SQL console when you are done.\n\nYou can also specify an SQL query as an argument to ``csvquery`` (which is more \nuseful for scripts, where you can't use the interactive console):\n\n::\n\n $ csvquery -q \"SELECT csv.surname, csv2.department_name FROM csv NATURAL JOIN csv2\" departments.csv\n\nThe output of this command is CSV formatted, so it can be redirected to an \noutput CSV file if required:\n\n::\n\n $ csvquery -q \"SELECT csv.surname, csv2.department_name FROM csv NATURAL JOIN csv2\" departments.csv > employee_departments.csv\n\n**Warning:** All of the input CSV files are loaded into memory to perform the \nqueries. This means that this module is not appropriate for processing very \nlarge CSV files.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://bitbucket.org/acordiner/csvquerytool/", "keywords": null, "license": "http://www.gnu.org/licenses/gpl.html", "maintainer": null, "maintainer_email": null, "name": "csvquerytool", "package_url": "https://pypi.org/project/csvquerytool/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/csvquerytool/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://bitbucket.org/acordiner/csvquerytool/" }, "release_url": "https://pypi.org/project/csvquerytool/0.0.3/", "requires_dist": null, "requires_python": null, "summary": "Execute SQL queries on CSV files.", "version": "0.0.3" }, "last_serial": 788599, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "40213f389979414bff23552b7d6333c4", "sha256": "3c22cdc9eeeacef66dce91607b06e9093b7dc199faca279afae03dfb7858b0ad" }, "downloads": -1, "filename": "csvquerytool-0.0.1.tar.gz", "has_sig": false, "md5_digest": "40213f389979414bff23552b7d6333c4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10890, "upload_time": "2012-11-09T02:42:48", "url": "https://files.pythonhosted.org/packages/02/40/cfe83f774890fce690400275113587f912e6df826cd7cd8a423a9bbcf825/csvquerytool-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "81c825b7ef4e9b101d0df553954ea6da", "sha256": "821312b41a04d7298fde2fa89e313e0714d2ba94de4ce7b9dd45e22232ef65a5" }, "downloads": -1, "filename": "csvquerytool-0.0.2.tar.gz", "has_sig": false, "md5_digest": "81c825b7ef4e9b101d0df553954ea6da", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3765, "upload_time": "2012-11-09T07:05:33", "url": "https://files.pythonhosted.org/packages/bb/77/ef529916d48f27f68c72a042856e211d585603eb07e781abaccc23b49918/csvquerytool-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "2e4632d2e8bf3cb7fc059b354b674860", "sha256": "528c38ae55e6ef461d47afad1928dd478b28f2bb7347d7bc5a0dd1d624175310" }, "downloads": -1, "filename": "csvquerytool-0.0.3.tar.gz", "has_sig": false, "md5_digest": "2e4632d2e8bf3cb7fc059b354b674860", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5473, "upload_time": "2012-11-19T04:19:27", "url": "https://files.pythonhosted.org/packages/09/79/01cbb5a414d1aa993f8e2d65fdcaf996ae9897483c52756b74f75a030514/csvquerytool-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2e4632d2e8bf3cb7fc059b354b674860", "sha256": "528c38ae55e6ef461d47afad1928dd478b28f2bb7347d7bc5a0dd1d624175310" }, "downloads": -1, "filename": "csvquerytool-0.0.3.tar.gz", "has_sig": false, "md5_digest": "2e4632d2e8bf3cb7fc059b354b674860", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5473, "upload_time": "2012-11-19T04:19:27", "url": "https://files.pythonhosted.org/packages/09/79/01cbb5a414d1aa993f8e2d65fdcaf996ae9897483c52756b74f75a030514/csvquerytool-0.0.3.tar.gz" } ] }