Skip to content

Commit

Permalink
Asc col ind fix (#17)
Browse files Browse the repository at this point in the history
* #BFix - Ascending order of column indices
  • Loading branch information
akshowhini authored and ExtractTable committed Dec 1, 2019
1 parent d782e3d commit 3d30902
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ExtractTable/__version__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION = (1, 2, 1)
PRERELEASE = None # "alpha", "beta" or "rc"
REVISION = 1
REVISION = 2


def generate_version(version, prerelease=None, revision=None):
Expand Down
5 changes: 4 additions & 1 deletion ExtractTable/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ def _converter(self, fmt: str, index: bool = False) -> list:
:param index: row index consideration in the output
:return: list of tables from converted into the requested output format
"""
dfs = [pd.DataFrame.from_dict(table["TableJson"]).T for table in self.data["Tables"]]
# To convert the column indices to int to maintain the correct order on a table with more than 9 columns
dfs = [pd.DataFrame.from_dict(
{int(k): v for k, v in table["TableJson"].items()}, orient="index"
) for table in self.data["Tables"]]
if fmt in ("df", "dataframe"):
return dfs
elif fmt == "dict":
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ The motivation is to make it easy for developers to extract tabular data from im

# Prerequisite

Before we talk/boast about the service, a developer MUST need an API key to use the ExtractTable service. [FREE credits here](https://extracttable.com/trail.html).

We dominate this market **not in user count but in accuracy, cost, and expiration**. You are most welcomed to [BUY credits here](https://extracttable.com/#pricing) or email me at saradhi@extracttable.com for assistance.
Before we talk/boast about the service, a developer MUST need an API key to use the ExtractTable service. [FREE credits here](https://extracttable.com/trail.html) - check data privacy in FAQ.


# Installation
Expand Down

0 comments on commit 3d30902

Please sign in to comment.