Skip to content

Instantly share code, notes, and snippets.

@nygeog
Created March 13, 2017 21:11
Show Gist options
  • Save nygeog/ae2856645f64efe487321a089f41b9df to your computer and use it in GitHub Desktop.
Save nygeog/ae2856645f64efe487321a089f41b9df to your computer and use it in GitHub Desktop.
import json
def oneTest():
return 'so'
def openJSON(inFile):
with open(inFile) as json_data:
data = json.load(json_data)
return data
def saveJSON(data,ouFile):
with open(ouFile, 'w') as outfile:
json.dump(data, outfile)
def replaceDataset(data,oldTableName,newTableName):
data = json.loads(json.dumps(data).replace(oldTableName,newTableName))
return data
def openFileReplaceDatasetSave(inFile,ouFile,oldTableName,newTableName):
data = replaceDataset( openJSON(inFile) ,oldTableName,newTableName)
saveJSON(data,ouFile)
return data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment