{ "info": { "author": "Tom Elliott", "author_email": "tom.elliott@nyu.edu", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Affero General Public License v3", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Text Processing :: Linguistic" ], "description": "encoded_csv\n===========\n\nCould that CSV file be encoded in something other than ASCII? No problem.\n\nThis package provides support for reading CSV files that use arbitrary text encodings. It is built on top of Python's standard `csv `_ and `codecs `_ packages, and it uses `Daniel Blanchard's ``chardet`` universal encoding detector `_ to guess the encoding for a file, if necessary. \n\nNote that ``utf-8-sig`` (UTF-8 with leading `Byte Order Mark `_\\ ) is supported. This format is used by recent versions of Microsoft Excel when the user selects \"Save As ...\" and chooses the \"CSV UTF-8.\"\n\ninstallation\n------------\n\n.. code-block::\n\n pip install encoded_csv\n\nusing it\n--------\n\nThere's just one function: ``get_csv()``\\ , as follows:\n\n.. code-block:: python\n\n encoded_csv.get_csv(csv_file, skip_lines=0, encoding='', dialect='', fieldnames=[], sample_lines=100)\n\nCode in the ``tests/`` directory provides usage examples. The function returns a tuple, in which the first item is a list of the field names. The second item is a list of ordered dictionaries, each containing the data read from a given line of the CSV file.\n\nThe first row (after discarding any header lines) is assumed to contain column names.\n\nKeyword arguments:\n\n\n* ``csv_file`` -- path to CSV file to open\n* ``skip_header_lines`` -- (optional) number of lines to discard in the assumption that they constitute a file header of some sort (default is to skip no lines)\n* ``encoding`` -- (optional) specifies the encoding which is to be used for the file; `the standard python ``codecs`` module `_ is used, so any of `the standard encodings `_ may be specified; default behavior is to attempt best guess using ``chardet``\\ )\n* ``dialect`` -- (optional) a set of parameters specific to a particular CSV dialect; `the standard python ``csv`` module `_ is used, so `the standard, predefined ``dialect`` values or formatting parameters `_ must be used; default behavior is to attempt best guess using ``csv.Sniffer``.\n* ``fieldnames`` -- (optional) is used to force the `csv.DictReader `_ to use a particular set of fieldnames. \n* ``sample_lines`` -- (optional) integer used to prepare the sample given to ``csv.Sniffer()`` when attempting to detect the CSV dialect in use; default is 100 lines or the entire file, whichever is fewer.\n\netc.\n----\n\nBug reports and feature requests are welcome, but really I'd prefer pull requests.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://change.me", "keywords": "scripting,csv,i18n,encoding", "license": "LICENSE.txt", "maintainer": "", "maintainer_email": "", "name": "encoded-csv", "package_url": "https://pypi.org/project/encoded-csv/", "platform": "", "project_url": "https://pypi.org/project/encoded-csv/", "project_urls": { "Homepage": "http://change.me" }, "release_url": "https://pypi.org/project/encoded-csv/0.2/", "requires_dist": null, "requires_python": "", "summary": "Read a CSV file using arbitrary character encodings.", "version": "0.2" }, "last_serial": 3237401, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "ab7476a21e6cc03a58d91d168a7d64af", "sha256": "22bc58ad6f460b5c6969aaf346adb42cdafc4b131633a919ddf0f2d3f7ae95b5" }, "downloads": -1, "filename": "encoded_csv-0.2.tar.gz", "has_sig": false, "md5_digest": "ab7476a21e6cc03a58d91d168a7d64af", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16391, "upload_time": "2017-10-09T20:48:00", "url": "https://files.pythonhosted.org/packages/9e/3e/935e3043a863d3656fb136d9992589bf6a42f2dd10fb25fede2fa5c8c58e/encoded_csv-0.2.tar.gz" } ], "0.2.a2": [ { "comment_text": "", "digests": { "md5": "3b199fa3a2d031d03b8c5202da4414b6", "sha256": "2ff0c2a5ce7f518903bd35d13bfeaab3e3f86a9879b9355a6a9f487060569f7b" }, "downloads": -1, "filename": "encoded_csv-0.2.a2.tar.gz", "has_sig": false, "md5_digest": "3b199fa3a2d031d03b8c5202da4414b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16369, "upload_time": "2017-10-09T20:37:20", "url": "https://files.pythonhosted.org/packages/74/4c/043cfe7fce9aef732cc63da38688868ed8ea4ec63c632b77fe58d4ca325b/encoded_csv-0.2.a2.tar.gz" } ], "0.2a": [ { "comment_text": "", "digests": { "md5": "4d4a402e0667fa1df4c7eade99a336af", "sha256": "b43cfb2d6c1737a7015b56df9c7f0bb9957386edfc527f8b094c33b72519994a" }, "downloads": -1, "filename": "encoded_csv-0.2a.tar.gz", "has_sig": false, "md5_digest": "4d4a402e0667fa1df4c7eade99a336af", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16372, "upload_time": "2017-10-09T20:26:05", "url": "https://files.pythonhosted.org/packages/09/fa/9a937ca0ac55deb67cff5597257b8963985e4c9020c6305f481dbb094fa6/encoded_csv-0.2a.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ab7476a21e6cc03a58d91d168a7d64af", "sha256": "22bc58ad6f460b5c6969aaf346adb42cdafc4b131633a919ddf0f2d3f7ae95b5" }, "downloads": -1, "filename": "encoded_csv-0.2.tar.gz", "has_sig": false, "md5_digest": "ab7476a21e6cc03a58d91d168a7d64af", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16391, "upload_time": "2017-10-09T20:48:00", "url": "https://files.pythonhosted.org/packages/9e/3e/935e3043a863d3656fb136d9992589bf6a42f2dd10fb25fede2fa5c8c58e/encoded_csv-0.2.tar.gz" } ] }