timeseries_scripts/download.py
def download(sources, out_path, archive_version=None,
             start_from_user=None, end_from_user=None):
    """
    Load YAML file with sources from disk, and download all files for each
    source into the given out_path.

    Parameters
    ----------
    sources : dict
        Dict of download parameters specific to each source.
    out_path : str
        Base download directory in which to save all downloaded files.
    archive_version: str, default None
        OPSD Data Package Version to download original data from.
    start_from_user : datetime.date, default None
        Start of period for which to download the data.
    end_from_user : datetime.date, default None
        End of period for which to download the data.

    Returns
    ----------
    None

    """

    for name, date in {'end_from_user': end_from_user,
                       'start_from_user': start_from_user}.items():
        if date and date > datetime.now().date():
            logger.info('%s given was %s, must be smaller than %s, '
                        'we have no data for the future!',
                        name, date, datetime.today().date())
            return

    if archive_version:
        download_archive(archive_version)

    else:
        for source_name, source_dict in sources.items():
            if not source_name == "Energinet.dk":
                download_source(source_name, source_dict, out_path,
                                start_from_user, end_from_user)

    return

    Load YAML file with sources from disk, and download all files for each
    source into the given out_path.

    Parameters
    ----------
    sources : dict
        Dict of download parameters specific to each source.
    out_path : str
        Base download directory in which to save all downloaded files.
    archive_version: str, default None
        OPSD Data Package Version to download original data from.
    start_from_user : datetime.date, default None
        Start of period for which to download the data.
    end_from_user : datetime.date, default None
        End of period for which to download the data.

    Returns
    ----------
    None

    
Load YAML file with sources from disk, and download all files for each
source into the given out_path.

Parameters

sources : dict
Dict of download parameters specific to each source.
out_path : str
Base download directory in which to save all downloaded files.
archive_version: str, default None
OPSD Data Package Version to download original data from.
start_from_user : datetime.date, default None
Start of period for which to download the data.
end_from_user : datetime.date, default None
End of period for which to download the data.

Returns

None
Load YAML file with sources from disk and download all files for each source into the given out_path . Parameters sources : dict Dict of download parameters specific to each source . out_path : str Base download directory in which to save all downloaded files . archive_version : str default None OPSD Data Package Version to download original data from . start_from_user : datetime . date default None Start of period for which to download the data . end_from_user : datetime . date default None End of period for which to download the data . Returns None
def download(sources, out_path, archive_version=None,
             start_from_user=None, end_from_user=None):
    for name, date in {'end_from_user': end_from_user,
                       'start_from_user': start_from_user}.items():
        if date and date > datetime.now().date():
            logger.info('%s given was %s, must be smaller than %s, '
                        'we have no data for the future!',
                        name, date, datetime.today().date())
            return
    if archive_version:
        download_archive(archive_version)
    else:
        for source_name, source_dict in sources.items():
            if not source_name == "Energinet.dk":
                download_source(source_name, source_dict, out_path,
                                start_from_user, end_from_user)
    return
def download ( sources , out_path , archive_version = None , start_from_user = None , end_from_user = None ) : for name , date in { 'end_from_user' : end_from_user , 'start_from_user' : start_from_user } . items ( ) : if date and date > datetime . now ( ) . date ( ) : logger . info ( '%s given was %s, must be smaller than %s, ' 'we have no data for the future!' , name , date , datetime . today ( ) . date ( ) ) return if archive_version : download_archive ( archive_version ) else : for source_name , source_dict in sources . items ( ) : if not source_name == "Energinet.dk" : download_source ( source_name , source_dict , out_path , start_from_user , end_from_user ) return
Load YAML file with sources from disk, and download all files for each
source into the given out_path.
Load YAML file with sources from disk and download all files for each source into the given out_path .
"""
    Load YAML file with sources from disk, and download all files for each
    source into the given out_path.

    Parameters
    ----------
    sources : dict
        Dict of download parameters specific to each source.
    out_path : str
        Base download directory in which to save all downloaded files.
    archive_version: str, default None
        OPSD Data Package Version to download original data from.
    start_from_user : datetime.date, default None
        Start of period for which to download the data.
    end_from_user : datetime.date, default None
        End of period for which to download the data.

    Returns
    ----------
    None

    """
sources
out_path
archive_version
start_from_user
end_from_user