{"id":19670925,"url":"https://github.com/mohitmun/sutime","last_synced_at":"2026-06-15T05:32:18.711Z","repository":{"id":39961937,"uuid":"99354995","full_name":"mohitmun/sutime","owner":"mohitmun","description":"Python bindings for SUTime, can run on heroku freetier","archived":false,"fork":false,"pushed_at":"2022-05-20T20:47:40.000Z","size":44,"stargazers_count":2,"open_issues_count":4,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-27T04:50:05.281Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mohitmun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-04T15:15:39.000Z","updated_at":"2023-03-04T11:18:38.000Z","dependencies_parsed_at":"2022-08-30T10:10:27.443Z","dependency_job_id":null,"html_url":"https://github.com/mohitmun/sutime","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mohitmun/sutime","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohitmun%2Fsutime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohitmun%2Fsutime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohitmun%2Fsutime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohitmun%2Fsutime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mohitmun","download_url":"https://codeload.github.com/mohitmun/sutime/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohitmun%2Fsutime/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34349925,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-11T17:07:31.522Z","updated_at":"2026-06-15T05:32:18.696Z","avatar_url":"https://github.com/mohitmun.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sutime\n*Python wrapper for Stanford CoreNLP's [SUTime](http://nlp.stanford.edu/software/sutime.shtml) Java library*\ndc\n#### Build Status\n\n![CircleCi Build Status](https://circleci.com/gh/FraBle/python-sutime.svg?style=shield\u0026circle-token=c5b5f420bcb888abc19312d711493cb9d1641503)\n\n#### Introduction\n\nThis library provides a simple access to SUTime functions in Python.\n\n\n#### Installation\n\n```bash\n\u003e\u003e pip install sutime\n\u003e\u003e # use package pom.xml to install all Java dependencies via Maven into ./jars\n\u003e\u003e mvn dependency:copy-dependencies -DoutputDirectory=./jars\n```\n\n#### Example\n```python\nimport os\nimport json\nfrom sutime import SUTime\n\nif __name__ == '__main__':\n    test_case = u'I need a desk for tomorrow from 2pm to 3pm'\n    \n    jar_files = os.path.join(os.path.dirname(__file__), 'jars')\n    sutime = SUTime(jars=jar_files, mark_time_ranges=True)\n\n    print(json.dumps(sutime.parse(test_case), sort_keys=True, indent=4))\n```\nResult:\n```json\n[\n    {\n        \"end\": 26,\n        \"start\": 18,\n        \"text\": \"tomorrow\",\n        \"type\": \"DATE\",\n        \"value\": \"2016-10-14\"\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/test_sutime.py) directory.\n\n#### Functions\n```python\nSUTime(jars=[], jvm_started=False, mark_time_ranges=False, include_range=False)\n    \"\"\"\n    jars: List of paths to the SUTime Java dependencies.\n    jvm_started: Optional attribute to specify if the JVM has already been\n        started (with all Java dependencies loaded).\n    mark_time_ranges: Optional attribute to specify CoreNLP property\n        sutime.markTimeRanges. Default is False.\n        \"Tells sutime to mark phrases such as 'From January to March'\n        instead of marking 'January' and 'March' separately\"\n    include_range: Optional attribute to specify CoreNLP property\n        sutime.includeRange. Default is False.\n        \"Tells sutime to mark phrases such as 'From January to March'\n        instead of marking 'January' and 'March' separately\"\n    \"\"\"\n\nsutime.parse(input_str, reference_date=''):\n    \"\"\"Parses datetime information out of string input.\n\n    It invokes the SUTimeWrapper.annotate() function in Java.\n\n    Args:\n        input_str: The input as string that has to be parsed.\n        reference_date: Optional reference data for SUTime.\n\n    Returns:\n        A list of dicts with the result from the SUTimeWrapper.annotate()\n            call.\n\n    Raises:\n        RuntimeError: An error occurres when CoreNLP is not loaded.\n    \"\"\"\n```\n\n#### Future Work\n- fixing all upcoming bug reports and issues.\n\n#### Credit\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#### License\n- GPLv3+ (check the LICENSE file)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohitmun%2Fsutime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohitmun%2Fsutime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohitmun%2Fsutime/lists"}