{ "info": { "author": "Zain Patel", "author_email": "zain.patel06@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# :clipboard: mdtable\n\n![PyPI](https://img.shields.io/pypi/v/mdtable.svg?style=flat-square)\n![License](https://img.shields.io/github/license/mzjp2/mdtable.svg?style=flat-square)\n[![Code Style: Black](https://img.shields.io/badge/code-black-black.svg?style=flat-square)](https://github.com/ambv/black)\n[![Downloads](https://pepy.tech/badge/mdtable)](https://pepy.tech/project/mdtable)\n\nmdtable is a Python built command line interface that lets you convert csv files into Markdown formatted tables easily. It also provides a Python API to use for your projects.\n\n## Installation\n\nRun ``pip install mdtable`` and check that the latest version is current installed by running ``mdtable \u2014version``.\n\n## Usage\n\n```shell\n>>> mdtable [OPTIONS] INPUT_FILE\n```\n\nThe options available are:\n\n```\n-a, --aligns TEXT Comma seperated list of 'l,r,c'\n-p, --padding INTEGER Padding for raw Markdown Table formatting\n-s, --save TEXT Path to save formatted markdown to\n--delimiter TEXT Delimiter character in csv\n--quotechar TEXT Quote character in csv\n--escapechar TEXT Escape character in csv\n--writemode TEXT Python write mode, e.g w+, w, a, a+\n--version Show the version and exit.\n--help Show this message and exit.\n```\n\n**Example**:\n\nSuppose you have a file `input.csv` like so:\n\n```\nName,Department,Birthday Month\nJohn Smith,Accounting,November\nErica Meyers,IT,March\nZain Patel,Engineering,June\nChristopher Smith,Engineering,July\nKiseki Hirakawa,Human Resources,February\n```\n\nRunning ``mdtable input.csv`` results in:\n\n```\n| Name | Department | Birthday Month |\n| ----------------- | --------------- | -------------- |\n| John Smith | Accounting | November |\n| Erica Meyers | IT | March |\n| Zain Patel | Engineering | June |\n| Christopher Smith | Engineering | July |\n| Kiseki Hirakawa | Human Resources | February |\n```\n\nwhich looks like:\n\n| Name | Department | Birthday Month |\n| ----------------- | --------------- | -------------- |\n| John Smith | Accounting | November |\n| Erica Meyers | IT | March |\n| Zain Patel | Engineering | June |\n| Christopher Smith | Engineering | July |\n| Kiseki Hirakawa | Human Resources | February |\n\n### API\n\n[*soon*] more documentation\n\n**Example**:\n\n```python\nfrom mdtable import MDTable\n\nmarkdown = MDTable('in.csv')\nmarkdown_string_table = markdown.get_table()\nmarkdown.save_table('out.csv')\n```\n\n### Current Features\n\n- [x] Ability to specify alignments, by providing a comma seperated string of alignments values (either 'l', 'r' or 'c') to ``mdtables \u2014aligns [ALIGNS] INPUT_FILE``, say for example ``mdtables \u2014aligns c,c,l input.csv``, there must be as many alignments characters as there are tables.\n\n- [x] Ability to save output to a markdown file (and specify the writing mode) by providing the path to the file you wish to save to ``mdtables \u2014save [SAVE_FILE] INPTUT_FILE`` say for example ``mdtables \u2014save output.md input.csv``\n\n- [x] Provide custom delimiter, quotation and escape characters for reading in your csv file. This is done by providing the character to ``\u2014delimiter, \u2014quotechar, \u2014escapehcar`` respectively.\n\n- [x] Add a padding option to make table border padding customisable (in the raw output). This can now be done. Running `mdtable input.csv -p 3 ` returns\n\n ```\n | Name | Department | Birthday Month |\n | ----------------- | --------------- | -------------- |\n | John Smith | Accounting | November |\n | Erica Meyers | IT | March |\n | Zain Patel | Engineering | June |\n | Christopher Smith | Engineering | July |\n | Kiseki Hirakawa | Human Resources | February |\n ```\n\n- [ ] \n\n## Future Features\n\n- [ ] Implement a centering flag (for raw output) to prettify the output if required\n- [ ] Enable 0 padding\n- [ ] Add documentation for the API\n- [ ] Implement tests for `delimeters``, quotechars` and `escapechars`.\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/mzjp2/mdtable", "keywords": "markdown cli convert", "license": "", "maintainer": "", "maintainer_email": "", "name": "mdtable", "package_url": "https://pypi.org/project/mdtable/", "platform": "", "project_url": "https://pypi.org/project/mdtable/", "project_urls": { "Homepage": "https://github.com/mzjp2/mdtable" }, "release_url": "https://pypi.org/project/mdtable/0.2/", "requires_dist": [ "click" ], "requires_python": ">=3.5", "summary": "mdtable converts csv files to markdown formatted tables", "version": "0.2" }, "last_serial": 5468544, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "f9128585610cb92ced4e43a1baafbc5a", "sha256": "cbbce5dc064d0fdb0943fe675041d69103a3ae2f0cd46e2833e56634852fb8ad" }, "downloads": -1, "filename": "mdtable-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "f9128585610cb92ced4e43a1baafbc5a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 6489, "upload_time": "2019-06-22T18:51:00", "url": "https://files.pythonhosted.org/packages/87/39/62d982cc6ab7f59d44c460f1acb0b919ee804eb93f19d652053b9ddf6925/mdtable-0.1-py3-none-any.whl" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "f59b12d5031f7d970c66033caf540caa", "sha256": "c01e289ab3519fd13c8cd0c81db561fcfa1854696ef2148d2c99cd2854171610" }, "downloads": -1, "filename": "mdtable-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "f59b12d5031f7d970c66033caf540caa", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 6920, "upload_time": "2019-06-30T18:35:01", "url": "https://files.pythonhosted.org/packages/2e/57/0f4b51601327dd318c287489e161a0463f13332e3d406cad79d239c67ad6/mdtable-0.2-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f59b12d5031f7d970c66033caf540caa", "sha256": "c01e289ab3519fd13c8cd0c81db561fcfa1854696ef2148d2c99cd2854171610" }, "downloads": -1, "filename": "mdtable-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "f59b12d5031f7d970c66033caf540caa", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 6920, "upload_time": "2019-06-30T18:35:01", "url": "https://files.pythonhosted.org/packages/2e/57/0f4b51601327dd318c287489e161a0463f13332e3d406cad79d239c67ad6/mdtable-0.2-py3-none-any.whl" } ] }