Skip to content

Commit

Permalink
Fix futurewarning in pandas 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
timvink committed Aug 14, 2020
1 parent 2fd9b72 commit 78b86b1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Under the hood this is basically:
```python
import pandas as pd
df = pd.read_csv('path_to_table.csv')
df.to_markdown(showindex=False, tablefmt='pipe')
df.to_markdown(index=False, tablefmt='pipe')
```

Which means you can pass all parameters of [pandas.read_csv()](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_csv.html).
Expand Down
8 changes: 4 additions & 4 deletions mkdocs_table_reader_plugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@

def read_csv(*args, **kwargs):
df = pd.read_csv(*args, **kwargs)
return df.to_markdown(showindex=False, tablefmt="pipe")
return df.to_markdown(index=False, tablefmt="pipe")


def read_table(*args, **kwargs):
df = pd.read_table(*args, **kwargs)
return df.to_markdown(showindex=False, tablefmt="pipe")
return df.to_markdown(index=False, tablefmt="pipe")


def read_fwf(*args, **kwargs):
df = pd.read_fwf(*args, **kwargs)
return df.to_markdown(showindex=False, tablefmt="pipe")
return df.to_markdown(index=False, tablefmt="pipe")


def read_excel(*args, **kwargs):
df = pd.read_excel(*args, **kwargs)
return df.to_markdown(showindex=False, tablefmt="pipe")
return df.to_markdown(index=False, tablefmt="pipe")


READERS = {
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="mkdocs-table-reader-plugin",
version="0.4.1",
version="0.4.2",
description="MkDocs plugin to directly insert tables from files into markdown.",
long_description=long_description,
long_description_content_type="text/markdown",
Expand All @@ -24,7 +24,7 @@
"Programming Language :: Python :: 3.8",
"License :: OSI Approved :: MIT License",
],
install_requires=["mkdocs>=1.0", "pandas>=1.0", "tabulate>=0.8.6"],
install_requires=["mkdocs>=1.0", "pandas>=1.1", "tabulate>=0.8.7"],
packages=find_packages(),
entry_points={
"mkdocs.plugins": [
Expand Down

0 comments on commit 78b86b1

Please sign in to comment.