{ "info": { "author": "@LoisaidaSam", "author_email": "sam.sandberg@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# csv-position-reader\n\nA custom CSV reader implementation with direct file access\n\nThe default builtin Python `csv` lib uses an `8KB` read-ahead buffer on the file pointer, making `fp.tell()` yield inaccurate results. This library addresses that head on, explicitly passing back the file pointer position with each row, as well as allowing for direct seeking.\n\nReferences:\n\n- https://docs.python.org/2/library/csv.html\n- https://stackoverflow.com/questions/14145082/file-tell-inconsistency/14145118#14145118\n- https://stackoverflow.com/questions/12109622/how-to-know-the-byte-position-of-a-row-of-a-csv-file-in-python/12110160#12110160\n\n## Usage\n\n```python\n>>> import csv_position_reader\n\n>>> with open('tests/data/basic.csv', 'r') as fp:\n... reader = csv_position_reader.DictReader(fp)\n... position, row = reader.next()\n... print \"position: %s\" % position\n... print \"row: %s\" % row\n... reader.seek(position)\n... position_new, row_new = reader.next()\n... assert position == position_new\n... assert row == row_new\n... \nposition: 26\nrow: {'city': 'Atlanta', 'favorite_color': 'black', 'name': 'Sam'}\n```\n\n## Why? / Who Cares?\n\nBecause after poring through a CSV one time, you can now build a dictionary/cache of where each row lives for future `O(1)` access! You're now a stone's throw away from a CSV-driven database!\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://github.com/loisaidasam/csv-position-reader", "keywords": "csv", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "csv-position-reader", "package_url": "https://pypi.org/project/csv-position-reader/", "platform": "", "project_url": "https://pypi.org/project/csv-position-reader/", "project_urls": { "Homepage": "https://github.com/loisaidasam/csv-position-reader" }, "release_url": "https://pypi.org/project/csv-position-reader/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "A custom CSV reader implementation with direct file access", "version": "0.1.0" }, "last_serial": 4158102, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "8c272fb0dd865941233ee818a9ccddac", "sha256": "2e07e479946b0f9fc7a9ad227653abd12f89f5e2f6973d91624c28b4df542afd" }, "downloads": -1, "filename": "csv_position_reader-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8c272fb0dd865941233ee818a9ccddac", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3107, "upload_time": "2018-08-10T19:16:22", "url": "https://files.pythonhosted.org/packages/25/4b/2f1a0f5941263573a44ab956358417f54e6c1b3f6dc30f043d3db042470e/csv_position_reader-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e0c7117666eceb9da9ef880fb23cc0a2", "sha256": "4737871b2b23b3f88b5e3f396d1b41ece7d7477c8aa1f44398cbb660b57ca992" }, "downloads": -1, "filename": "csv-position-reader-0.1.0.tar.gz", "has_sig": false, "md5_digest": "e0c7117666eceb9da9ef880fb23cc0a2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2434, "upload_time": "2018-08-10T19:16:24", "url": "https://files.pythonhosted.org/packages/e7/88/895c475df026c17db44fd4b9d5c773123844c58e6395f0e99f713e72d124/csv-position-reader-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8c272fb0dd865941233ee818a9ccddac", "sha256": "2e07e479946b0f9fc7a9ad227653abd12f89f5e2f6973d91624c28b4df542afd" }, "downloads": -1, "filename": "csv_position_reader-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8c272fb0dd865941233ee818a9ccddac", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3107, "upload_time": "2018-08-10T19:16:22", "url": "https://files.pythonhosted.org/packages/25/4b/2f1a0f5941263573a44ab956358417f54e6c1b3f6dc30f043d3db042470e/csv_position_reader-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e0c7117666eceb9da9ef880fb23cc0a2", "sha256": "4737871b2b23b3f88b5e3f396d1b41ece7d7477c8aa1f44398cbb660b57ca992" }, "downloads": -1, "filename": "csv-position-reader-0.1.0.tar.gz", "has_sig": false, "md5_digest": "e0c7117666eceb9da9ef880fb23cc0a2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2434, "upload_time": "2018-08-10T19:16:24", "url": "https://files.pythonhosted.org/packages/e7/88/895c475df026c17db44fd4b9d5c773123844c58e6395f0e99f713e72d124/csv-position-reader-0.1.0.tar.gz" } ] }