Used to extract dates and times described as text.
Initialize a DateService for extracting dates from text.
Convert a datetime object representing into a human-ready string that can be read, spoken aloud, etc. In effect, runs both convertDay and convertTime on the input, merging the results.
date (datetime.date): A datetime object to be converted into text. prefix (str): An optional argument that prefixes the converted
string. For example, if prefix=”in”, you’d receive “in two days”, rather than “two days”, while the method would still return “tomorrow” (rather than “in tomorrow”).
Convert a datetime object representing a day into a human-ready string that can be read, spoken aloud, etc.
day (datetime.date): A datetime object to be converted into text. prefix (str): An optional argument that prefixes the converted
string. For example, if prefix=”in”, you’d receive “in two days”, rather than “two days”, while the method would still return “tomorrow” (rather than “in tomorrow”).
Convert a datetime object representing a time into a human-ready string that can be read, spoken aloud, etc.
Returns the first date found in the input string, or None if not found.
Extract semantic date information from an input string. In effect, runs both parseDay and parseTime on the input string and merges the results to produce a comprehensive datetime object.
Returns the first time-related date found in the input string, or None if not found.
Extracts all day-related information from an input string. Ignores any information related to the specific time-of-day.
Returns the first time-related date found in the input string, or None if not found.
Extracts time-related information from an input string. Ignores any information related to the specific date, focusing on the time-of-day.
Extract semantic date information from an input string. This is a convenience method which would only be used if you’d rather not initialize a DateService object.
input (str): The input string to be parsed. tz: An optional Pytz timezone. All datetime objects returned will
be relative to the supplied timezone, or timezone-less if none is supplied.