Created
October 4, 2022 14:06
-
-
Save kacperlukawski/632f8c481eb651d8eb8004caa02b9edf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pathlib import Path | |
from urllib.request import urlretrieve | |
from embetter.base import EmbetterBase | |
class DownloadFile(EmbetterBase): | |
def __init__(self, out_dir: Path): | |
self.out_dir = out_dir | |
def transform(self, X, y=None): | |
output_paths = [] | |
for x in X: | |
output_file = self.out_dir / Path(x).name | |
urlretrieve(x, output_file) | |
output_paths.append(str(output_file)) | |
return output_paths |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment