MCPcopy Index your code
hub / github.com/apache/tika

github.com/apache/tika @3.3.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release 3.3.1 ↗ · + Follow
14,681 symbols 56,906 edges 1,786 files 3,443 documented · 23% 4 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Welcome to Apache Tika https://tika.apache.org/

license Jenkins Jenkins tests Maven Central

Apache Tika(TM) is a toolkit for detecting and extracting metadata and structured text content from various documents using existing parser libraries.

Tika is a project of the Apache Software Foundation.

Apache Tika, Tika, Apache, the Apache feather logo, and the Apache Tika project logo are trademarks of The Apache Software Foundation.

Getting Started

Pre-built binaries of Apache Tika standalone applications are available from https://tika.apache.org/download.html . Pre-built binaries of all the Tika jars can be fetched from Maven Central or your favourite Maven mirror.

Tika 1.X reached End of Life (EOL) on September 30, 2022.

Tika is based on Java 11 and uses the Maven 3 build system. N.B. Docker is used for tests in tika-integration-tests. If Docker is not installed, those tests are skipped.

To build Tika from source, use the following command in the main directory:

./mvnw clean install

The Maven wrapper (mvnw) is included in the repository and will automatically download the correct Maven version if needed. On Windows, use mvnw.cmd instead.

The build consists of a number of components, including a standalone runnable jar that you can use to try out Tika features. You can run it like this:

java -jar tika-app/target/tika-app-*.jar --help

To build a specific project (for example, tika-server-standard):

./mvnw clean install -am -pl :tika-server-standard

If the ossindex-maven-plugin is causing the build to fail because a dependency has now been discovered to have a vulnerability:

./mvnw clean install -Dossindex.skip

Reproducible Builds

Apache Tika supports reproducible builds. This means that building the same source code with the same JDK version should produce byte-for-byte identical artifacts, regardless of the build machine or time.

Key configuration: - project.build.outputTimestamp is set in tika-parent/pom.xml - All Maven plugins are configured to produce deterministic output

To verify the build plan supports reproducibility:

./mvnw artifact:check-buildplan

To verify two builds produce identical artifacts:

./mvnw clean install -DskipTests
mv ~/.m2/repository/org/apache/tika tika-build-1
./mvnw clean install -DskipTests
diff -r tika-build-1 ~/.m2/repository/org/apache/tika

Maven Dependencies

Apache Tika provides Bill of Material (BOM) artifact to align Tika module versions and simplify version management. To avoid convergence errors in your own project, import this bom or Tika's parent pom.xml in your dependency management section.

If you use Apache Maven:

<project>
  <dependencyManagement>
    <dependencies>
      <dependency>
       <groupId>org.apache.tika</groupId>
       <artifactId>tika-bom</artifactId>
       <version>2.x.y</version>
       <type>pom</type>
       <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.apache.tika</groupId>
      <artifactId>tika-parsers-standard-package</artifactId>

    </dependency>
  </dependencies>
</project>

For Gradle:

dependencies {
  implementation(platform("org.apache.tika:tika-bom:2.x.y"))

  // version not required since bom (platform in Gradle terms)
  implementation("org.apache.tika:tika-parsers-standard-package")
}

Migrating to 2.x

The initial 2.x release notes are available in the archives.

See our wiki for the latest.

Contributing

See CONTRIBUTING.md and https://tika.apache.org/contribute.html

contributors

Building from a Specific Tag

Let's assume that you want to build the 2.5.0 tag:

0. Download and install hub.github.com
1. git clone https://github.com/apache/tika.git
2. cd tika
3. git checkout 2.5.0
4. ./mvnw clean install

If a new vulnerability has been discovered between the date of the tag and the date you are building the tag, you may need to build with:

4. ./mvnw clean install -Dossindex.skip

If a local test is not working in your environment, please notify the project at dev@tika.apache.org. As an immediate workaround, you can turn off individual tests with e.g.:

4. ./mvnw clean install -Dossindex.skip -Dtest=\!UnpackerResourceTest#testPDFImages

License (see also LICENSE.txt)

Collective work: Copyright 2011 The Apache Software Foundation.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Apache Tika includes a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the licenses listed in the LICENSE.txt file.

Export Control

This distribution includes cryptographic software. The country in which you currently reside may have restrictions on the import, possession, use, and/or re-export to another country, of encryption software. BEFORE using any encryption software, please check your country's laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. See http://www.wassenaar.org/ for more information.

The U.S. Government Department of Commerce, Bureau of Industry and Security (BIS), has classified this software as Export Commodity Control Number (ECCN) 5D002.C.1, which includes information security software using or performing cryptographic functions with asymmetric algorithms. The form and manner of this Apache Software Foundation distribution makes it eligible for export under the License Exception ENC Technology Software Unrestricted (TSU) exception (see the BIS Export Administration Regulations, Section 740.13) for both object code and source code.

The following provides more details on the included cryptographic software:

Apache Tika uses the Bouncy Castle generic encryption libraries for extracting text content and metadata from encrypted PDF files. See http://www.bouncycastle.org/ for more details on Bouncy Castle.

Mailing Lists

  • user@tika.apache.org - About using Tika
  • dev@tika.apache.org - About developing Tika

Subscribe by sending a message to {list}-subscribe@tika.apache.org.

Issue Tracker

https://issues.apache.org/jira/browse/TIKA

Security

See SECURITY.md and https://tika.apache.org/security.html

Extension points exported contracts — how you extend this code

ITikaToXMPConverter (Interface)
Interface for the specific Metadata to XMP converters [26 implementers]
tika-xmp/src/main/java/org/apache/tika/xmp/convert/ITikaToXMPConverter.java
Translator (Interface)
Interface for Translator services. @since Tika 1.6 [16 implementers]
tika-core/src/main/java/org/apache/tika/language/translate/Translator.java
Cell (Interface)
Cell of content. Classes that implement this interface are used by Tika parsers (currently just the MS Excel parser) to [10 …
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/main/java/org/apache/tika/parser/microsoft/Cell.java
ObjectRecogniser (Interface)
This is a contract for object recognisers used by ObjectRecognitionParser @see TensorflowImageRecParser [10 implementers]
tika-parsers/tika-parsers-ml/tika-parser-advancedmedia-module/src/main/java/org/apache/tika/parser/recognition/ObjectRecogniser.java
InputStreamFactory (Interface)
Interface to allow for custom/consistent creation of InputStream This factory is used statically in TikaResource. M [11 …
tika-server/tika-server-core/src/main/java/org/apache/tika/server/core/InputStreamFactory.java
ObjectFromDOMAndQueueBuilder (Interface)
Same as org.apache.tika.batch.builders.ObjectFromDOMAndQueueBuilder, but this is for objects that require access [32 implementers]
tika-batch/src/main/java/org/apache/tika/batch/builders/ObjectFromDOMAndQueueBuilder.java
StringStatsCalculator (Interface)
Interface for calculators that require a string @param [15 implementers]
tika-eval/tika-eval-core/src/main/java/org/apache/tika/eval/core/textstats/StringStatsCalculator.java
Transformer (Interface)
(no doc) [16 implementers]
tika-fuzzing/src/main/java/org/apache/tika/fuzzing/Transformer.java

Core symbols most depended-on inside this repo

get
called by 2268
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-text-module/src/main/java/org/apache/tika/parser/strings/StringsEncoding.java
get
called by 2101
tika-core/src/main/java/org/apache/tika/metadata/Metadata.java
toString
called by 1683
tika-core/src/main/java/org/apache/tika/config/LoadErrorHandler.java
add
called by 1557
tika-core/src/main/java/org/apache/tika/metadata/writefilter/MetadataWriteFilter.java
set
called by 1085
tika-core/src/main/java/org/apache/tika/metadata/writefilter/MetadataWriteFilter.java
append
called by 1069
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-miscoffice-module/src/main/java/org/apache/tika/parser/wordperfect/WP6Charsets.java
size
called by 1034
tika-core/src/main/java/org/apache/tika/mime/Clause.java
detect
called by 901
tika-core/src/main/java/org/apache/tika/detect/Detector.java

Shape

Method 12,387
Class 2,040
Interface 128
Enum 85
Function 34
Route 7

Languages

Java99%
Python1%
TypeScript1%
C++1%
C1%

Modules by API surface

tika-parsers/tika-parsers-standard/tika-parsers-standard-package/src/test/java/org/apache/tika/mime/TestMimeTypes.java110 symbols
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-text-module/src/main/java/org/apache/tika/parser/txt/CharsetRecog_sbcs.java110 symbols
tika-core/src/main/java/org/apache/tika/config/TikaConfig.java110 symbols
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-pdf-module/src/main/java/org/apache/tika/parser/pdf/PDFParser.java98 symbols
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/test/java/org/apache/tika/parser/microsoft/ooxml/OOXMLParserTest.java96 symbols
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-pdf-module/src/main/java/org/apache/tika/parser/pdf/PDFParserConfig.java90 symbols
tika-parsers/tika-parsers-ml/tika-parser-nlp-module/src/main/java/org/apache/tika/parser/journal/TEIDOMParser.java80 symbols
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/main/java/org/apache/tika/parser/microsoft/onenote/OneNoteHeader.java78 symbols
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-ocr-module/src/main/java/org/apache/tika/parser/ocr/TesseractOCRParser.java74 symbols
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/main/java/org/apache/tika/parser/microsoft/ooxml/XSSFExcelExtractorDecorator.java72 symbols
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-pdf-module/src/test/java/org/apache/tika/parser/pdf/PDFParserTest.java71 symbols
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-html-module/src/test/java/org/apache/tika/parser/html/HtmlParserTest.java71 symbols

For agents

$ claude mcp add tika \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact