textract icon indicating copy to clipboard operation
textract copied to clipboard

Textract-py3

Open KyleKing opened this issue 1 year ago • 8 comments

Hi! FWIW I have been maintaining a very minimal published fork of textract to address the blocking issue with * dependencies. This PR is to track the differences if anyone wants to use textract-py3 while the long term maintenance of textract is resolved (#498). Once textract is released with a patch for #461, I will redirect users away from my fork because hopefully the upstream package will resume merging PRs, patching, and new version releases, but I unfortunately won't have the bandwidth to contribute beyond this fork.

KyleKing avatar Dec 04 '24 11:12 KyleKing

@KyleKing and chance you could update the deps on your fork please and release a new version. It's pinned to using a older version of msg-extractor which had a pinned dep that broke when BS4 was updated, they've patched their part now, please see https://github.com/TeamMsgExtractor/msg-extractor/issues/450

Great work on the fork though keep it going please!

StevenMapes avatar Feb 17 '25 11:02 StevenMapes

Of course! I’m glad that you’re finding it to be useful and I’m happy to accept PRs. I’m out of town now, but I’ll release no later than the 24th!

KyleKing avatar Feb 17 '25 18:02 KyleKing

My fork doesn't have any upper bound constraints on dependencies (https://github.com/KyleKing/textract-py3/blob/f3f509f8c36be05c85574ac841632693c2a19bd9/pyproject.toml#L22), so any project with Python >=3.8,<4.0 can install extract-msg==0.53.1

For textract-py3, I don't plan on dropping support of Python 3.7 yet, but the relaxed specifications shouldn't introduce artificial version limits

KyleKing avatar Feb 24 '25 02:02 KyleKing

Hey @KyleKing thanks for creating the fork and maintaing that for the moment.

I tried using it but my colleague pointed out that the reason one of our tests started to break was because textract-py3 was installing xlrd 2.1.0. xlrd 2 and upwards removed support for anything but .xls so textract would no longer support xlsx. I fixed it by explicitly requiring xlrd==1.2.0.

When you get the chance you may want to restrict xlrd in the toml to xlrd = ">=1.2.0,<2.0.0" (I think)

anthonyhashemi avatar Feb 26 '25 10:02 anthonyhashemi

Thanks @anthonyhashemi! You're right and I'll publish a release this afternoon

Long-term, maybe adapting changes to use openpyxl for xlsx from #433 would be worthwhile in the case that xlrd no longer works reliably for xlsx

KyleKing avatar Feb 26 '25 13:02 KyleKing

I've released v2.1.1 with the patch. Thanks again!

https://pypi.org/project/textract-py3

KyleKing avatar Feb 26 '25 23:02 KyleKing

Moving over to use openpyxl for xlsx would be good as then the constraint on xlrd could be removed which would be useful for projects that also use pandas for XLS as that, pandas, now requires v2.0.1+ of xlrd when using the xlrd engine

StevenMapes avatar Mar 20 '25 14:03 StevenMapes

That would be great and I would be open to PRs! I don’t have a use case for Excel, so I wouldn’t make the changes otherwise

KyleKing avatar Mar 21 '25 01:03 KyleKing