-
Notifications
You must be signed in to change notification settings - Fork 0
/
census1910.py
129 lines (121 loc) · 6.31 KB
/
census1910.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#imports
import csv
from func_defs import *
def writeName1910 (c , g, config_dict, source_dict):
idn = 0
with open(g, 'a') as the_file:
with open(c) as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
#print "0 @I(unique 3 digit number)@ INDI"
idn += 1
the_file.write('0 ' + '@I' + "{0:0=3d}".format(idn) + '@' + ' INDI\n')
#Call NameWriter Function
NameWriter(row,"3 NAME",'4 Relationship', the_file,idn)
try:
SourceWriter1900(row, the_file, source_dict, '1 House #', '2 Family #','3 NAME', 'T624')
except:
pass
#Call SexWriter Function
sex = SexWriter(row,"5 Sex",the_file,idn)
#Call YBdateWriter function
YBdateWriter (row,"7 Age",'1910',the_file, idn)
try:
SourceWriter1900(row, the_file, source_dict, '1 House #', '2 Family #','3 NAME', 'T624')
except:
pass
#call BPlaceWriter function
BPlaceWriter(row,"12 POB",the_file,idn)
try:
SourceWriter1900(row, the_file, source_dict, '1 House #', '2 Family #','3 NAME', 'T624')
except:
pass
#call CensusYearWriter function
CensusYearWriter(the_file, '1910')
try:
SourceWriter1900(row, the_file, source_dict, '1 House #', '2 Family #','3 NAME', 'T624')
except:
pass
#call ImmigYearWriter function
if config_dict["Immigration"] == 1:
ImmigYearWriter(row,"15 Immigration", config_dict["immigTag"],the_file,idn)
try:
SourceWriter1900(row, the_file, source_dict, '1 House #', '2 Family #','3 NAME', 'T624')
except:
pass
#call OccupationWriter1910 function
if config_dict["Occupation"] == 1:
OccupationWriter1910(row, config_dict["occupTag"], "18 Occupation","19 Industry/busines", the_file, '1910',idn)
try:
SourceWriter1900(row, the_file, source_dict, '1 House #', '2 Family #','3 NAME', 'T624')
except:
pass
#call RaceWriter function
if config_dict["Race"] == 1:
RaceWriter(row,'6 Color',config_dict["raceTag"], the_file, '1910',idn)
try:
SourceWriter1900(row, the_file, source_dict, '1 House #', '2 Family #','3 NAME', 'T624')
except:
pass
#call NaturalizedWriter function
if config_dict["Naturalize"] == 1:
NaturalizedWriter(row, the_file, config_dict["natuTag"],'16 Naturalized?', '1910', idn )
try:
SourceWriter1900(row, the_file, source_dict, '1 House #', '2 Family #','3 NAME', 'T624')
except:
pass
#call LiteracyWriter function
if config_dict["Literacy"] == 1:
LiteracyWriter(row,'23 Read','24 Write', config_dict["literTag"], the_file, '1910', idn)
try:
SourceWriter1900(row, the_file, source_dict, '1 House #', '2 Family #','3 NAME', 'T624')
except:
pass
#call ChildNoWriter function
if config_dict["Children Born"] == 1:
ChildNoWriter(row,'10 Children born','11 Still living', config_dict["chilTag"], the_file, '1910', idn)
try:
SourceWriter1900(row, the_file, source_dict, '1 House #', '2 Family #','3 NAME', 'T624')
except:
pass
#call SpeakEnglishWriter function
if config_dict["Language"] == 1:
SpeakEnglishWriter(row,'17 English', config_dict["langTag"], the_file, '1910', idn)
try:
SourceWriter1900(row, the_file, source_dict, '1 House #', '2 Family #','3 NAME', 'T624')
except:
pass
#call ArmyWriter function
if config_dict["Military"] == 1:
ArmyWriter(row, '30 Army or Navy.', config_dict["militTag"], the_file, idn)
try:
SourceWriter1900(row, the_file, source_dict, '1 House #', '2 Family #','3 NAME', 'T624')
except:
pass
#call BlindWriter function
if config_dict["Disability"] == 1:
BlindWriter(row, '31 Blind', config_dict["disiTag"], the_file, idn)
try:
SourceWriter1900(row, the_file, source_dict, '1 House #', '2 Family #','3 NAME', 'T624')
except:
pass
#call DeafWriter finction
if config_dict["Disability"] == 1:
DeafWriter(row, '32 Deaf, etc.', config_dict["disiTag"], the_file, idn)
try:
SourceWriter1900(row, the_file, source_dict, '1 House #', '2 Family #','3 NAME', 'T624')
except:
pass
#call PropertyWriter function
if config_dict["Property"] == 1:
PropertyWriter(row,'26 Owned/Rented', '27 Free/Mortgage','28 Farm/house','29 # farm', config_dict["propTag"], the_file, '1910', idn )
try:
SourceWriter1900(row, the_file, source_dict, '1 House #', '2 Family #','3 NAME', 'T624')
except:
pass
#call FamilyWriter1900 function
FamilyWriter1900(row, '4 Relationship','9 Years married.', the_file,idn, '1910',sex)
#write the source
MainSourceWriter1900(row, the_file, source_dict, '1910')
#call EndFile function
EndFile(the_file,g, idn)