aleph.data.parse

aleph.data.parse.fuzzy_date_parser(text)

Thin wrapper around parsedatetime module.

Since there’s no upstream suppport for multiple locales, this wrapper exists.

Parameters:text (str) – Text to parse.
Returns:A parsed date/time object. Raises exception on failure.
Return type:datetime
aleph.data.parse.parse_country(country)

Determine a two-letter country code based on an input.

The input may be a country code, a country name, etc.

aleph.data.parse.parse_date(text)

The classic: date parsing, every which way.

aleph.data.parse.parse_domain(text)

Extract a domain name from a piece of text.

aleph.data.parse.parse_email(email)

Parse and normalize an email address.

Returns None if this is not an email address.

aleph.data.parse.parse_phone(number)

Parse a phone number and return in international format.

If no valid phone number can be detected, None is returned. If a country code is supplied, this will be used to infer the prefix.

https://github.com/daviddrysdale/python-phonenumbers

aleph.data.parse.parse_url(text)

Clean and verify a URL.