Skip to content

Commit

Permalink
Merge branch 'release/0.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
fedelemantuano committed Sep 8, 2016
2 parents eb55df9 + a0f14ea commit 95468a6
Show file tree
Hide file tree
Showing 17 changed files with 61 additions and 30 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
.env
.ropeproject/
build/
dist/
venv/
5 changes: 5 additions & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# file GENERATED by distutils, do NOT edit
setup.cfg
setup.py
tikapp/__init__.py
tikapp/exceptions.py
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

## Overview

Tika App Python is a wrapper for [Apache Tika App](https://tika.apache.org/).
In the case in which there is an massive number of requests it is preferable to use Tika App in place of Tika Server. An example is the combined use with Apache Storm.
tika-app-python is a wrapper for [Apache Tika App](https://tika.apache.org/).

### 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.
Expand Down Expand Up @@ -31,12 +30,18 @@ cd tika-app-python
python setup.py install
```

or use `pip`:

```
pip install tika-app
```

## Usage

Import `TikaApp` class:

```
from tika_app.tika_app import TikaApp
from tikapp import TikaApp
tika_client = TikaApp(file_jar="/opt/tika/tika-app-1.13.jar")
```
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
python-magic==0.4.12
simplejson==3.8.2
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[metadata]
description-file = README.md
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from distutils.core import setup

setup(
name='Tika App',
version='0.3',
name='tika-app',
version='0.4',
description='Python client for Apache Tika App',
author='Fedele Mantuano',
author_email='[email protected]',
Expand All @@ -14,5 +14,5 @@
keywords=['tika', 'apache', 'toolkit'],
requires=['simplejson'],
license="Apache License, Version 2.0",
packages=['tika_app'],
packages=['tikapp'],
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 7 additions & 3 deletions profiling/performance.py → tests/performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,18 @@
"""

from __future__ import unicode_literals
from tika_app.tika_app import TikaApp
import magic
import os
import sys
import timeit

profiling_path = os.path.realpath(os.path.dirname(__file__))
test_zip = os.path.join(profiling_path, "lorem_ipsum.txt.zip")
test_txt = os.path.join(profiling_path, "lorem_ipsum.txt")
root = os.path.join(profiling_path, '..')
sys.path.append(root)
from tikapp import TikaApp

test_zip = os.path.join(profiling_path, "files", "lorem_ipsum.txt.zip")
test_txt = os.path.join(profiling_path, "files", "lorem_ipsum.txt")


def tika_content_type():
Expand Down
2 changes: 1 addition & 1 deletion unittest/test_tika_app.py → tests/test_tika_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
test_txt = os.path.join(unittest_path, 'files', 'test.txt')
test_zip = os.path.join(unittest_path, 'files', 'test.zip')

import tika_app.tika_app as tika
import tikapp as tika


class TestTikaApp(unittest.TestCase):
Expand Down
Empty file removed tika_app/__init__.py
Empty file.
26 changes: 6 additions & 20 deletions tika_app/tika_app.py → tikapp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
import os
import tempfile
from subprocess import Popen, PIPE, STDOUT
from exceptions import \
InvalidTikaAppJar, \
InvalidSwitches, \
InvalidFilePath, \
InvalidParameters, \
TempIOError

try:
import simplejson as json
Expand All @@ -31,26 +37,6 @@
log = logging.getLogger(__name__)


class InvalidTikaAppJar(ValueError):
pass


class InvalidSwitches(ValueError):
pass


class InvalidFilePath(ValueError):
pass


class InvalidParameters(ValueError):
pass


class TempIOError(Exception):
pass


class TikaApp(object):

def __init__(
Expand Down
27 changes: 27 additions & 0 deletions tikapp/exceptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
__all__ = [
"InvalidTikaAppJar",
"InvalidSwitches",
"InvalidFilePath",
"InvalidParameters",
"TempIOError",
]


class InvalidTikaAppJar(ValueError):
pass


class InvalidSwitches(ValueError):
pass


class InvalidFilePath(ValueError):
pass


class InvalidParameters(ValueError):
pass


class TempIOError(Exception):
pass
Empty file removed unittest/__init__.py
Empty file.

0 comments on commit 95468a6

Please sign in to comment.