• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

chrismattmann / tika-python / 24964326097

26 Apr 2026 06:49PM UTC coverage: 0.0% (-67.4%) from 67.38%
24964326097

push

github

web-flow
Merge pull request #479 from afuetterer/docs-requirements

build(deps): add dependency-groups

0 of 561 relevant lines covered (0.0%)

0.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/tika/detector.py
1
# Licensed to the Apache Software Foundation (ASF) under one or more
2
# contributor license agreements.  See the NOTICE file distributed with
3
# this work for additional information regarding copyright ownership.
4
# The ASF licenses this file to You under the Apache License, Version 2.0
5
# (the "License"); you may not use this file except in compliance with
6
# the License.  You may obtain a copy of the License at
7
#
8
#     http://www.apache.org/licenses/LICENSE-2.0
9
#
10
# Unless required by applicable law or agreed to in writing, software
11
# distributed under the License is distributed on an "AS IS" BASIS,
12
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
# See the License for the specific language governing permissions and
14
# limitations under the License.
15
#
16

17
from .tika import ServerEndpoint, callServer, detectType1
×
18

19

20
def from_file(filename, config_path=None, requestOptions={}):
×
21
    '''
22
    Detects MIME type of specified file
23
    :param filename: file whose type needs to be detected
24
    :return: MIME type
25
    '''
26
    jsonOutput = detectType1('type', filename, config_path=config_path, requestOptions=requestOptions)
×
27
    return jsonOutput[1]
×
28

29
def from_buffer(string, config_path=None, requestOptions={}):
×
30
    '''
31
    Detects MIME type of the buffered content
32
    :param string: buffered content whose type needs to be detected
33
    :return:
34
    '''
35
    status, response = callServer('put', ServerEndpoint, '/detect/stream', string,
×
36
                                  {'Accept': 'text/plain'}, False, config_path=config_path, requestOptions=requestOptions)
37
    return response
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc