Package acis_xmlrpc :: Module responses :: Class ACISDataResponse
[hide private]
[frames] | no frames]

Class ACISDataResponse

source code

  object --+    
           |    
ACISResponse --+
               |
              ACISDataResponse

Acts as a wrapper to delivering data in different formats.


To Do: Add flags to output

Instance Methods [hide private]
 
__init__(self, data, options)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__str__(self)
str(x)
source code
 
as_json(self)
Returns: data as a json string
source code
string
as_delimited(self, delim=',')
Returns: A string of data delimited by delim.
source code

Inherited from ACISResponse: as_format

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__

Class Variables [hide private]
  status_code = 200
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, data, options)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Parameters:
  • data - The data dictionary.
  • options - The options used to create the data.

    data should have the following structure:
       data = {
           'code': # Status code
           'data': {
               'dates': # List of date tuples corresponding to vars
               <stn>: {
                   '<var>_code': # Status code for this variable 
                   '<var>': # List of variable vaules (actual data)
                   '<var>_valid_flags': # List of valid flags for <var>
                   '<var>_flags': # List of measurement flags for <var>
               }
           }
       }
    
Overrides: object.__init__

__str__(self)
(Informal representation operator)

source code 
str(x)
Overrides: object.__str__
(inherited documentation)

as_json(self)

source code 
Returns:
data as a json string

as_delimited(self, delim=',')

source code 
Parameters:
  • delim - The string delimiter
Returns: string
A string of data delimited by delim.