{ "info": { "author": "ahuigo", "author_email": "ahui132@qq.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3" ], "description": "# Xcut\nXcut is an Enhanced cut command, which is used to help grep column.\n\n[![](https://img.shields.io/pypi/pyversions/xcut.svg?longCache=True)](https://pypi.org/pypi/xcut/)\n[![](https://img.shields.io/pypi/v/xcut.svg?maxAge=36000)](https://pypi.org/pypi/xcut/)\n[![Build Status](https://travis-ci.org/ahuigo/xcut.svg?branch=master)](https://travis-ci.org/ahuigo/xcut)\n\n## Install\n\n pip install xcut\n pip3 install xcut\n\n xcut --help\n\n## Usage\nLet's test a file named `test.csv`\n\n > ~ cat test/test.csv\n name,gender,job\n Jack,male,coder\n Lucy,female,artist\n\nCut fields\n\n > ~ xcut -f job,name test/test.csv\n job,name\n coder,Jack\n artist,Lucy\n\n### Set title type\nThe default title type is head: `-t head` \n\n > ~ xcut -f name,gender test/test.csv\n\nSet title type to index: `-t index`\n\n > ~ xcut -f 1,3 -t index test/test.csv\n 1,3\n name,job\n Jack,coder\n Lucy,artist\n\nSet title type to custom(`--titles TITLES`)\n\n > ~ xcut -f '\u804c\u4e1a,\u59d3\u540d' --titles '\u59d3\u540d,\u6027\u522b,\u804c\u4e1a' test/test.csv -od $'\\t'\n \u804c\u4e1a \u59d3\u540d\n job\tname\n coder\tJack\n artist\tLucy\n\nSet title type to kv(`-t kv`)\n\n > ~ echo 'key1=v1,key2=v2,key3=v3' | xcut -f key3,key2 -t kv\n key3,key2\n v3,v2\n\n### Set input delimiter(d)\n\n > ~ xcut -f job,name test/test.csv -d ',' -od '`'\n job`name\n coder`Jack\n artist`Lucy\n\n### Set output delimiter(od)\n\n > ~ xcut -f job,name test/test.csv -od '`' \n job`name\n coder`Jack\n artist`Lucy\n\n### pretty output \nYou could set the output delimiter(od), also you can print it via `pretty`\n\n > ~ xcut -f '\u804c\u4e1a,\u59d3\u540d' --titles '\u59d3\u540d,\u6027\u522b,\u804c\u4e1a' test/test.csv -od $'\\t\\t' --pretty\n \u804c\u4e1a \u59d3\u540d\n ----------------------------------------\n job name\n coder Jack\n artist Lucy\n\n### Use csv format\nNot only you could parse csv format file with `--from-csv`:\n\n $ echo 'Lucy,\"98,99\",23' | python xcut -f scores,name --titles name,scores,age\n scores,name\n \"98,Lucy\n\n $ echo 'Lucy,\"98,99\",23' | python xcut -f scores,name --titles name,scores,age --from-csv\n scores,name\n 98,99,Lucy\n\nYou could also save the output to csv format with(`--to-csv`)\n\n $ echo 'Lucy,\"98,99\",23' | python xcut -f scores,name --titles name,scores,age --from-csv --to-csv\n scores,name\n \"98,99\",Lucy\n\n## Required\n1. python>=3.5\n2. click\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": "http://github.com/ahuigo/xcut", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "xcut", "package_url": "https://pypi.org/project/xcut/", "platform": "", "project_url": "https://pypi.org/project/xcut/", "project_urls": { "Homepage": "http://github.com/ahuigo/xcut" }, "release_url": "https://pypi.org/project/xcut/0.0.10/", "requires_dist": [ "click" ], "requires_python": ">=3.6.1", "summary": "Xcut is an Enhanced cut command, which is used to help grep column.", "version": "0.0.10" }, "last_serial": 4139141, "releases": { "0.0.10": [ { "comment_text": "", "digests": { "md5": "130198614acf94c5532b7e185cc12635", "sha256": "792c44de05f0f9f3a2f670958b57ecd2b0fbac84f2b572858bf49da0212ed879" }, "downloads": -1, "filename": "xcut-0.0.10-py3-none-any.whl", "has_sig": false, "md5_digest": "130198614acf94c5532b7e185cc12635", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6.1", "size": 3473, "upload_time": "2018-08-06T04:41:53", "url": "https://files.pythonhosted.org/packages/91/ee/a37e94efaa39095c34da43fe977012fdba72d1d59fb3b127b4894cc1f614/xcut-0.0.10-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "33545f55db7d61f072758e5a441dcf20", "sha256": "9496398aed7409ca87f97b5b0ffe501103bbac46eddcdea6a255e2b7b5e6142d" }, "downloads": -1, "filename": "xcut-0.0.10.tar.gz", "has_sig": false, "md5_digest": "33545f55db7d61f072758e5a441dcf20", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.1", "size": 3624, "upload_time": "2018-08-06T04:41:55", "url": "https://files.pythonhosted.org/packages/13/81/19496391315419c7ccc36d3f592f4dbd72ecc17a77dfb31ba1b4afacf8cb/xcut-0.0.10.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "4efdf696395251181b2e1776ff34e67d", "sha256": "5e1a7a7fbc25cba58d08bf28f0d636a013ebef545b629a392cb9e862eb96b5d4" }, "downloads": -1, "filename": "xcut-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "4efdf696395251181b2e1776ff34e67d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6.1", "size": 3238, "upload_time": "2018-07-24T08:26:37", "url": "https://files.pythonhosted.org/packages/67/2f/3c46c1314d452b2b1844b74461690492a061e4314bfe73cbcfc771d4a27d/xcut-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3bdbb0462c582beeb6c4f037fef9d4eb", "sha256": "1cfc861777d6d19c541bdf681d940ec01e3423d2cc9ed0d2de3685bac846647b" }, "downloads": -1, "filename": "xcut-0.0.4.tar.gz", "has_sig": false, "md5_digest": "3bdbb0462c582beeb6c4f037fef9d4eb", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.1", "size": 3150, "upload_time": "2018-07-24T08:26:39", "url": "https://files.pythonhosted.org/packages/81/a1/8ea1f54c45672b494f5a098953584f4358c38056937f1fd496114fa9077e/xcut-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "05b0e408e637f4f1c7b3b0f55e18bddc", "sha256": "cecdffc432847778a51a6201af3672e64ad469b091f4fd944595d7e9cf56e031" }, "downloads": -1, "filename": "xcut-0.0.5.tar.gz", "has_sig": false, "md5_digest": "05b0e408e637f4f1c7b3b0f55e18bddc", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.1", "size": 3293, "upload_time": "2018-07-24T13:01:34", "url": "https://files.pythonhosted.org/packages/7d/bc/ab1567371812ac261b42eb16ec6d8430838cad8756f0813c30c08ff84a01/xcut-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "652da12cfbd95bddf1c88651212494ad", "sha256": "52493b7d5824cd8d1a903d1d8425583d89ad08bebac93273bc11726245ea2498" }, "downloads": -1, "filename": "xcut-0.0.6.tar.gz", "has_sig": false, "md5_digest": "652da12cfbd95bddf1c88651212494ad", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.1", "size": 3318, "upload_time": "2018-07-24T13:13:27", "url": "https://files.pythonhosted.org/packages/67/ad/5ba13c5d7b76b8ce2923b63741a5b312390050eab263077c2c6d014c622a/xcut-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "87532e6190514ed76573c7f920f13532", "sha256": "1f5103fd69e311149300df1c6ce0c53c6df8f4201549cc1a66a603a63ae1bc84" }, "downloads": -1, "filename": "xcut-0.0.7.tar.gz", "has_sig": false, "md5_digest": "87532e6190514ed76573c7f920f13532", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.1", "size": 3319, "upload_time": "2018-07-24T14:03:46", "url": "https://files.pythonhosted.org/packages/aa/72/a32964159af39f855e1639ff0fd38765b4e91dc74e0ca35458506625fae1/xcut-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "6a128b23c2eb14f56b6788c5408b8cd7", "sha256": "d511cae2412204bdb29c2ba22aa13cbfac96e387a9e6c7f27ec305267dae0144" }, "downloads": -1, "filename": "xcut-0.0.8.tar.gz", "has_sig": false, "md5_digest": "6a128b23c2eb14f56b6788c5408b8cd7", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.1", "size": 3624, "upload_time": "2018-08-06T04:37:10", "url": "https://files.pythonhosted.org/packages/0a/c4/d74c979f5f1ffeff6d29e5516fdf847a908e41246595e67e71bb9991b7f2/xcut-0.0.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "130198614acf94c5532b7e185cc12635", "sha256": "792c44de05f0f9f3a2f670958b57ecd2b0fbac84f2b572858bf49da0212ed879" }, "downloads": -1, "filename": "xcut-0.0.10-py3-none-any.whl", "has_sig": false, "md5_digest": "130198614acf94c5532b7e185cc12635", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6.1", "size": 3473, "upload_time": "2018-08-06T04:41:53", "url": "https://files.pythonhosted.org/packages/91/ee/a37e94efaa39095c34da43fe977012fdba72d1d59fb3b127b4894cc1f614/xcut-0.0.10-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "33545f55db7d61f072758e5a441dcf20", "sha256": "9496398aed7409ca87f97b5b0ffe501103bbac46eddcdea6a255e2b7b5e6142d" }, "downloads": -1, "filename": "xcut-0.0.10.tar.gz", "has_sig": false, "md5_digest": "33545f55db7d61f072758e5a441dcf20", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.1", "size": 3624, "upload_time": "2018-08-06T04:41:55", "url": "https://files.pythonhosted.org/packages/13/81/19496391315419c7ccc36d3f592f4dbd72ecc17a77dfb31ba1b4afacf8cb/xcut-0.0.10.tar.gz" } ] }