{"id":17959134,"url":"https://github.com/stumpylog/tika-client","last_synced_at":"2025-03-25T03:31:08.435Z","repository":{"id":166510261,"uuid":"642000875","full_name":"stumpylog/tika-client","owner":"stumpylog","description":"A modern Python REST client for Apache Tika server","archived":false,"fork":false,"pushed_at":"2025-03-06T21:22:51.000Z","size":2271,"stargazers_count":15,"open_issues_count":0,"forks_count":5,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-16T16:37:40.997Z","etag":null,"topics":["api","hacktoberfest","python","python3","tika","tika-python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stumpylog.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"stumpylog"}},"created_at":"2023-05-17T15:49:56.000Z","updated_at":"2025-02-05T09:47:20.000Z","dependencies_parsed_at":"2024-01-01T16:25:44.800Z","dependency_job_id":"4df59188-5995-4772-af79-262fe0711ee0","html_url":"https://github.com/stumpylog/tika-client","commit_stats":{"total_commits":123,"total_committers":3,"mean_commits":41.0,"dds":"0.13008130081300817","last_synced_commit":"888fe7653493f39b096d73a31c22fa81e40417bd"},"previous_names":["stumpylog/tika-rest-client","stumpylog/tika-client"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stumpylog%2Ftika-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stumpylog%2Ftika-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stumpylog%2Ftika-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stumpylog%2Ftika-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stumpylog","download_url":"https://codeload.github.com/stumpylog/tika-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245394579,"owners_count":20608115,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","hacktoberfest","python","python3","tika","tika-python"],"created_at":"2024-10-29T11:01:32.940Z","updated_at":"2025-03-25T03:31:08.393Z","avatar_url":"https://github.com/stumpylog.png","language":"Python","funding_links":["https://github.com/sponsors/stumpylog"],"categories":[],"sub_categories":[],"readme":"# Tika Rest Client\n\n[![PyPI - Version](https://img.shields.io/pypi/v/tika-client.svg)](https://pypi.org/project/tika-client)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/tika-client.svg)](https://pypi.org/project/tika-client)\n[![codecov](https://codecov.io/github/stumpylog/tika-client/branch/main/graph/badge.svg?token=PTESS6YUK5)](https://codecov.io/github/stumpylog/tika-client)\n\n---\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Why](#why)\n- [License](#license)\n\n## Features\n\n- Simplified: No need to worry about XML or JSON responses, downloading a Tika jar file or Python 2\n- Support for Tika 2+ only (including Tika v3, which didn't change the API)\n- Based on the modern [httpx](https://github.com/encode/httpx) library\n- Full support for type hinting\n- Nearly full test coverage run against an actual Tika server for multiple Python and PyPy versions\n- Uses HTTP multipart/form-data to stream files to the server (instead of reading into memory)\n- Optional compression for parsing from a file content already in a buffer (as opposed to a file)\n\n## Installation\n\n```console\npip3 install tika-client\n```\n\n## Usage\n\n```python3\nfrom pathlib import Path\nfrom tika_client import TikaClient\n\ntest_file = Path(\"sample.docx\")\n\n\nwith TikaClient(\"http://localhost:9998\") as client:\n\n    # Extract a document's metadata\n    metadata = client.metadata.from_file(test_file)\n\n    # Get the content of a document as HTML\n    data = client.tika.as_html.from_file(test_file)\n\n    # Or as plain text\n    text = client.tika.as_text.from_file(test_file)\n\n    # Content and metadata combined\n    data = client.rmeta.as_text.from_file(test_file)\n\n    # The mime type can also be given\n    # This allows Content-Type to be set most accurately\n    text = client.tika.as_text.from_file(test_file,\n                                         \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\")\n\n```\n\nThe Tika REST API documentation can be found [here](https://cwiki.apache.org/confluence/display/TIKA/TikaServer).\nAt the moment, only the metadata, tika and recursive metadata endpoints are implemented.\n\nUnfortunately, the set of possible return values of the Tika API are not very well documented. The library makes\na best effort to extract relevant fields into type properties where it understands more about the mime type\nof the document (as returned by Tika). This includes information like created/modified information as time zone\naware `datetime` objects. The full JSON response is always available to the user under the `.data`\nattribute.\n\nWhen a particular key is not present in the response, all properties will return `None` instead.\n\n## Why\n\nOnly one other library for interfacing with Tika exists that I know of. I find it too complicated, trying to handle\na lot of differing uses.\n\nThe biggest issue I have with the library is its downloading and running of a jar file if needed. To me, an\nAPI client should only interface to the API and not try to provide functionality to start\nthe API as well. The user is responsible for providing the server with the Tika version they desire.\n\nThe library also provides a lot of knobs to turn, but I argue most developers will not want to configure XML as\nthe response type, they just want the data, already parsed to the maximum extend possible.\n\nThis library attempts to provide a simpler interface, minimal lines of code and typing of the parsed response.\n\n## License\n\n`tika-client` is distributed under the terms of the [Mozilla Public License 2.0](https://spdx.org/licenses/MPL-2.0.html) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstumpylog%2Ftika-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstumpylog%2Ftika-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstumpylog%2Ftika-client/lists"}