-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1cd319f
commit 4b47bb7
Showing
4 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
* | ||
!kaggle.json |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
venv | ||
data | ||
|
||
kaggle.json |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import os | ||
import zipfile | ||
|
||
data_dir = 'data' | ||
sub_dirs = ['raw','intermediate','preprocessed'] | ||
|
||
|
||
|
||
# data directories tree establishment | ||
try: | ||
os.mkdir(data_dir) | ||
except: | ||
print(f'{data_dir} directory exists!!') | ||
|
||
|
||
for dir in sub_dirs: | ||
try: | ||
os.mkdir(os.path.join(os.curdir,data_dir,dir)) | ||
except: | ||
print(f'{dir} directory exists!!') | ||
|
||
|
||
|
||
|
||
|
||
#UN data download | ||
#UN_URL = 'https://justdata91.s3.us-east-2.amazonaws.com/UNv1.0.ar-en.ar.tar.xz' | ||
#response = requests.get(UN_URL) | ||
#UN_dir = os.path.join(raw_dir,data_sources[0]) | ||
|
||
#if response.status_code == 200: | ||
# with open(os.path.join(UN_dir,'UNv1.0.ar-en.ar.tar.xz'), "wb+") as file: | ||
# file.write(response.content) | ||
# print("Download completed") | ||
#else: | ||
# print("Download Failed!!") | ||
|
||
#with tarfile.open(os.path.join(UN_dir,'UNv1.0.ar-en.ar.tar.xz'),'r') as archive: | ||
# archive.extractall(UN_dir) | ||
# os.remove(os.path.join(UN_dir,'UNv1.0.ar-en.ar.tar.xz')) |