# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['sutime', 'sutime.test']

package_data = \
{'': ['*'], 'sutime': ['jars/stanford-corenlp-sutime-python-1.4.0.jar']}

install_requires = \
['JPype1>=1.1.2,<2.0.0']

setup_kwargs = {
    'name': 'sutime',
    'version': '1.0.1',
    'description': "A Python wrapper for Stanford CoreNLP's SUTime",
    'long_description': '# sutime\n*Python wrapper for Stanford CoreNLP\'s [SUTime](http://nlp.stanford.edu/software/sutime.shtml) Java library.*  \nDocs are also hosted on [GitHub Pages](https://frable.github.io/python-sutime/).\n\n## Build Status\n\n#### Travis CI Builds\n[![Travis CI](https://travis-ci.com/FraBle/python-sutime.svg?branch=master)](https://travis-ci.com/FraBle/python-sutime)\n\n#### PyPI\n[![PyPI Version](https://img.shields.io/pypi/v/sutime.svg)](https://pypi.org/project/sutime/)\n[![PyPI Downloads](https://img.shields.io/pypi/dm/sutime.svg)](https://pypi.org/project/sutime/)\n\n#### Code Quality\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/5b9cb504d8b040b38f86157ad75ecd96)](https://app.codacy.com/gh/FraBle/python-sutime?utm_source=github.com&utm_medium=referral&utm_content=FraBle/python-sutime&utm_campaign=Badge_Grade)\n[![Scrutinizer](https://img.shields.io/scrutinizer/g/FraBle/python-sutime.svg)](https://scrutinizer-ci.com/g/FraBle/python-sutime/)\n[![Coverity Scan](https://img.shields.io/coverity/scan/22017.svg)](https://scan.coverity.com/projects/python-sutime)\n[![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability/FraBle/python-sutime.svg)](https://codeclimate.com/github/FraBle/python-sutime/maintainability)\n[![CodeFactor](https://www.codefactor.io/repository/github/frable/python-sutime/badge)](https://www.codefactor.io/repository/github/frable/python-sutime)\n[![Requirements Status](https://requires.io/github/FraBle/python-sutime/requirements.svg?branch=master)](https://requires.io/github/FraBle/python-sutime/requirements/?branch=master)\n\n## Installation\n\n```bash\n>> # Ideally, create a virtual environment before installing any dependencies\n>> pip install sutime\n>> # Install Java dependencies\n>> mvn dependency:copy-dependencies -DoutputDirectory=./jars -f $(python3 -c \'import importlib; import pathlib; print(pathlib.Path(importlib.util.find_spec("sutime").origin).parent / "pom.xml")\')\n```\n\nAppend `-P spanish` to the `mvn` command to include the Spanish language model.\n\n## Supported Languages\n\nSUTime currently supports only English, British and Spanish ([Source](https://github.com/stanfordnlp/CoreNLP/tree/master/src/edu/stanford/nlp/time/rules)).\nThis Python wrapper is prepared to support the other CoreNLP languages (e.g. German) as well as soon as they get added to SUTime.\nThe following command can be used to download the language models for `arabic`, `chinese`, `english`, `french`, `german`, and `spanish`:\n\n```bash\n>> mvn dependency:copy-dependencies -DoutputDirectory=./jars -f $(python -c \'import importlib; import pathlib; print(pathlib.Path(importlib.util.find_spec("sutime").origin).parent / "pom.xml")\') -P <language>\n```\n\n*However, SUTime only supports a subset (default model and `spanish`) of CoreNLP\'s languages and the other language models will get ignored.*\n\n## Example\n\n```python\nimport json\nfrom sutime import SUTime\n\nif __name__ == \'__main__\':\n    test_case = \'I need a desk for tomorrow from 2pm to 3pm\'\n    sutime = SUTime(mark_time_ranges=True, include_range=True)\n    print(json.dumps(sutime.parse(test_case), sort_keys=True, indent=4))\n```\n\nResult:\n\n```json\n[\n    {\n        "end": 26,\n        "start": 18,\n        "text": "tomorrow",\n        "timex-value": "2020-11-03",\n        "type": "DATE",\n        "value": "2020-11-03"\n    },\n    {\n        "end": 42,\n        "start": 27,\n        "text": "from 2pm to 3pm",\n        "type": "DURATION",\n        "value": {\n            "begin": "T14:00",\n            "end": "T15:00"\n        }\n    }\n]\n```\n\nOther examples can be found in the [test](https://github.com/FraBle/python-sutime/blob/master/sutime/test) directory.\n\n## Functions\n\n```python\nSUTime(\n    jars: Optional[str] = None,\n    jvm_started: Optional[bool] = False,\n    mark_time_ranges: Optional[bool] = False,\n    include_range: Optional[bool] = False,\n    jvm_flags: Optional[List[str]] = None,\n    language: Optional[str] = \'english\',\n):\n    """\n    Args:\n        jars (Optional[str]): Path to previously downloaded SUTime Java\n            dependencies. Defaults to False.\n        jvm_started (Optional[bool]): Flag to indicate that JVM has been\n            already started (with all Java dependencies loaded). Defaults\n            to False.\n        mark_time_ranges (Optional[bool]): SUTime flag for\n            sutime.markTimeRanges. Defaults to False.\n            "Whether or not to recognize time ranges such as \'July to\n            August\'"\n        include_range (Optional[bool]): SUTime flag for\n            sutime.includeRange. Defaults to False.\n            "Whether or not to add range info to the TIMEX3 object"\n        jvm_flags (Optional[List[str]]): List of flags passed to JVM. For\n            example, this may be used to specify the maximum heap size\n            using \'-Xmx\'. Has no effect if `jvm_started` is set to True.\n            Defaults to None.\n        language (Optional[str]): Selected language. Currently supported\n            are: english (/en), british, spanish (/es). Defaults to\n            `english`.\n    """\n\nsutime.parse(input_str: str, reference_date: Optional[str] = \'\') -> List[Dict]:\n    """Parse datetime information out of string input.\n\n    It invokes the SUTimeWrapper.annotate() function in Java.\n\n    Args:\n        input_str (str): The input as string that has to be parsed.\n        reference_date (Optional[str]): Optional reference data for SUTime.\n            Defaults to `\'\'`.\n\n    Returns:\n        A list of dicts with the result from the `SUTimeWrapper.annotate()`\n        call.\n\n    Raises:\n        RuntimeError: An error occurs when CoreNLP is not loaded.\n    """\n```\n\n## Credit\n\n-   [The team behind Stanford CoreNLP](http://stanfordnlp.github.io/CoreNLP/) for their awesome work and tools for the NLP community\n-   [Luis Nell (Github: originell) and team](https://github.com/originell/jpype/) for maintaining JPype as interface between Python and Java\n\n## Contributions\n\n-   [René Springer](https://github.com/r-springer): Support for reference date\n-   [Constantine Lignos](https://github.com/ConstantineLignos): Support for JVM flags, adoption of CircleCI 2.0, fix for mutable default argument, fix for test execution\n-   [Cole Robertson](https://github.com/cbjrobertson): Updated instructions, JAR requirements, and SUTime JAR imports\n-   [Ludovico Pestarino](https://github.com/arkeane): Modified json.loads for compatibility with json data (string handling)\n\n## License\n\n-   GPLv3+ (check the LICENSE file)\n',
    'author': 'Frank Blechschmidt',
    'author_email': 'contact@frank-blechschmidt.com',
    'maintainer': None,
    'maintainer_email': None,
    'url': 'https://github.com/FraBle/python-sutime',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'python_requires': '>=3.6,<4.0',
}


setup(**setup_kwargs)
