Skip to content

Instantly share code, notes, and snippets.

@jseabold
Created September 26, 2013 14:40
Show Gist options
  • Select an option

  • Save jseabold/6715147 to your computer and use it in GitHub Desktop.

Select an option

Save jseabold/6715147 to your computer and use it in GitHub Desktop.
pysal gal reader monkey-patched to open urls
class MonkeyOpen(pysal.IOHandlers.gal.GalIO):
FORMATS = ['gal']
MODES = ['r', 'w']
def __init__(self, *args, **kwargs):
self._typ = str
pysal.core.FileIO.FileIO.__init__(self, *args, **kwargs)
self.file = urlopen(self.dataPath)
@staticmethod
def getType(*args, **kwargs):
return "gal"
fin = MonkeyOpen(url, "r")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment