Skip to content

Instantly share code, notes, and snippets.

View atkm's full-sized avatar

Atsuya Kumano atkm

  • California, USA
View GitHub Profile
@atkm
atkm / metha_to_postgres.py
Last active October 15, 2017 01:26
Populate Postgres with arXiv articles
from app import db
from models import Article, Author, Category, article_author, article_category
import os, gzip, glob
from datetime import datetime
import xml.etree.ElementTree as ET
def get_title(record):
arXiv_prefix = '{http://arxiv.org/OAI/arXiv/}'
metadata = record.find('metadata').find(arXiv_prefix + "arXiv")