Metadata-Version: 2.1
Name: timexy
Version: 0.1.1
Summary: A spaCy custom component that extracts and normalizes dates and other temporal expressions
Home-page: https://github.com/paulrinckens/timexy
License: MIT
Keywords: python,spaCy,custom component,date time extraction,timex3
Author: Paul Rinckens
Maintainer: Paul Rinckens
Requires-Python: >=3.7,<4.0
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Environment :: MacOS X
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: spacy (>=3.2.2,<4.0.0)
Project-URL: Documentation, https://github.com/paulrinckens/timexy#readme
Project-URL: Repository, https://github.com/paulrinckens/timexy
Description-Content-Type: text/markdown

# Timexy 🕙 📅
A [spaCy](https://spacy.io/) [custom component](https://spacy.io/usage/processing-pipelines#custom-components) that extracts and normalizes dates and other temporal expressions.

## Features
- :boom: Extract dates and durations for various languages. See [here](#supported-languages) a list of currently supported languages
- :boom: Normalize dates to timestamps or normalize dates and durations to the [TimeML TIMEX3 standard](http://www.timeml.org/publications/timeMLdocs/timeml_1.2.1.html#timex3)

## Supported Languages
- 🇩🇪 German
- :uk: English
- 🇫🇷 French

## Installation
````
pip install timexy
````
## Usage
After installation, simply integrate the timexy component in any of your spaCy pipelines to extract and normalize dates and other temporal expressions:

```py
import spacy
from timexy import Timexy

nlp = spacy.load("en_core_web_sm")

# Optionally add config if varying from default values
config = {
    "kb_id_type": "timex3",  # possible values: 'timex3'(default), 'timestamp'
    "label": "timexy",  # default: 'time'
    "overwrite": False  # default: False
}
nlp.add_pipe("timexy", config=config)

doc = nlp("Today is the 10.10.2010. I was in Paris for six years.")
for e in doc.ents:
    print(f"{e.text}\t{e.label_}\t{e.kb_id_}")    
```

```bash
>>> 10.10.2010    timexy    TIMEX3 type="DATE" value="2010-10-10T00:00:00"
>>> six years     timexy    TIMEX3 type="DURATION" value="P6Y"
```
## Contributing
Please refer to the contributing guidelines [here](https://github.com/paulrinckens/timexy/blob/main/CONTRIBUTINIG.md).

