{ "info": { "author": "JoBrad", "author_email": "jtbradley+petlfwf@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# petl_fwf\nThis package contains two additional methods which add the ability to read fixed-width files to the fabulous [petl package](https://github.com/petl-developers/petl). \n\n## fromfwf\nThis is the primary method which this package adds. Usage is straightforward, and similar to other methods in the petl library\n\n```sh\n >>> import fromfwf\n >>> # setup a sample file\n ... text = ' 18 5 2\\\\n2018 5 2\\\\n20180502'\n >>> with open('example.txt', 'w') as f:\n ... f.write(text)\n ...\n 28\n >>> table1 = etl.fromfwf('example.txt', widths=[4, 2, 2])\n >>> table1\n +--------+------+------+\n | lines | | |\n +========+======+======+\n | ' 18' | ' 5' | ' 2' |\n +--------+------+------+\n | '2018' | ' 5' | ' 2' |\n +--------+------+------+\n | '2018' | '05' | '02' |\n +--------+------+------+\n >>> # Specify headers for the file\n ... table1 = etl.fromfwf('example.txt', widths=[4, 2, 2], header=['year', 'month', 'day'])\n >>> table1\n +--------+-------+------+\n | year | month | day |\n +========+=======+======+\n | ' 18' | ' 5' | ' 2' |\n +--------+-------+------+\n | '2018' | ' 5' | ' 2' |\n +--------+-------+------+\n | '2018' | '05' | '02' |\n +--------+-------+------+\n```\n\n## skiplast\nThis method will skip the last n rows of a table.\n```sh\n >>> import petl as etl\n >>> table1 = [['foo', 'bar'],\n ... ['a', 1],\n ... ['b', 2],\n ... ['c', 3],\n ... ['FOOTER ROW']]\n >>> table2 = etl.skiplast(table1, 1)\n >>> table2\n +-----+-----+\n | foo | bar |\n +=====+=====+\n | 'a' | 1 |\n +-----+-----+\n | 'b' | 2 |\n +-----+-----+\n | 'c' | 3 |\n +-----+-----+\n```", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/JoBrad/petl_fwf", "keywords": "petl fixed-width text", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "petl-fwf", "package_url": "https://pypi.org/project/petl-fwf/", "platform": "", "project_url": "https://pypi.org/project/petl-fwf/", "project_urls": { "Homepage": "https://github.com/JoBrad/petl_fwf" }, "release_url": "https://pypi.org/project/petl-fwf/0.0.2/", "requires_dist": null, "requires_python": ">=2.7", "summary": "Additional methods for the petl library that enable reading fixed-width files", "version": "0.0.2" }, "last_serial": 4167392, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "ba481afa3a608d4c0bfcfa0809abeef3", "sha256": "49587006a26a97cdddc753f9197a4493b65134bcf5d3ae841ecf3bb215fd2ab4" }, "downloads": -1, "filename": "petl_fwf-0.0.2.tar.gz", "has_sig": false, "md5_digest": "ba481afa3a608d4c0bfcfa0809abeef3", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 5290, "upload_time": "2018-08-14T01:22:49", "url": "https://files.pythonhosted.org/packages/e7/f4/01da5477a4595537bbef0f7fef0373856a298b365a17f2d5661a338febd1/petl_fwf-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ba481afa3a608d4c0bfcfa0809abeef3", "sha256": "49587006a26a97cdddc753f9197a4493b65134bcf5d3ae841ecf3bb215fd2ab4" }, "downloads": -1, "filename": "petl_fwf-0.0.2.tar.gz", "has_sig": false, "md5_digest": "ba481afa3a608d4c0bfcfa0809abeef3", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 5290, "upload_time": "2018-08-14T01:22:49", "url": "https://files.pythonhosted.org/packages/e7/f4/01da5477a4595537bbef0f7fef0373856a298b365a17f2d5661a338febd1/petl_fwf-0.0.2.tar.gz" } ] }