parameters: (ctx, obj, parse_context)
return_statement: return Reader()
docstring: Creates a field reader for reading from Json
      Calls ctx.cry_error() if a field not found (except opt variants).
  
      Args:
          ctx: the Context object to call cry_error() on failure
          obj: the object to read from
          parse_context: string describing the current context, should work following the word 'in'
      Returns:
          A Reader object, used for reading from a JSON object
docstring_summary: Creates a field reader for reading from Json
      Calls ctx.cry_error() if a field not found (except opt variants).
docstring_tokens: Creates a field reader for reading from Json Calls ctx . cry_error () if a field not found ( except opt variants ) .
function: def _create_field_reader(ctx, obj, parse_context):
      '''
      Creates a field reader for reading from Json
      Calls ctx.cry_error() if a field not found (except opt variants).
  
      Args:
          ctx: the Context object to call cry_error() on failure
          obj: the object to read from
          parse_context: string describing the current context, should work following the word 'in'
      Returns:
          A Reader object, used for reading from a JSON object
      '''
      class Reader(object):
          def field_opt(self, field_name, default=None):
              return obj.get(field_name, default)
  
          def field_req(self, field_name):
              val = self.field_opt(field_name)
              if val != None: # != None required because [] is valid, but triggers false
                  return val
              else:
                  ctx.cry_error('Failed to read field {} in {}.'.format(
                      field_name, parse_context))
                  return None
  
          def field_int(self, field_name):
              val_str = self.field_req(field_name)
              val = None
              try:
                  val = int(val_str)
              except ValueError as err:
                  ctx.cry_error('Failed to parse {} field with value {} in {}: {}'.format(
                      field_name, val, parse_context, err))
              return val
  
          def uuid(self, field_name = GEMS_UUID_KEY):
              '''
              Attempt to parse the field into a UUID.
              '''
              id_str = self.field_req(field_name)
              id = None
              try:
                  id = uuid.UUID(hex=id_str)
              except ValueError as err:
                  ctx.cry_error('Failed to parse {} field with value {} in {}: {}.'.format(
                      field_name, id_str, parse_context, err))
              return id
  
          def version(self, field_name = GEMS_VERSION_KEY):
              ver_str = self.field_req(field_name)
              return Version(ctx, ver_str)
  
      return Reader()
function_tokens: def _create_field_reader ( ctx , obj , parse_context ) : class Reader ( object ) : def field_opt ( self , field_name , default = None ) : return obj . get ( field_name , default ) def field_req ( self , field_name ) : val = self . field_opt ( field_name ) if val != None : # != None required because [] is valid, but triggers false return val else : ctx . cry_error ( 'Failed to read field {} in {}.' . format ( field_name , parse_context ) ) return None def field_int ( self , field_name ) : val_str = self . field_req ( field_name ) val = None try : val = int ( val_str ) except ValueError as err : ctx . cry_error ( 'Failed to parse {} field with value {} in {}: {}' . format ( field_name , val , parse_context , err ) ) return val def uuid ( self , field_name = GEMS_UUID_KEY ) : '''
              Attempt to parse the field into a UUID.
              ''' id_str = self . field_req ( field_name ) id = None try : id = uuid . UUID ( hex = id_str ) except ValueError as err : ctx . cry_error ( 'Failed to parse {} field with value {} in {}: {}.' . format ( field_name , id_str , parse_context , err ) ) return id def version ( self , field_name = GEMS_VERSION_KEY ) : ver_str = self . field_req ( field_name ) return Version ( ctx , ver_str ) return Reader ( )