"""Script to see database."""

import os
import json
import crud
import model
import server

os.system('dropdb hmongmentalhealthtoday')
os.system('createdb hmongmentalhealthtoday')

model.connect_to_db(server.app)
model.db.create_all()

therapist_in_db = []

# Load data from data/hmongtherapists.csv
# Have DictReader turn hmongtherapists.csv into readable dictionary
# Save readable dictionary to therapist_data
#with open('data/therapists.csv', encoding='utf-8-sig') as csvFile:
 # fieldnames = ['name', 'clinic', 'website', 'email', 'specialty', 'lat', 'long', 'img']
  #therapist_data = csv.DictReader(csvFile, fieldnames=fieldnames, skipinitialspace=True)

with open('data/therapists.json') as f:
  therapist_data = json.loads(f.read())


# Loop through each dictionary in therapist_data
  for therapist in therapist_data:
    name, clinic, website, email, specialty, lat, long, img, county = (
                                                  therapist['name'],
                                                  therapist['clinic'],
                                                  therapist['website'],
                                                  therapist['email'],
                                                  therapist['specialty'],
                                                  therapist['lat'],
                                                  therapist['long'],
                                                  therapist['img'],
                                                  therapist['county'])
                                                  
    #Supply arguments to crud.py
    db_therapist = crud.create_therapist(
                                      name, 
                                      clinic,
                                      website, 
                                      email, 
                                      specialty, 
                                      lat,
                                      long,
                                      img,
                                      county)
    #Add each new therapist to db_therapist list
    therapist_in_db.append(db_therapist) 





f305fcdd3fd0197c95904bcb39df7944e02b9b35
<mask token>

<mask token>
os.system('dropdb hmongmentalhealthtoday')
os.system('createdb hmongmentalhealthtoday')
model.connect_to_db(server.app)
model.db.create_all()
<mask token>
with open('data/therapists.json') as f:
    therapist_data = json.loads(f.read())
    for therapist in therapist_data:
        name, clinic, website, email, specialty, lat, long, img, county = (
            therapist['name'], therapist['clinic'], therapist['website'],
            therapist['email'], therapist['specialty'], therapist['lat'],
            therapist['long'], therapist['img'], therapist['county'])
        db_therapist = crud.create_therapist(name, clinic, website, email,
            specialty, lat, long, img, county)
        therapist_in_db.append(db_therapist)

<mask token>
os.system('dropdb hmongmentalhealthtoday')
os.system('createdb hmongmentalhealthtoday')
model.connect_to_db(server.app)
model.db.create_all()
therapist_in_db = []
with open('data/therapists.json') as f:
    therapist_data = json.loads(f.read())
    for therapist in therapist_data:
        name, clinic, website, email, specialty, lat, long, img, county = (
            therapist['name'], therapist['clinic'], therapist['website'],
            therapist['email'], therapist['specialty'], therapist['lat'],
            therapist['long'], therapist['img'], therapist['county'])
        db_therapist = crud.create_therapist(name, clinic, website, email,
            specialty, lat, long, img, county)
        therapist_in_db.append(db_therapist)

<mask token>
import os
import json
import crud
import model
import server
os.system('dropdb hmongmentalhealthtoday')
os.system('createdb hmongmentalhealthtoday')
model.connect_to_db(server.app)
model.db.create_all()
therapist_in_db = []
with open('data/therapists.json') as f:
    therapist_data = json.loads(f.read())
    for therapist in therapist_data:
        name, clinic, website, email, specialty, lat, long, img, county = (
            therapist['name'], therapist['clinic'], therapist['website'],
            therapist['email'], therapist['specialty'], therapist['lat'],
            therapist['long'], therapist['img'], therapist['county'])
        db_therapist = crud.create_therapist(name, clinic, website, email,
            specialty, lat, long, img, county)
        therapist_in_db.append(db_therapist)

"""Script to see database."""

import os
import json
import crud
import model
import server

os.system('dropdb hmongmentalhealthtoday')
os.system('createdb hmongmentalhealthtoday')

model.connect_to_db(server.app)
model.db.create_all()

therapist_in_db = []

# Load data from data/hmongtherapists.csv
# Have DictReader turn hmongtherapists.csv into readable dictionary
# Save readable dictionary to therapist_data
#with open('data/therapists.csv', encoding='utf-8-sig') as csvFile:
 # fieldnames = ['name', 'clinic', 'website', 'email', 'specialty', 'lat', 'long', 'img']
  #therapist_data = csv.DictReader(csvFile, fieldnames=fieldnames, skipinitialspace=True)

with open('data/therapists.json') as f:
  therapist_data = json.loads(f.read())


# Loop through each dictionary in therapist_data
  for therapist in therapist_data:
    name, clinic, website, email, specialty, lat, long, img, county = (
                                                  therapist['name'],
                                                  therapist['clinic'],
                                                  therapist['website'],
                                                  therapist['email'],
                                                  therapist['specialty'],
                                                  therapist['lat'],
                                                  therapist['long'],
                                                  therapist['img'],
                                                  therapist['county'])
                                                  
    #Supply arguments to crud.py
    db_therapist = crud.create_therapist(
                                      name, 
                                      clinic,
                                      website, 
                                      email, 
                                      specialty, 
                                      lat,
                                      long,
                                      img,
                                      county)
    #Add each new therapist to db_therapist list
    therapist_in_db.append(db_therapist) 




