Skip to main content

Python client for Apache Tika App

Project description

PyPI version Build Status Coverage Status BCH compliance



tika-app-python is a wrapper for Apache Tika App. With this library you can analyze: - file on disk - payload in base64 - file object (like standard input)

To use file object function you should use Apache Tika version >= 1.17.

Apache 2 Open Source License

tika-app-python can be downloaded, used, and modified free of charge. It is available under the Apache 2 license.


Main Author

Fedele Mantuano (Twitter: [@fedelemantuano](


Clone repository

git clone

and install tika-app-python with

cd tika-app-python

python install

or use pip:

pip install tika-app

Usage in a project

Import TikaApp class:

from tikapp import TikaApp

tika_client = TikaApp(file_jar="/opt/tika/tika-app-1.18.jar")

For get content type:


For detect language:


For detect all metadata and content:


For detect only content:


For detect only metadata:


You can analyze payload in base64 with the same methods, but passing payload argument:


or you can analyze file object (like standard input) with the same methods, but passing objectInput argument:


Usage from command-line

If you installed tika-app-python with pip or you can use it with command-line. To use tika-app-python you should submit the Apache Tika app JAR. You can: - set the enviroment value TIKA_APP_JAR - use --jar switch

The last one overwrite all the others.

These are all swithes:

usage: tikapp [-h] (-f FILE | -p PAYLOAD | -k) [-j JAR] [-d] [-t] [-l]
                   [-m] [-a] [-v]

Wrapper for Apache Tika App.

optional arguments:
  -h, --help            show this help message and exit
  -f FILE, --file FILE  File to submit (default: None)
  -p PAYLOAD, --payload PAYLOAD
                        Base64 payload to submit (default: None)
  -k, --stdin           Enable parsing from stdin (default: False)
  -j JAR, --jar JAR     Apache Tika app JAR (default: None)
  -d, --detect          Detect document type (default: False)
  -t, --text            Output plain text content (default: False)
  -l, --language        Output only language (default: False)
  -m, --metadata        Output only metadata (default: False)
  -a, --all             Output metadata and content from all embedded files
                        (default: False)
  -v, --version         show program's version number and exit

Example from file on disk:

$ tikapp -f example_file -a

Example from standard input

$ tikapp -a -k < example_file

Performance tests

These are the results of performance tests in tests folder:

(Python 2)
tika_content_type()             0.704840 sec
tika_detect_language()          1.592066 sec
magic_content_type()            0.000215 sec
tika_extract_all_content()      0.816366 sec
tika_extract_only_content()     0.788667 sec

(Python 3)
tika_content_type()             0.698357 sec
tika_detect_language()          1.593452 sec
magic_content_type()            0.000226 sec
tika_extract_all_content()      0.785915 sec
tika_extract_only_content()     0.766517 sec

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tika-app-1.5.0.tar.gz (7.5 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page