Example #1
0
def get_basic_record_information(record):
    from utils import parse_and_format_date
    source = record['_source']

    # Collaborations
    collaborations = source.get('collaborations', [])
    if isinstance(collaborations, basestring):
        collaborations = [collaborations]

    authors = source.get('summary_authors', None)
    if authors:
        authors = map(lambda x: x['full_name'], authors)

    datestring = source.get('creation_date')

    res = source
    res['collaborations'] = collaborations
    res['authors'] = authors
    res['date'] = parse_and_format_date(datestring)

    return res
Example #2
0
def get_basic_record_information(record):
    from utils import parse_and_format_date

    source = record["_source"]

    # Collaborations
    collaborations = source.get("collaborations", [])
    if isinstance(collaborations, basestring):
        collaborations = [collaborations]

    authors = source.get("summary_authors", None)
    if authors:
        authors = map(lambda x: x["full_name"], authors)

    datestring = source.get("creation_date")

    res = source
    res["collaborations"] = collaborations
    res["authors"] = authors
    res["date"] = parse_and_format_date(datestring)

    return res
Example #3
0
def parse_and_format_date_en_AU(datestr):
    return utils.parse_and_format_date(datestr, settings={'DATE_ORDER': 'DMY'})
def parse_and_format_date_german(datestr):
    return utils.parse_and_format_date(datestr, languages=["de", "en"])