https://github.com/hansalemaos/dftogithubmarkdown
DataFrame to GitHub markdown table
https://github.com/hansalemaos/dftogithubmarkdown
github markdown
Last synced: 5 months ago
JSON representation
DataFrame to GitHub markdown table
- Host: GitHub
- URL: https://github.com/hansalemaos/dftogithubmarkdown
- Owner: hansalemaos
- License: mit
- Created: 2025-02-16T02:40:23.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-16T02:40:25.000Z (over 1 year ago)
- Last Synced: 2026-01-10T19:11:31.264Z (6 months ago)
- Topics: github, markdown
- Language: Python
- Homepage: https://pypi.org/project/dftogithubmarkdown/
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
# A function to convert DataFrames to GitHub markdown
## `pip install dftogithubmarkdown`
```py
from dftogithubmarkdown import to_git_markdown
print(to_git_markdown(df, max_col_width=30, max_rows=-1))
"""
Convert a pandas DataFrame to a GitHub-flavored markdown table string.
Parameters:
df (pd.DataFrame): The DataFrame to convert.
max_col_width (int): Maximum width for each column in the markdown table. Default is 30.
max_rows (int): Maximum number of rows to include in the table. If -1, include all rows.
Returns:
str: A string representing the DataFrame in GitHub-flavored markdown table format.
"""
```