This repository has been archived by the owner on Aug 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
downloading from Google Cloud Storage instead of AWS S3 (and assuming…
… local credentials for now)
- Loading branch information
Showing
4 changed files
with
26 additions
and
16 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
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 |
---|---|---|
|
@@ -2,5 +2,6 @@ | |
|
||
set -e | ||
|
||
python3 src/download_data.py | ||
python3 src/splitter.py | ||
python3 src/decision_tree.py |
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,25 @@ | ||
import os | ||
from google.cloud import storage | ||
|
||
def load_data(): | ||
gcsBucket = "continuous-intelligence" | ||
key = "store47-2016.csv" | ||
|
||
if not os.path.exists('data/raw'): | ||
os.makedirs('data/raw') | ||
|
||
if not os.path.exists("data/" + key): | ||
client = storage.Client() | ||
bucket = client.get_bucket(gcsBucket) | ||
blob = bucket.get_blob(key) | ||
blob.download_to_filename('data/raw/store47-2016.csv') | ||
|
||
|
||
def main(): | ||
print("Loading data...") | ||
load_data() | ||
print("Finished downloading") | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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