Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# These are supported funding model platforms

github: chrismattmann
github: chrismattmann
custom: ["https://www.paypal.me/MattmannAI", "https://venmo.com/Chris-Mattmann"]
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ on:
pull_request:

jobs:
lint:
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.14"
# Ref: https://github.com/tox-dev/action-pre-commit-uv
- uses: tox-dev/action-pre-commit-uv@246b66536e366bb885f52d61983bf32f7c95e8b1 # 1.0.3

test:
runs-on: ${{ matrix.os }}
strategy:
Expand Down
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# pre-commit
# Ref: https://pre-commit.com/#usage
# ------------------------------------------------------------------------------

default_language_version:
python: '3.14'

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
hooks:
- id: check-merge-conflict
- id: check-case-conflict
- id: check-ast
- id: debug-statements
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
exclude_types: [csv]
- id: trailing-whitespace
2 changes: 1 addition & 1 deletion docs/source/readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ README.md
==========

.. include:: ../../README.md
:parser: myst_parser.sphinx_
:parser: myst_parser.sphinx_
1 change: 0 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@
@pytest.fixture
def test_file_path():
return Path(__file__).parent / "files" / "rwservlet.pdf"

1 change: 0 additions & 1 deletion tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,3 @@ def test_local_buffer():
def test_local_path(test_file_path):
"""parse file path"""
assert parser.from_file(str(test_file_path))

2 changes: 1 addition & 1 deletion tests/test_prep.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Tika
Tika supports dozens of document types. Each should be tested when extended
Client applications manage event streams, so test stream type/doc type combinations

Document types
pdf - http://www.fns.usda.gov/sites/default/files/snap/2014-SNAP-Retailer-Management-Annual-Report.pdf
pdf - http://dcra.dc.gov/sites/default/files/dc/sites/dcra/publication/attachments/ai_NuisanceAbatement.pdf
Expand Down
1 change: 0 additions & 1 deletion tika/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@ def getMimeTypes():

def getDetectors():
return getConfig('detectors')[1]

1 change: 0 additions & 1 deletion tika/tika.py
Original file line number Diff line number Diff line change
Expand Up @@ -903,4 +903,3 @@ def main(argv=None):
else:
out.write(resp)
out.write('\n')

9 changes: 4 additions & 5 deletions tika/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# 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.
#
#

from .tika import ServerEndpoint, Translator, callServer, doTranslate1

Expand All @@ -38,7 +38,7 @@ def from_buffer(string, srcLang, destLang, serverEndpoint=ServerEndpoint, reques
:param serverEndpoint:
:return:
'''
status, response = callServer('put', ServerEndpoint, '/translate/all/'+Translator+'/'+srcLang+'/'+destLang,
status, response = callServer('put', ServerEndpoint, '/translate/all/'+Translator+'/'+srcLang+'/'+destLang,
string, {'Accept': 'text/plain'}, False, requestOptions=requestOptions)
return response

Expand All @@ -51,7 +51,7 @@ def auto_from_file(filename, destLang, serverEndpoint=ServerEndpoint, requestOpt
:return:
'''
jsonOutput = doTranslate1(destLang, filename, serverEndpoint, requestOptions=requestOptions)
return jsonOutput[1]
return jsonOutput[1]

def auto_from_buffer(string, destLang, serverEndpoint=ServerEndpoint, requestOptions={}):
'''
Expand All @@ -61,7 +61,6 @@ def auto_from_buffer(string, destLang, serverEndpoint=ServerEndpoint, requestOpt
:param serverEndpoint: Tika server end point (Optional)
:return:
'''
status, response = callServer('put', ServerEndpoint, '/translate/all/'+Translator+'/'+destLang,
status, response = callServer('put', ServerEndpoint, '/translate/all/'+Translator+'/'+destLang,
string, {'Accept': 'text/plain'}, False, requestOptions=requestOptions)
return response

Loading