def __init__(self, **kwargs): DataResource.__init__(self, **kwargs) self.url = EurostatStore._url + '/data/{0}/?'.format(self.id) self.dsd_url = EurostatStore._url + '/datastructure/ESTAT/DSD_{0}'.format( self.id) self._dsd = None
def __init__(self, _store=None, resources=None, **kwargs): DataResource.__init__(self, **kwargs) if _store is None: raise ValueError('_store must be passed') else: self.store = _store if resources is None: self.resources = None elif isinstance(resources, list): self.resources = [CKANResource(_store=self.store, **r) for r in resources] else: raise ValueError(type(resources), resources)
def __init__(self, _store=None, resources=None, **kwargs): DataResource.__init__(self, **kwargs) if _store is None: raise ValueError('_store must be passed') else: self.store = _store if resources is None: self.resources = None elif isinstance(resources, list): self.resources = [ CKANResource(_store=self.store, **r) for r in resources ] else: raise ValueError(type(resources), resources)
def __init__(self, _store=None, resources=None, name=None, **kwargs): DataResource.__init__(self, **kwargs) if _store is None: raise ValueError('_store must be passed') else: self.store = _store if name is None: raise ValueError("Package doesn't have 'name' attribute") else: self.name = name if isinstance(resources, list): self._resources = [CKANResource(_store=self.store, **r) for r in resources] else: self._resources = None
def __init__(self, _store=None, resources=None, name=None, **kwargs): DataResource.__init__(self, **kwargs) if _store is None: raise ValueError('_store must be passed') else: self.store = _store if name is None: raise ValueError("Package doesn't have 'name' attribute") else: self.name = name if isinstance(resources, list): self._resources = [ CKANResource(_store=self.store, **r) for r in resources ] else: self._resources = None
def read(self, raw=False, **kwargs): if self.resources is None: return DataResource.read(self, raw=raw, **kwargs) else: source_len = len(self.resources) if source_len == 0: return pd.DataFrame() elif source_len == 1: return self.resources[0].read(raw=raw, **kwargs) else: raise ValueError('Package has {0} resources. Use CKANResource.read()'.format(source_len))
def read(self, raw=False, **kwargs): if self.resources is None: return DataResource.read(self, raw=raw, **kwargs) else: source_len = len(self.resources) if source_len == 0: return pd.DataFrame() elif source_len == 1: return self.resources[0].read(raw=raw, **kwargs) else: raise ValueError( 'Package has {0} resources. Use CKANResource.read()'. format(source_len))
def __init__(self, **kwargs): DataResource.__init__(self, **kwargs) # query = 'DataMartId={0}&DataFilter={1}&Format=csv'.format(self.mart, self.code) self.url = UNdataStore._url + '/DocumentDownloadHandler.ashx?t=bin&id={0}'.format( self.id)
def __init__(self, **kwargs): DataResource.__init__(self, **kwargs) self.url = EurostatStore._url + '/data/{0}/?'.format(self.id) self.dsd_url = EurostatStore._url + '/datastructure/ESTAT/DSD_{0}'.format(self.id) self._dsd = None
def __init__(self, **kwargs): DataResource.__init__(self, **kwargs) # query = 'DataMartId={0}&DataFilter={1}&Format=csv'.format(self.mart, self.code) self.url = UNdataStore._url + '/DocumentDownloadHandler.ashx?t=bin&id={0}'.format(self.id)