Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
#!/usr/bin/env python
import sys
import pysolr
import unicodecsv
import machinetag
import bz2
if __name__ == '__main__':
people = sys.argv[1]
fh = bz2.BZ2File(people, 'r')
reader = unicodecsv.UnicodeReader(fh)
docs = []
endpoint = 'http://localhost:8984/solr/whosonfirst'
solr = pysolr.Solr(endpoint)
for row in reader:
doc = {
'uri': 'x-urn:ch:id=%s' % row['id'],
'collection': 'cooperhewitt',
'collection_id': row['id'],
'name' : row['name']
}
concordances = []