Skip to content

Commit

Permalink
Continued CSV modifications
Browse files Browse the repository at this point in the history
Toward #114.
  • Loading branch information
waldoj committed Jun 18, 2017
1 parent 075aee3 commit 8e2663e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions crump
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ def main():
field_names.append(field["alt_name"])
else:
field_names.append(field["name"])
field_names.append("foreign")
field_tuple = tuple(field for field in field_names)

# Start writing the CSV data.
Expand Down Expand Up @@ -291,7 +292,6 @@ def main():
if "date" in name:

# Format dates properly.
line[name] = line[name][:4] + '-' + line[name][4:-2] + '-' + line[name][-2:]
if line[name] == "0000-00-00":
line[name] = None
elif line[name] == "9999-99-99":
Expand Down Expand Up @@ -323,10 +323,10 @@ def main():
# Indicate whether a corporation is foreign or domestic, using True/False
# values instead of the M/L values the SCC uses in 3_lp.
elif name == 'domestic':
if line[name] == 'M':
line[name] = False
if current_line['IncorpState'] == 'VA':
line['domestic'] = True
else:
line[name] = True
line['domestic'] = False

# The total share count sometimes has a leading zero. Strip it off.
elif name == 'total_shares':
Expand All @@ -346,7 +346,6 @@ def main():

# Replace shorthand values with the full version, from the lookup table.
if table_id != None:
print lookup_table
for index, conversion in enumerate(lookup_table):
if int(conversion["TableID"]) == table_id:
if conversion["ColumnValue"] == line[name]:
Expand Down

0 comments on commit 8e2663e

Please sign in to comment.