-
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
f7d747b
commit 7b212be
Showing
24 changed files
with
56 additions
and
27 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,23 @@ | ||
import json | ||
import os | ||
from firebase_admin import credentials, initialize_app, firestore | ||
from glob import glob | ||
|
||
creds = credentials.Certificate( | ||
json.loads(os.environ["FIREBASE_SECRET_KEY_JSON"]) | ||
) | ||
initialize_app(creds) | ||
|
||
firestore_client = firestore.client() | ||
col_ref = firestore_client.collection("task_set") | ||
|
||
file_list = glob("data/bebras_tasks/*/*/*.json") | ||
for file in file_list: | ||
with open(file, "r") as f: | ||
file_ref = file.replace(".json", "").split("/") | ||
name = "_".join(file_ref[-2:]) | ||
|
||
content = json.load(f) | ||
content["challenge_group"] = file_ref[-2] | ||
|
||
col_ref.document(name).set(content) |
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