From a53e7dc054a77c9fef4fa5d0e0638777d9faff71 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 6 Mar 2019 17:30:20 -0800 Subject: small fixes to arxivraw parser --- python/parse_arxivraw_xml.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/parse_arxivraw_xml.py b/python/parse_arxivraw_xml.py index e2fab510..16def821 100644 --- a/python/parse_arxivraw_xml.py +++ b/python/parse_arxivraw_xml.py @@ -118,6 +118,7 @@ class ArxivRawXmlParser(): license_slug = metadata.license.string.strip() abstracts = None if metadata.abstract: + # TODO: test for this multi-abstract code path abstracts = [] abst = metadata.abstract.string.strip() orig = None @@ -144,14 +145,14 @@ class ArxivRawXmlParser(): for version in metadata.find_all('version'): arxiv_id = base_id + version['version'] release_date = version.date.string.strip() - release_date = datetime.datetime.strptime(release_date, "%a, %d %b %Y %H:%M:%S %Z") + release_date = datetime.datetime.strptime(release_date, "%a, %d %b %Y %H:%M:%S %Z").date() versions.append(dict( work_id=None, title=title, #original_title release_type="article-journal", release_status='submitted', # XXX: source_type? - release_date=release_date.isoformat() + "Z", + release_date=release_date.isoformat(), release_year=release_date.year, arxiv_id=arxiv_id, #doi (see below) -- cgit v1.2.3