asc package


asc.asc module

asc.cli module module

Data module

This module lets the program to download the data from the server.


Bases: object

Data collection.

clear_zip(url_list, tmp_dir)[source]

Clear the archives

Delete the downloaded archives.

url_list (str): list of strings containing the urls tmp_dir (str): path where are store the archives
download(url_list, dest_dir)[source]

Download data from a list of URLs

Download data from a list of URLs and display a progress according to the size of the file.

url_list(list): list containing URLs of files to download. dest_dir (str): path to where download the data.

Parse a file and transform it into a list

Parse a file line by line to make a list with the urls contained inside.

filename (str): path to the file containing the URLs.
unzip_data(url_list, origin_dir, dest_dir)[source]

Unzip data files

Unzip data files given a list of file names, the path where they are store and where they will be unzipped.

url_list (str): list of strings containing the urls origin_dir (str): directory where are stored the files dest_dir (str): directory where the files will be extracted

asc.utils module


Extract the section and option given the parameter.

Extract the section and option given the parameter that is in the specific format section.option

parameter (str): parameter with the format ‘section.option’
The section and option
asc.utils.ms2smp(ms, sample_rate)[source]

Milliseconds to samples converter.

Simple converter in order to compute the number of samples for a given time frame in milliseconds and the sampling rate.


ms (int): Number of milliseconds. sample_rate (int): Sampling rate in Hertz.
Return the number of sample (forced as an int).
asc.utils.read_config(section, option, config_obj)[source]

Look for a given option in a config file.

If exists, return the value in a config file according to the section and option.

section (str): section related to the option looked for. option (str): option related to the value looked for. config_obj (obj): configparser object.
value given for a specific tuple section/option.
  • Be able to cast the data into the right type.
asc.utils.write_config(section, option, data, config_obj, config_file)[source]

Write/Update the configuration file

Write or update the configuration file according to the section or option provided.


section (str): Name of the section option (str): Name of the option data (str): data related to the option to store config_obj (str): instance of the configuration object) config_file (str): instance of the configuration file where to save

the data
Need to cast the object to string before saving the data.

Module contents

Top-level package for Acoustic Scene Classification.