atm.data module

Functions

copy_files(extension, source[, target])

Copy matching files from source to target.

download_demo(datasets[, path])

get_demos([args])

load_data(name, path[, aws_access_key, …])

Load data from the given path.

atm.data.copy_files(extension, source, target=None)[source]

Copy matching files from source to target.

Scan the source folder and copy any file that end with the given extension to the target folder.

Both source and target are expected to be either a str or a list or tuple of strings to be joined using os.path.join.

sourec will be interpreted as a path relative to the atm root code folder, and target will be interpreted as a path relative to the user’s current working directory.

If target is None, source will be used, and if the target directory does not exist, it will be created.

Parameters
  • extension (str) – File extension to copy.

  • source (str or iterabe) – Source directory.

  • target (str or iterabe or None) – Target directory. Defaults to None.

Returns

Dictionary containing the file names without extension as keys and the new paths as values.

Return type

dict

atm.data.download_demo(datasets, path=None)[source]
atm.data.get_demos(args=None)[source]
atm.data.load_data(name, path, aws_access_key=None, aws_secret_key=None)[source]

Load data from the given path.

If the path is an URL or an S3 path, download it and make a local copy of it to avoid having to dowload it later again.

Parameters
  • name (str) – Name of the dataset. Used to cache the data locally.

  • path (str) – Local path or S3 path or URL.

  • aws_access_key (str) – AWS access key. Optional.

  • aws_secret_key (str) – AWS secret key. Optional.

Returns

The loaded data.

Return type

pandas.DataFrame