Example #1
0
    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
Example #2
0
    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)
Example #3
0
    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)
Example #4
0
    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
Example #5
0
    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
Example #6
0
 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))
Example #7
0
 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))
Example #8
0
    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)
Example #9
0
    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
Example #10
0
    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)