![]() I couldn't do either of these as part of our standard deployment process. JCC dies with an error if it's not explicitly disabled or the patch applies. The version of setuptools on our servers doesn't support JCC's shared library mode. This means that it needs to be recompiled for each platform, so I couldn't just distribute a binary blob with the Intranet (I had the same problem with DocToText above). ![]() The wrapper is written using JCC, which works by generating and compiling C++ code that links to the Java classes, and then a Python wrapper around that C++. I was able to go further than this, and package Tika in a way that makes it easy to install with Pip, and thus integrate with our deployment process. I was unable to register for an account to update that page, so I wrote to the author with the details that I discovered, and will also document here that the following command works for me: The instructions are somewhat outdated at the time of writing, as they refer to Tika version 0.7, while 1.0 has been released. ![]() Unfortunately the installation process is very non-standard, which would not fit in with our fabric-based automated deployment process, and would make it harder for users to install the Intranet themselves. Luckily I found some instructions for building a Python wrapper around Tika, using some tools that I'd never heard of, and this seemed like a good approach. However, it introduces a new problem: it's written in Java, which is hard to access from Python. It appears to support all the document formats that we need, and to have auto-detection of the document format, which solves all the MIME type problems as well. The choice of which tool to use depends on the MIME type returned by the file(1) command, which varies depending on the OS (Debian/Ubuntu or CentOS) and which version of the library is installedĪnother Stack Overflow post recommended Apache Tika for metadata extraction.These solutions did not extract metadata, only document text.I was unable to find any Python or command-line solution for old Excel (XLS) files.There were a number of problems with this hodgepodge: This ended up with a hodgepodge of tools: I found various tools online to help extract this text, largely thanks to Stack Overflow here and here. and the new XML equivalents, DOCX, XLSX and PPTX.Microsoft Office DOC, XLS and PPT files.Content indexing in Django using Apache Tikaįor the Documents module of our new open-source Generic Intranet, we need to be able to extract the text content and metadata from various kinds of documents:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |