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
sourcefolder and copy any file that end with the givenextensionto thetargetfolder.Both
sourceandtargetare expected to be either astror a list or tuple of strings to be joined usingos.path.join.sourecwill be interpreted as a path relative to theatmroot code folder, andtargetwill be interpreted as a path relative to the user’s current working directory.If
targetisNone,sourcewill be used, and if thetargetdirectory 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