Skip to content

Commit 3d30902

Browse files
akshowhiniExtractTable
authored andcommitted
Asc col ind fix (#17)
* #BFix - Ascending order of column indices
1 parent d782e3d commit 3d30902

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

ExtractTable/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION = (1, 2, 1)
22
PRERELEASE = None # "alpha", "beta" or "rc"
3-
REVISION = 1
3+
REVISION = 2
44

55

66
def generate_version(version, prerelease=None, revision=None):

ExtractTable/common.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ def _converter(self, fmt: str, index: bool = False) -> list:
3030
:param index: row index consideration in the output
3131
:return: list of tables from converted into the requested output format
3232
"""
33-
dfs = [pd.DataFrame.from_dict(table["TableJson"]).T for table in self.data["Tables"]]
33+
# To convert the column indices to int to maintain the correct order on a table with more than 9 columns
34+
dfs = [pd.DataFrame.from_dict(
35+
{int(k): v for k, v in table["TableJson"].items()}, orient="index"
36+
) for table in self.data["Tables"]]
3437
if fmt in ("df", "dataframe"):
3538
return dfs
3639
elif fmt == "dict":

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ The motivation is to make it easy for developers to extract tabular data from im
99

1010
# Prerequisite
1111

12-
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).
13-
14-
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.
12+
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.
1513

1614

1715
# Installation

0 commit comments

Comments
 (0)