atm.data module¶
Functions
|
Copy matching files from source to target. |
|
|
|
|
|
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 givenextension
to thetarget
folder.Both
source
andtarget
are expected to be either astr
or a list or tuple of strings to be joined usingos.path.join
.sourec
will be interpreted as a path relative to theatm
root code folder, andtarget
will be interpreted as a path relative to the user’s current working directory.If
target
isNone
,source
will be used, and if thetarget
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.
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