Package json_to_relation :: Module input_source :: Class InURI
[hide private]
[frames] | no frames]

Class InURI

source code

 object --+    
          |    
InputSource --+
              |
             InURI

Instance Methods [hide private]
 
__init__(self, inFilePathOrURL)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
decompress(self, line) source code
 
close(self) source code
 
determineCompression(self, fileURI)
Given a file path, determine by file extension whether the file is gzip or bzip2 compressed, or whether it is not compressed.
source code
 
ensureFileLocal(self, inFilePathOrURL)
Takes a file path or URL.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

    Inherited from InputSource
 
__enter__(self) source code
 
__exit__(self, excType, excValue, excTraceback) source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, inFilePathOrURL)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

determineCompression(self, fileURI)

source code 

Given a file path, determine by file extension whether the file is gzip or bzip2 compressed, or whether it is not compressed.

Parameters:
  • fileURI (STRING) - item that str() turns into a file path or URL

ensureFileLocal(self, inFilePathOrURL)

source code 

Takes a file path or URL. Sets self.localFilePath to the same path if file is local, or if the file is remote but uncompressed. If a file is remote and compressed, retrieves the file into a local tmp file and returns that file name. In this case the flag self.deleteTempFile is set to True.

Parameters:
  • inFilePathOrURL (String) - file path or URL to file