[geodisambig] Python scripts to prep GeoNames records for trie insertion
This commit is contained in:
15
scripts/geodata/file_utils.py
Normal file
15
scripts/geodata/file_utils.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
|
||||
def unzip_file(filename, dest_dir):
|
||||
subprocess.call(['unzip', '-o', filename, '-d', dest_dir])
|
||||
|
||||
|
||||
def remove_file(filename):
|
||||
os.unlink(filename)
|
||||
|
||||
|
||||
def ensure_dir(d):
|
||||
if not os.path.exists(d):
|
||||
os.makedirs(d)
|
||||
Reference in New Issue
Block a user