lawsoc-scraper/test/simple_dict.py

42 lines
2.6 KiB
Python

#{'person_id': '119847', 'areas_of_practice': ['Family - Advanced Accredited'], 'employer_address': ['Dutton Gregory LLP', 'Ambassador House', '8 Carlton Crescent', 'Southampton', 'SO15 2EY'], 'solicitor_id': '468235', 'accreditations': ['Family - Advanced accreditation'], 'roles': ['Associate', 'Assistant'], 'languages': ['English'], 'admitted_date': '15/02/94', 'dx_address': '49653 SOUTHAMPTON 2', 'sra_id': '162857', 'type': 'SRA Regulated', 'tel': '02380 221344', 'name': 'Karen Lorraine Andrews'}
person_dict = {}
person_dict['sra_id'] = '162857'
person_dict['type'] = 'SRA Regulated'
person_dict['person_id'] = '119847'
person_dict['name'] = 'Karen Lorraine Andrews'
person_dict['solicitor_id'] = '468235'
person_dict['admitted_date'] = '15/02/94'
person_dict['dx_address'] = '49653 SOUTHAMPTON 2'
person_dict['areas_of_practice'] = 'Family - Advanced Accredited'
person_dict['accreditations'] = ['Family - Advanced accreditation']
person_dict['roles'] = ['Associate', 'Assistant']
person_dict['tel'] = '02380 221344'
print(person_dict)
#{'sra_id': '496960', 'email': 'contact@duttongregory.co.uk', 'type': 'Recognised body law practice', 'web': 'http://duttongregory.co.uk', 'dx_address': 'DX 2515 WINCHESTER', 'address': ['Trussell House,', '23 St. Peter Street,', 'Winchester,', 'Hampshire,', 'SO23 8BT,', 'England'], 'lat': '-1.313652', 'name': 'Dutton Gregory LLP', 'facialities': ['Office does not provide Sign Language', 'Office has no disabled access', 'Office does not support hearing induction loops', 'Office accepts legal aid'], 'solicitor_id': '468235', 'long': '51.06269', 'tel': '01962 844333'}
office_dict = {}
office_dict['sra_id'] = '496960'
office_dict['solicitor_id'] = '468235'
office_dict['name'] = 'Dutton Gregory LLP'
office_dict['email'] = 'contact@duttongregory.co.uk'
office_dict['web'] = 'http://duttongregory.co.uk'
office_dict['dx_address'] = 'DX 2515 WINCHESTER'
office_dict['address'] = ['Trussell House,', '23 St. Peter Street,', 'Winchester,', 'Hampshire,', 'SO23 8BT,', 'England']
office_dict['lat'] = '-1.313652'
office_dict['long'] = '51.06269'
office_dict['tel'] = '01962 844333'
office_dict['type'] = 'Recognised body law practice'
office_dict['facialities'] = ['Office does not provide Sign Language', 'Office has no disabled access', 'Office does not support hearing induction loops', 'Office accepts legal aid']
print(office_dict)
import json
with open('json_out/person/person_' + person_dict['person_id'] + '.json', 'w') as outfile:
json.dump(person_dict, outfile)
with open('json_out/office/office_' + office_dict['solicitor_id'] + '.json', 'w') as outfile:
json.dump(office_dict, outfile)