{"id":13843886,"url":"https://github.com/ahuigo/xlparser","last_synced_at":"2026-01-23T14:57:07.666Z","repository":{"id":37385074,"uuid":"141545165","full_name":"ahuigo/xlparser","owner":"ahuigo","description":"Parse file(xlsx/xls/csv) to other format(dict, csv, json, ...).","archived":false,"fork":false,"pushed_at":"2024-07-24T12:40:15.000Z","size":75,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-21T15:39:36.723Z","etag":null,"topics":["csv","python3","xls","xlsx"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ahuigo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-19T08:02:35.000Z","updated_at":"2024-07-24T12:41:25.000Z","dependencies_parsed_at":"2024-07-24T14:31:55.184Z","dependency_job_id":"bbc0ce10-6d63-426c-90b4-d66d4f698f8d","html_url":"https://github.com/ahuigo/xlparser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ahuigo/xlparser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahuigo%2Fxlparser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahuigo%2Fxlparser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahuigo%2Fxlparser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahuigo%2Fxlparser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahuigo","download_url":"https://codeload.github.com/ahuigo/xlparser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahuigo%2Fxlparser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264892027,"owners_count":23679208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csv","python3","xls","xlsx"],"created_at":"2024-08-04T17:02:30.059Z","updated_at":"2026-01-23T14:57:07.660Z","avatar_url":"https://github.com/ahuigo.png","language":"Python","funding_links":[],"categories":["Python (1887)","Python"],"sub_categories":[],"readme":"# xlparser\nParse excel(xlsx/xls/csv) to other format(csv, xlsx, json).\n\n\n[![](https://img.shields.io/pypi/pyversions/xlparser.svg?longCache=True)](https://pypi.org/pypi/xlparser/)\n[![](https://img.shields.io/pypi/v/xlparser.svg?maxAge=36000)](https://pypi.org/pypi/xlparser/)\n\n- [xlparser](#xlparser)\n  - [Install](#install)\n  - [Usage](#usage)\n    - [CLI Usage](#cli-usage)\n    - [Module Usage](#module-usage)\n      - [Parse any type of file](#parse-any-type-of-file)\n      - [Save to any type of file](#save-to-any-type-of-file)\n      - [Csv operation](#csv-operation)\n      - [Zip operation](#zip-operation)\n  - [Required](#required)\n\n[中文](README.zh.md)\n\n## Install\n\n    pip install xlparser\n    # or\n    pip3 install xlparser\n\nIf you want to filter fields, it will be convenient with [xcut](https://github.com/ahuigo/xcut).\n\n    pip install xcut \n    # or\n    pip3 install xcut \n\n## Usage\n\n    $ xlparser -h\n    xlparser [options] INFILE [OUTFILE]\\n\n        options:\\n\n            -h       For help.\\n\n\n### CLI Usage\nFrom xlsx to csv.\n\n    $ xlparser source.xlsx new.csv \n\nFrom csv to xlsx.\n\n    $ xlparser source.csv new.xlsx \n\nFrom csv to json.\n\n    $ xlparser source.csv new.json\n\nFrom xlsx to csv(stdout).\n\n    $ xlparser source.xlsx | head \n\n    $ xlparser src.xlsx | tee test.csv\n    name, score\n    \"李雷,韩梅\",15\n    小花,16\n\nUse xcut to filter fields.\n\n    $ xlparser src.xlsx | xcut --from-csv -f name \n    name\n    \"李雷,韩梅\"\n    小花\n\n    $ xlparser src.xlsx | xcut --from-csv -f score,name\n    score,name\n    15,\"李雷,韩梅\"\n    16,小花\n\nConvert xlsx to csv\n\n    $ xlparser src.xlsx test.csv; \n    $ cat test.csv\n    name, age\n    李雷,15\n    小花,16\n\nConvert csv to json\n\n    $ xlparser test.csv test.json\n    [[\"name\", \"age\"], [\"李雷\", \"15\"], [\"小花\", \"16\"]]\n\n### Module Usage\n\n#### Parse any type of file\n`parse` any type of file to rows:\n\n    \u003e\u003e\u003e from xlparser import parse, saveCsv\n    \u003e\u003e\u003e rows = parse('some.xlsx')\n    \u003e\u003e\u003e list(rows)\n    [['foo', 'bar'], ['看', '我', '变']]\n\nThe `parse` function supports the following file formats: .csv, .xls, .xlsx .\n\n#### Save to any type of file\nSave rows to csv\n\n    \u003e\u003e\u003e from xlparser import saveCsv\n    \u003e\u003e\u003e rows = [['foo', 'bar'], ['看', '我', '变']]\n    \u003e\u003e\u003e saveCsv(rows, 'test.csv')\n\nSave rows to xlsx\n\n    \u003e\u003e\u003e saveXlsx(rows, 'test.xlsx')\n\n#### Csv operation\n\n    \u003e\u003e\u003e from xlparser import *\n\n    \u003e\u003e\u003e rows = [('foo','bar'), ('看','我','变')]\n    \u003e\u003e\u003e saveCsv(rows, 'test.csv')\n\n    \u003e\u003e\u003e list(parseCsv('test.csv'))\n    [['foo', 'bar'], ['看', '我', '变']]\n\n#### Zip operation\n\n    \u003e\u003e\u003e from xlparser import loadZip\n    \u003e\u003e\u003e zf = loadZip('test.xlsx')\n    \u003e\u003e\u003e print(zf.filelist)\n    ......\n    \u003e\u003e\u003e zf.extract('xl/media/image1.png', '/tmp')\n    \u003e\u003e\u003e os.rename('/tmp/'+'xl/media/image1.png', './image1.png')\n\n## Required\n1. python\u003e=3.5\n2. xlrd: required by xls\n2. openpyxl\u003e=2.5.4: required by xlsx\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahuigo%2Fxlparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahuigo%2Fxlparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahuigo%2Fxlparser/lists"}