| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Tikara is a modern, type-hinted Python wrapper for Apache Tika, supporting over 1600 file formats for content extraction, metadata analysis, and language detection. It provides direct JNI integration through JPype for optimal performance.
from tikara import Tika
tika = Tika()
content, metadata = tika.parse("document.pdf")🌈 1682 supported media types and counting!
pip install tikaraTesseract OCR (strongly recommended if you process images) (Reference ⇗)
# Ubuntu
apt-get install tesseract-ocrAdditional language packs for Tesseract (optional):
# Ubuntu
apt-get install tesseract-ocr-deu tesseract-ocr-fra tesseract-ocr-ita tesseract-ocr-spaImageMagick for advanced image processing (Reference ⇗)
# Ubuntu
apt-get install imagemagickFFMPEG for enhanced multimedia file support (Reference ⇗)
# Ubuntu
apt-get install ffmpegPDFBox ⇗ for enhanced PDF support (Reference ⇗)
# Ubuntu
apt-get install pdfboxEnhanced PDF support with PDFBox Reference ⇗
EXIFTool for metadata extraction from images Reference ⇗
# Ubuntu
apt-get install libimage-exiftool-perlGDAL for geospatial file support (Reference ⇗)
# Ubuntu
apt-get install gdal-binMSCore Fonts for enhanced Office file handling (Reference ⇗)
# Ubuntu
apt-get install xfonts-utils fonts-freefont-ttf fonts-liberation ttf-mscorefonts-installerFor more OS dependency information including MSCore fonts setup and additional configuration, see the official Apache Tika Dockerfile.
from tikara import Tika
from pathlib import Path
tika = Tika()
# Basic string output
content, metadata = tika.parse("document.pdf")
# Stream large files
stream, metadata = tika.parse(
"large.pdf",
output_stream=True,
output_format="txt"
)
# Save to file
output_path, metadata = tika.parse(
"input.docx",
output_file=Path("output.txt"),
output_format="txt"
)from tikara import Tika
tika = Tika()
result = tika.detect_language("El rápido zorro marrón salta sobre el perro perezoso")
print(f"Language: {result.language}, Confidence: {result.confidence}")from tikara import Tika
tika = Tika()
mime_type = tika.detect_mime_type("unknown_file")
print(f"Detected type: {mime_type}")from tikara import Tika
from pathlib import Path
tika = Tika()
results = tika.unpack(
"container.docx",
output_dir=Path("extracted"),
max_depth=3
)
for item in results:
print(f"Extracted {item.metadata['Content-Type']} to {item.file_path}")Ensure that you have the system dependencies installed
Install uv:
curl -LsSf https://astral.sh/uv/install.sh | shInstall python dependencies and create the Virtual Environment:
make installRun make (or make help) to see all available targets. The most common ones:
# Setup
make install # Install all dependencies (including dev)
make stubs # Regenerate Java type stubs from the Tika JAR
# Lint & Format
make lint # Run ruff linter (with auto-fix)
make format # Run ruff formatter
make ruff # Run linter and formatter together
# Test
make test # Run tests with verbose output
make test-fast # Run tests, skip slow benchmark/isolated markers
make test-coverage # Run tests with coverage report (XML + terminal)
# Docs
make docs # Build Sphinx HTML docs
make docs-open # Build docs and open in browser
# Security
make safety # Run safety dependency vulnerability scan
# Build & Release
make build # Build sdist and wheel
make clean # Remove build artifacts, caches, and generated reports
# CI / Pre-push
make ci # Run full CI suite (lint → test → safety → docs)
make prepush # Alias for ci — run before pushingFor detailed documentation on:
See the Example Jupyter Notebooks 📔
Tikara builds on the shoulders of giants:
Contributions welcome! The project uses Make for development tasks:
make prepush # Run full CI suite (lint, test, coverage, safety, docs)For developing custom parsers/detectors, Java stubs can be generated:
make stubs # Generate Java stubs for Apache Tika interfacesNote: Generated stubs are git-ignored but provide IDE support and type hints when implementing custom parsers/detectors.
See API Documentation for complete details.
Apache License 2.0 - See LICENSE for details.
| Back | FazBrowse Home | New Git URL |