Project

tikarb

0.0
No commit activity in last 3 years
No release in over 3 years
A simple Apache Tika binding for ruby using rjb.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 0
 Project Readme

Tikarb

A simple Apache Tika binding for ruby using rjb.

Dependencies

  • ruby 2.3+
  • tika 1.16+

Installation

Add this line to your application's Gemfile:

gem 'tikarb'

And then execute:

$ bundle

Usage

Setup path to tika-app jar file:

Tikarb.path = '/path/to/your/tika-app.jar'

Use as follows:

# extract text and metadata from file
Tikarb.parse('/path/to/your/file')

# detect media type
Tikarb.detect('/path/to/your/file')

# call with command-line options
Tikarb.cli('--xml', '/path/to/your/file')

You can use StringIO as an argument:

Tikarb.parse(StringIO.new(your_data))

Pros and Cons

This gem calls Tika libraries via Java Native Interface using rjb.

Pros:

  • It will be faster than command-line interface in case Tika is executed repeatedly.

Cons:

  • It requires some memory to load JavaVM in the process.
  • It will affect JDK and Tika internal specification change.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/kanety/tikarb. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.