{"id":23347015,"url":"https://github.com/robintw/pandastopowerpoint","last_synced_at":"2025-04-10T03:44:49.765Z","repository":{"id":31777865,"uuid":"35344234","full_name":"robintw/PandasToPowerpoint","owner":"robintw","description":"Python utility to take a Pandas DataFrame and create a Powerpoint table","archived":false,"fork":false,"pushed_at":"2021-06-25T19:02:49.000Z","size":27,"stargazers_count":111,"open_issues_count":7,"forks_count":32,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-01T15:57:18.952Z","etag":null,"topics":["pandas-dataframe","powerpoint","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robintw.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}},"created_at":"2015-05-09T20:31:07.000Z","updated_at":"2024-12-24T12:13:23.000Z","dependencies_parsed_at":"2022-09-10T09:41:28.992Z","dependency_job_id":null,"html_url":"https://github.com/robintw/PandasToPowerpoint","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robintw%2FPandasToPowerpoint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robintw%2FPandasToPowerpoint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robintw%2FPandasToPowerpoint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robintw%2FPandasToPowerpoint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robintw","download_url":"https://codeload.github.com/robintw/PandasToPowerpoint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248154975,"owners_count":21056541,"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":["pandas-dataframe","powerpoint","python"],"created_at":"2024-12-21T07:17:27.875Z","updated_at":"2025-04-10T03:44:49.744Z","avatar_url":"https://github.com/robintw.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PandasToPowerpoint (pd2ppt)\nPython utility to take a Pandas DataFrame and create a Powerpoint table\n\nAn example:\n\n```python\nfrom pd2ppt import df_to_powerpoint\nimport pandas as pd\n\ndf = pd.DataFrame(\n    {'District':['Hampshire', 'Dorset', 'Wiltshire', 'Worcestershire'],\n     'Population':[25000, 500000, 735298, 12653],\n     'Ratio':[1.56, 7.34, 3.67, 8.23]})\n\ndf_to_powerpoint(\n    r\"C:\\Code\\Powerpoint\\test58.pptx\", df, col_formatters=['', ',', '.2'],\n    rounding=['', 3, ''])\n```\n\n\n## Installation\n\n```bash\ngit clone https://github.com/robintw/PandasToPowerpoint.git\ncd PandasToPowerpoint\npip install --upgrade pip # optional (depends on setup)\npip install -r requirements.txt\npython setup.py install\n```\n\n\n## Documentation\n\n### `df_to_table`\n```\nConverts a Pandas DataFrame to a PowerPoint table on the given\nSlide of a PowerPoint presentation.\n\nThe table is a standard Powerpoint table, and can easily be modified with\nthe Powerpoint tools, for example: resizing columns, changing formatting etc.\n\nParameters\n----------\nslide: ``pptx.slide.Slide``\n    slide object from the python-pptx library containing the slide on which\n    you want the table to appear\n\ndf: pandas ``DataFrame``\n   DataFrame with the data\n\nleft: int, optional\n   Position of the left-side of the table, either as an integer in cm, or\n   as an instance of a pptx.util Length class (pptx.util.Inches for\n   example). Defaults to 4cm.\n\ntop: int, optional\n   Position of the top of the table, takes parameters as above.\n\nwidth: int, optional\n   Width of the table, takes parameters as above.\n\nheight: int, optional\n   Height of the table, takes parameters as above.\n\ncol_formatters: list, optional\n   A n_columns element long list containing format specifications for each\n   column. For example ['', ',', '.2'] does no special formatting for the\n   first column, uses commas as thousands separators in the second column,\n   and formats the third column as a float with 2 decimal places.\n\nrounding: list, optional\n   A n_columns element long list containing a number for each integer\n   column that requires rounding that is then multiplied by -1 and passed\n   to round(). The practical upshot of this is that you can give something\n   like ['', 3, ''], which does nothing for the 1st and 3rd columns (as\n   they aren't integer values), but for the 2nd column, rounds away the 3\n   right-hand digits (eg. taking 25437 to 25000).\n\nname: str, optional\n   A name to be given to the table in the Powerpoint file. This is not\n   displayed, but can help extract the table later to make further changes.\n\nReturns\n-------\npptx.shapes.graphfrm.GraphicFrame\n    The python-pptx table (GraphicFrame) object that was created (which can\n    then be used to do further manipulation if desired)\n```\n\n### `df_to_powerpoint`\n```\nConverts a Pandas DataFrame to a table in a new, blank PowerPoint\npresentation.\n\nCreates a new PowerPoint presentation with the given filename, with a single\nslide containing a single table with the Pandas DataFrame data in it.\n\nThe table is a standard Powerpoint table, and can easily be modified with\nthe Powerpoint tools, for example: resizing columns, changing formatting\netc.\n\nParameters\n----------\nfilename: Filename to save the PowerPoint presentation as\n\ndf: pandas ``DataFrame``\n    DataFrame with the data\n\n**kwargs:\n    All other arguments that can be taken by ``df_to_table()`` (such as\n    ``col_formatters`` or ``rounding``) can also be passed here.\n\nReturns\n-------\npptx.shapes.graphfrm.GraphicFrame\n    The python-pptx table (GraphicFrame) object that was created (which can\n    then be used to do further manipulation if desired)\n```\n\n\n## UnitTests\n\nTo run unittests you can execute the following command:\n\n```bash\nmake pytest\n```\n\nor\n\n```bash\npytest -v --cov-report term-missing --cov=pd2ppt\n```\n\nYou will need `pytest` installed in your environment via `pip install -r requirements-test.txt`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobintw%2Fpandastopowerpoint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobintw%2Fpandastopowerpoint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobintw%2Fpandastopowerpoint/lists"}