Skip to content

Commit

Permalink
Initial
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesli12 committed Oct 22, 2023
1 parent a040b88 commit 2cd6658
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions scripts/account_list.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import pandas as pd
from pymongo import MongoClient

class AccountImporter:

def __init__(self):
FILE_PATH = ""
DB_URI = ""

accounts_df = pd.read_excel(FILE_PATH)
accounts_list = accounts_df.values.tolist()


client = MongoClient(DB_URI)

db = client['accounts']
collection = db['accounts']

for account in accounts_list:
if not collection.find_one({"email": account[1]}):
collection.insert_one({
"email": account[1],
"role": "Volunteer"
})


if __name__ == "__main__":
AccountImporter()

0 comments on commit 2cd6658

Please sign in to comment.