-
Notifications
You must be signed in to change notification settings - Fork 40
/
constants.py
816 lines (777 loc) · 34.3 KB
/
constants.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
from collections import OrderedDict
import operator
from data import utils
START_YEAR = 1979
END_YEAR = 2020
DEFAULT_TIME_PERIOD = 2020 # Change after the April quarterly report (4/15/21)
DEFAULT_ELECTION_YEAR = 2020 # Change after election day (11/3/20)
DEFAULT_PRESIDENTIAL_YEAR = 2020
DISTRICT_MAP_CUTOFF = 2018 # The year we show district maps for on election pages
states = OrderedDict([
('AL', 'Alabama'),
('AK', 'Alaska'),
('AS', 'American Samoa'),
('AZ', 'Arizona'),
('AR', 'Arkansas'),
('CA', 'California'),
('CO', 'Colorado'),
('CT', 'Connecticut'),
('DE', 'Delaware'),
('DC', 'District of Columbia'),
('FL', 'Florida'),
('GA', 'Georgia'),
('GU', 'Guam'),
('HI', 'Hawaii'),
('ID', 'Idaho'),
('IL', 'Illinois'),
('IN', 'Indiana'),
('IA', 'Iowa'),
('KS', 'Kansas'),
('KY', 'Kentucky'),
('LA', 'Louisiana'),
('ME', 'Maine'),
('MD', 'Maryland'),
('MA', 'Massachusetts'),
('MI', 'Michigan'),
('MN', 'Minnesota'),
('MS', 'Mississippi'),
('MO', 'Missouri'),
('MT', 'Montana'),
('NE', 'Nebraska'),
('NV', 'Nevada'),
('NH', 'New Hampshire'),
('NJ', 'New Jersey'),
('NM', 'New Mexico'),
('NY', 'New York'),
('NC', 'North Carolina'),
('ND', 'North Dakota'),
('MP', 'Northern Mariana Islands'),
('OH', 'Ohio'),
('OK', 'Oklahoma'),
('OR', 'Oregon'),
('PA', 'Pennsylvania'),
('PR', 'Puerto Rico'),
('RI', 'Rhode Island'),
('SC', 'South Carolina'),
('SD', 'South Dakota'),
('TN', 'Tennessee'),
('TX', 'Texas'),
('VI', 'U.S. Virgin Islands'),
('UT', 'Utah'),
('VT', 'Vermont'),
('VA', 'Virginia'),
('WA', 'Washington'),
('WV', 'West Virginia'),
('WI', 'Wisconsin'),
('WY', 'Wyoming'),
])
states_excl_territories = OrderedDict([
('AL', 'Alabama'),
('AK', 'Alaska'),
('AZ', 'Arizona'),
('AR', 'Arkansas'),
('CA', 'California'),
('CO', 'Colorado'),
('CT', 'Connecticut'),
('DE', 'Delaware'),
('DC', 'District of Columbia'),
('FL', 'Florida'),
('GA', 'Georgia'),
('HI', 'Hawaii'),
('ID', 'Idaho'),
('IL', 'Illinois'),
('IN', 'Indiana'),
('IA', 'Iowa'),
('KS', 'Kansas'),
('KY', 'Kentucky'),
('LA', 'Louisiana'),
('ME', 'Maine'),
('MD', 'Maryland'),
('MA', 'Massachusetts'),
('MI', 'Michigan'),
('MN', 'Minnesota'),
('MS', 'Mississippi'),
('MO', 'Missouri'),
('MT', 'Montana'),
('NE', 'Nebraska'),
('NV', 'Nevada'),
('NH', 'New Hampshire'),
('NJ', 'New Jersey'),
('NM', 'New Mexico'),
('NY', 'New York'),
('NC', 'North Carolina'),
('ND', 'North Dakota'),
('OH', 'Ohio'),
('OK', 'Oklahoma'),
('OR', 'Oregon'),
('PA', 'Pennsylvania'),
('RI', 'Rhode Island'),
('SC', 'South Carolina'),
('SD', 'South Dakota'),
('TN', 'Tennessee'),
('TX', 'Texas'),
('UT', 'Utah'),
('VT', 'Vermont'),
('VA', 'Virginia'),
('WA', 'Washington'),
('WV', 'West Virginia'),
('WI', 'Wisconsin'),
('WY', 'Wyoming'),
])
contributor_states = OrderedDict(sorted(utils.extend(states, {
('AA', 'Armed Forces Americas'),
('AE', 'Armed Forces Europe'),
('AP', 'Armed Forces Pacific'),
('ZZ', 'Foreign Countries'), }).items(), key=operator.itemgetter(1)))
parties = OrderedDict([
('DEM', 'Democratic Party'),
('REP', 'Republican Party'),
])
parties_extended = OrderedDict([
('AIC', 'American Independent Conservative'),
('AIP', 'American Independent Party'),
('AMP', 'American Party'),
('APF', "American People's Freedom Party"),
('CIT', "Citizens' Party"),
('CMP', 'Commonwealth Party of the US'),
('COM', 'Communist Party'),
('CRV', 'Conservative Party'),
('CST', 'Constitutional'),
('DC', 'Democratic/Conservative'),
('DFL', 'Democratic-Farm-Labor'),
('FLP', 'Freedom Labor Party'),
('GRE', 'Green Party'),
('GWP', 'George Wallace Party'),
('HRP', 'Human Rights Party'),
('IAP', 'Independent American Party'),
('ICD', 'Independent Conserv. Democratic'),
('IGD', 'Industrial Government Party'),
('IND', 'Independent'),
('LAB', 'US Labor Party'),
('LBL', 'Liberal Party'),
('LBR', 'Labor Party'),
('LBU', 'Liberty Union Party'),
('LFT', 'Less Federal Taxes'),
('LIB', 'Libertarian'),
('LRU', 'La Raza Unida'),
('NAP', 'Prohibition Party'),
('NDP', 'National Democratic Party'),
('NLP', 'Natural Law Party'),
('PAF', 'Peace and Freedom'),
('PFD', 'Peace Freedom Party'),
('POP', 'People Over Politics'),
('PPD', 'Protest, Progress, Dignity'),
('PPY', "People's Party"),
('REF', 'Reform Party'),
('RTL', 'Right to Life'),
('SLP', 'Socialist Labor Party'),
('SUS', 'Socialist Party USA'),
('SWP', 'Socialist Workers Party'),
('THD', 'Theo-Dem'),
('TWR', 'Taxpayers Without Representation'),
('TX', 'Taxpayers'),
('USP', "US People's Party"),
])
monthly_reports = OrderedDict([
('M2', 'February monthly'),
('M3', 'March monthly'),
('M4', 'April monthly'),
('M5', 'May monthly'),
('M6', 'June monthly'),
('M7', 'July monthly'),
('M8', 'August monthly'),
('M9', 'September monthly'),
('M10', 'October monthly'),
('M11', 'November monthly'),
('M12', 'December monthly'),
])
quarterly_reports = OrderedDict([
('Q1', 'April quarterly'),
('Q2', 'July quarterly'),
('Q3', 'October quarterly'),
])
semiannual_reports = OrderedDict([
('MY', 'Mid-year report'),
])
election_sensitive_reports = OrderedDict([
('12P', 'Pre-primary'),
('12C', 'Pre-convention'),
('12G', 'Pre-general'),
('12R', 'Pre-runoff'),
('12S', 'Pre-special'),
('30G', 'Post-general'),
('30R', 'Post-runoff'),
('30S', 'Post-special'),
('30P', 'Post-primary'),
('60D', 'Post-convention'),
('10D', 'Pre-election (10D)'),
('30D', 'Post-election (30D)')
])
bundling_reports = OrderedDict([
('M7S', 'July monthly/semiannual'),
('MSA', 'Monthly semiannual mid year'),
('MSY', 'Monthly semiannual year end'),
('MYS', 'Monthly year end/semiannual'),
('Q2S', 'July quarterly/semiannual'),
('QSA', 'Quarterly semiannual (MY)'),
('QYE', 'Quarterly semiannual (YE)'),
('QYS', 'Quarterly year end/semiannual'),
('QMS', 'Quarterly mid year/semiannual'),
])
other_reports = OrderedDict([
('TER', 'Termination'),
('24', '24-Hour Notification'),
('48', '48-Hour Notification'),
('90D', 'Post inaugural'),
('90S', 'Post inaugural supplement'),
('CA', 'Comprehensive amendment'),
('ADJ', 'Comprehensive adjusted amendment'),
])
form_types = OrderedDict([
('F1', "Statements Of Organization (Form 1)"),
('F1M', "Multicandidate status (Form 1M)"),
('F2', "Statements Of Candidacy (Form 2)"),
('F3', "Congressional candidate financial reports (Form 3)"),
('F3P', "Presidential financial reports (Form 3P)"),
('F3X', "PAC and party financial reports (Form 3X)"),
('F3L', "Bundled contributions reports (Form 3L)"),
('F4', "Convention financial reports (Form 4)"),
('F5', "Independent expenditure reports and notices (by a person or group) (Form 5)"),
('F24', "Independent expenditure reports and notices (by a registered committee) (Form 24)"),
('F6', "Contributions and loans notices (Form 6)"),
('F7', "Communication cost reports (Form 7)"),
('F8', "Debt settlement plans (Form 8)"),
('F9', "Electioneering communications notices (Form 9)"),
('F13', "Inaugural committee donation reports (Form 13)"),
('F99', "Miscellaneous submission (Form 99)"),
('F10', "Expenditure of personal funds notices (Form 10)"),
('F11', "Opposition personal funds notices (Form 11)"),
('F12', "Suspension of increased limits notices (Form 12)"),
('RFAI', "Request For Additional Information (RFAI)"),
])
amendment_indicators_extended = OrderedDict([
('T', 'Terminated'),
('C', 'Consolidated'),
('M', 'Multicandidate'),
('S', 'Secondary'),
])
candidate_status = OrderedDict([
('C', 'Statutory candidate'),
])
candidate_status_extended = OrderedDict([
('F', 'Future candidate'),
('N', 'Not yet a candidate'),
('P', 'Statutory candidate in prior cycle'),
])
pac_party = OrderedDict([
('PAC', 'PACs'),
('PAR', 'Political Party Committees'),
])
pac_party_types = OrderedDict([
('N', 'PAC - nonqualified'),
('Q', 'PAC - qualified'),
('V', 'PAC with non-contribution account - nonqualified'),
('W', 'PAC with non-contribution account - qualified'),
('P', 'Party - nonqualified'),
('Y', 'Party - qualified'),
('Z', 'National party nonfederal account'),
('U', 'Single candidate independent expenditure'),
('O', 'Super PAC (independent expenditure only'),
('I', 'Independent expenditor (person or group)')
])
house_senate_types = OrderedDict([
('H', 'House'),
('S', 'Senate')
])
primary_category_keys = ['primary_category_id', 'primary_category_name']
sub_category_keys = ['sub_category_id', 'sub_category_name']
audit_primary_categories_options = [
{
"primary_category_id": 'all',
"primary_category_name": 'All'
},
{
"primary_category_id": '2',
"primary_category_name": 'Allocation Issues'
},
{
"primary_category_id": '3',
"primary_category_name": 'Disclosure'
},
{
"primary_category_id": '5',
"primary_category_name": 'Excessive Contributions'
},
{
"primary_category_id": '1',
"primary_category_name": 'Failure to File Reports/Schedules/Notices'
},
{
"primary_category_id": '8',
"primary_category_name": 'Loans'
},
{
"primary_category_id": '7',
"primary_category_name": 'Misstatement of Financial Activity'
},
{
"primary_category_id": '14',
"primary_category_name": 'Net Outstanding Campaign/Convention ' +
'Expenditures/Obligations'
},
{
"primary_category_id": '16',
"primary_category_name": 'No Findings or Issues/Not a Committee'
},
{
"primary_category_id": '9',
"primary_category_name": 'Other'
},
{
"primary_category_id": '15',
"primary_category_name": 'Payments/Disgorgements'
},
{
"primary_category_id": '6',
"primary_category_name": 'Prohibited Contributions'
},
{
"primary_category_id": '4',
"primary_category_name": 'Recordkeeping'
},
{
"primary_category_id": '17',
"primary_category_name": 'Referred Findings Not Listed'
},
{
"primary_category_id": '13',
"primary_category_name": 'Repayment to US Treasury'
}
]
audit_sub_categories_options = [
{
"sub_category_id": 'all',
"sub_category_name": ' '
}
]
table_columns = OrderedDict([
('candidates', ['Name', 'Office', 'Election years', 'Party', 'State', 'District', 'First filing date']),
('candidates-office-president', ['Name', 'Party', 'Receipts', 'Disbursements']),
('candidates-office-senate', ['Name', 'Party', 'State', 'Receipts', 'Disbursements']),
('candidates-office-house', ['Name', 'Party', 'State', 'District', 'Receipts', 'Disbursements']),
('committees', ['Name', 'Committee ID', 'Treasurer', 'Type', 'Designation', 'First filing date']),
('communication-costs', ['Committee', 'Support/Oppose', 'Candidate', 'Amount', 'Date']),
('disbursements', ['Spender', 'Recipient', 'State', 'Description', 'Disbursement date', 'Amount']),
('electioneering-communications', ['Spender', 'Candidate mentioned','Number of candidates', 'Amount per candidate', 'Date', 'Disbursement amount' ]),
('filings', ['Filer name', 'Document', 'Version', 'Receipt date', 'Beginning image number']),
('independent-expenditures', ['Spender', 'Support/Oppose', 'Candidate', 'Description', 'Payee', 'Expenditure date', 'Amount']),
('individual-contributions', ['Contributor name', 'Recipient', 'State', 'Employer', 'Receipt date', 'Amount']),
('loans', ['Committee Name', 'Loaner name', 'Incurred date', 'Payment to date', 'Original loan amount']),
('party-coordinated-expenditures', ['Spender', 'Candidate', 'Payee name', 'Expenditure date', 'Amount']),
('receipts', ['Contributor name', 'Recipient', 'Election', 'State', 'Receipt date', 'Amount']),
('reports-presidential', ['Committee', 'Report type', 'Version', 'Receipt date', 'Coverage end date', 'Total receipts', 'Total disbursements']),
('reports-house-senate', ['Committee', 'Report type', 'Version', 'Receipt date', 'Coverage end date', 'Total receipts', 'Total disbursements']),
('reports-pac-party', ['Committee', 'Report type', 'Version', 'Receipt date', 'Coverage end date', 'Total receipts', 'Total disbursements', 'Total independent expenditures']),
('reports-ie-only', ['Filer', 'Report type', 'Version', 'Receipt date', 'Coverage end date', 'Total contributions', 'Total independent expenditures']),
('audit', ['Committee name', 'Election cycle', 'Final report', 'Findings and issues', 'Candidate']),
])
line_numbers = {
'receipts': {
'house_senate': OrderedDict([
('F3-11AI', 'Contributions from individuals (Line 11ai)'),
('F3-11B', 'Contributions from political party committees (Line 11b)'),
('F3-11C', 'Contributions from other political committees (Line 11c)'),
('F3-11D', 'Contributions from the candidate (Line 11d)'),
('F3-12', ' Transfers from authorized committees (Line 12)'),
('F3-13A', 'Loans received from the candidate (Line 13a)'),
('F3-13B', 'All other loans (Line 13b)'),
('F3-14', ' Offsets to operating expenditures (Line 14)'),
('F3-15', ' Other receipts (Line 15)'),
]),
'presidential': OrderedDict([
('F3P-16', 'Federal funds (Line 16)'),
('F3P-17A', 'Contributions from individuals (Line 17ai)'),
('F3P-17B', 'Contributions from political party committees (Line 17b)'),
('F3P-17C', 'Contributions from other political committees (Line 17c)'),
('F3P-17D', 'Contributions from the candidate (Line 17d)'),
('F3P-18', 'Transfers from other authorized committees (Line 18)'),
('F3P-19A', 'Loans received from candidate (Line 19a)'),
('F3P-19B', 'Other loans (Line 19b)'),
('F3P-20A', 'Offsets to operating expenditures - operating (Line 20a)'),
('F3P-20B', 'Offsets to operating expenditures - fundraising (Line 20b)'),
('F3P-20C', 'Offsets to operating expenditures - legal and accounting (Line 20c)'),
('F3P-21', 'Other receipts (Line 21)'),
]),
'pac_party': OrderedDict([
('F3X-11AI', 'Contributions from individuals (Line 11ai)'),
('F3X-11B', 'Contributions from political party committees (Line 11b)'),
('F3X-11C', 'Contributions from other political committees (Line 11c)'),
('F3X-12', 'Transfers from affiliated committees (Line 12)'),
('F3X-13', 'Loans received (Line 13)'),
('F3X-14', 'Loan repayments received (Line 14)'),
('F3X-15', 'Offets to operating expenditures (Line 15)'),
('F3X-16', 'Refunds of contributions made to federal candidates and other political committees (Line 16)'),
('F3X-17', 'Other federal receipts (Line 17)'),
])
},
'disbursements': {
'house_senate': OrderedDict([
('F3-17', 'Operating expenditures (Line 17)'),
('F3-18', 'Transfers to other authorized committees (Line 18)'),
('F3-19', 'Loan repayments (Line 19)'),
('F3-19A', 'Loan repayments of loans made or guaranteed by the candidate (Line 19a'),
('F3-19B', 'Loan repayments of all other loans (Line 19b)'),
('F3-20A', 'Refunds of contributions to individuals (Line 20a)'),
('F3-20B', 'Refunds of contributions to political party committees (Line 20b)'),
('F3-20C', 'Refunds of contributions to other political committees (Line 20c)'),
('F3-21', 'Other disbursements (Line 21)'),
]),
'presidential': OrderedDict([
('F3P-23', 'Operating expenditures (Line 23)'),
('F3P-24', 'Transfers to other authorized committees (Line 24)'),
('F3P-25', 'Fundraising disbursements (Line 25)'),
('F3P-26', 'Exempt legal and accounting disbursements (Line 26)'),
('F3P-27A', 'Repayments of loans made or guaranteed by candidate (Line 27a)'),
('F3P-27B', 'Other loan repayments (Line 27b)'),
('F3P-28A', 'Refunds of contributions to individuals (Line 28a)'),
('F3P-28B', 'Refunds of contributions to political party committees (Line 28b)'),
('F3P-28C', 'Refunds of contributions to other political committees (Line 28c)'),
('F3P-29', 'Other disbursements (Line 29)'),
]),
'pac_party': OrderedDict([
('F3X-21B', 'Other federal operating expenditures (Line 21b)'),
('F3X-22', 'Transfers to affiliated/other party committees (Line 22)'),
('F3X-23', 'Contributions to federal candidates/committees and other political committees (Line 23)'),
('F3X-26', 'Loan repayments made (Line 26)'),
('F3X-27', 'Loans made (Line 27)'),
('F3X-28A', 'Refunds of Contributions Made to Individuals/Persons Other Than Political Committees (Line 28a)'),
('F3X-28B', 'Refunds of contributions to political party committees (Line 28b)'),
('F3X-28C', 'Refunds of contributions to other political committees (Line 28c)'),
('F3X-28D', 'Total contributions refunds (Line 28d)'),
('F3X-29', 'Other disbursements (Line 29)'),
('F3X-30B', 'Party - Types 3 & 4 Federal Election Activity (FEA) (Line 30(b))'),
])
}
}
# RAISING_FORMATTER, SPENDING_FORMATTER, CASH_FORMATTER, IE_FORMATTER
# These are used to format the display of financial summary data on committee pages
# They map key values from a response to a tuple which contains a label and a level of hierarchy
# Levels: 1 = Top-level total; 2 = sub-total, 3 = sub-sub-total; 4 = sub-sub-sub-total
# Type: used to piece together a link to line number filtered view
# The comments next to each refer to the type of report / committee that they show up on
# F3 = house and senate; F3P = presidential; F3X = pac and party
RAISING_FORMATTER = OrderedDict([
('receipts', # F3, F3P, F3X
{'label': 'Total receipts', 'level': '1', 'term': 'total receipts'}),
('contributions', # F3, F3P, F3X
{'label': 'Total contributions', 'level': '2'}),
('individual_contributions', # F3, F3P, F3X
{'label': 'Total individual contributions', 'level': '3'}),
('individual_itemized_contributions', # F3, F3P, F3X
{'label': 'Itemized individual contributions', 'level': '4', 'type': {
'link': 'receipts', 'P': 'F3P-17A', 'H': 'F3-11AI', 'S': 'F3-11AI', 'O': 'F3X-11AI'
}}),
('individual_unitemized_contributions', # F3, F3P, F3X
{'label': 'Unitemized individual contributions', 'level': '4'}),
('political_party_committee_contributions',
{'label': 'Party committee contributions', 'level': '3', 'type': {
'link': 'receipts',
'P': 'F3P-17B', 'H': 'F3-11B', 'S': 'F3-11B', 'O': 'F3X-11B'
}}),
('other_political_committee_contributions', # F3, F3P, F3X
{'label': 'Other committee contributions', 'level': '3', 'type': {
'link': 'receipts',
'P': 'F3P-17C', 'H': 'F3-11C', 'S': 'F3-11C', 'O': 'F3X-11C'
}}),
('federal_funds', # F3P
{'label': 'Presidential public funds', 'level': '3'}),
('candidate_contribution', # F3, F3P
{'label': 'Candidate contributions', 'level': '3', 'type': {
'link': 'receipts',
'P': 'F3P-17D', 'H': 'F3-11D', 'S': 'F3-11D'
}}),
('transfers_from_affiliated_party', # F3X
{'label': 'Transfers from affiliated committees', 'level': '2',
'type': {'link': 'receipts', 'O': 'F3X-12'}}),
('transfers_from_affiliated_committee', # F3P
{'label': 'Transfers from other authorized committees', 'level': '2',
'type': {'link': 'receipts', 'P': 'F3P-18'}}),
('transfers_from_other_authorized_committee', # F3
{'label': 'Transfers from other authorized committees', 'level': '2',
'type': {'link': 'receipts', 'H': 'F3-12', 'S': 'F3-12'}}),
('all_loans_received', # F3X
{'label': 'All loans received', 'level': '2', 'type': {
'link': 'receipts', 'O': 'F3X-13'
}}),
('loan_repayments_received', # F3X
{'label': 'Loan repayments received', 'level': '2', 'type': {
'link': 'receipts', 'O': 'F3X-14'
}}),
('loans', # F3
{'label': 'Total loans received', 'level': '2'}),
('loans_received', # F3P
{'label': 'Total loans received', 'level': '2'}),
('loans_received_from_candidate', # F3P
{'label': 'Loans made by candidate', 'level': '3', 'type': {
'link': 'receipts', 'P': 'F3P-19A'
}}),
('loans_made_by_candidate', # F3
{'label': 'Loans made by candidate', 'level': '3', 'type': {
'link': 'receipts', 'H': 'F3-13A', 'S': 'F3-13A'
}}),
('other_loans_received', # F3P
{'label': 'Other loans', 'level': '3', 'type': {
'link': 'receipts', 'P': 'F3P-19B'
}}),
('all_other_loans', # F3
{'label': 'Other loans', 'level': '3', 'type': {
'link': 'receipts', 'H': 'F3-13B', 'S': 'F3-13B'
}}),
('total_offsets_to_operating_expenditures', # F3P
{'label': 'Total offsets to expenditures', 'level': '2'}),
('subtotal_offsets_to_operating_expenditures', # F3P
{'label': 'Offsets to operating expenditures', 'level': '3', 'type': {
'link': 'receipts', 'P': 'F3P-20A'
}}),
('offsets_to_operating_expenditures', # F3, F3X
{'label': 'Offsets to operating expenditures', 'level': '2', 'type': {
'link': 'receipts', 'H': 'F3-14', 'S': 'F3-14', 'O': 'F3X-15'
}}),
('offsets_to_fundraising_expenditures', # F3P
{'label': 'Fundraising offsets', 'level': '3', 'type': {
'link': 'receipts', 'P': 'F3P-20B'
}}),
('offsets_to_legal_accounting', # F3P
{'label': 'Legal and accounting offsets', 'level': '3', 'type': {
'link': 'receipts', 'P': 'F3P-20C'
}}),
('other_receipts', # F3, F3P
{'label': 'Other receipts', 'level': '2', 'type': {
'link': 'receipts', 'P': 'F3P-21', 'H': 'F3-15', 'S': 'F3-15'
}}),
('fed_candidate_contribution_refunds', # F3X
{'label': 'Candidate refunds', 'level': '2', 'type': {
'link': 'receipts', 'O': 'F3X-16'
}}),
('other_fed_receipts', # F3X
{'label': 'Other Receipts', 'level': '2', 'type': {
'link': 'receipts', 'O': 'F3X-17'
}}),
('total_transfers', # F3X
{'label': 'Total transfers', 'level': '2'}),
('transfers_from_nonfed_account', # F3X
{'label': 'Non-federal transfers', 'level': '3'}),
('transfers_from_nonfed_levin', # F3X
{'label': 'Levin funds', 'level': '3'}),
('fed_receipts', # F3X
{'label': 'Total federal receipts', 'level': '2'}),
])
SPENDING_FORMATTER = OrderedDict([
('disbursements', # F3, F3P, F3X
{'label': 'Total disbursements', 'level': '1',
'term': 'total disbursements'}),
('operating_expenditures', # F3, F3P
{'label': 'Operating expenditures', 'term': 'operating expenditures',
'level': '2', 'type': {'link': 'disbursements',
'P': 'F3P-23', 'H': 'F3-17', 'S': 'F3-17'}}),
('total_operating_expenditures', # F3X - renamed app-side
{'label': 'Operating expenditures', 'term': 'operating expenditures',
'level': '2'}),
('shared_fed_operating_expenditures', # F3X
{'label': 'Allocated operating expenditures - federal', 'level': '3'}),
('shared_nonfed_operating_expenditures', # F3X
{'label': 'Allocated operating expenditures - non-federal',
'level': '3'}),
('other_fed_operating_expenditures', # F3X
{'label': 'Other federal operating expenditures', 'level': '3',
'type': {'link': 'disbursements', 'O': 'F3X-21B'}}),
('transfers_to_other_authorized_committee', # F3, F3P
{'label': 'Transfers to other authorized committees', 'level': '2', 'type': {
'link': 'disbursements', 'H': 'F3-18', 'S': 'F3-18', 'P': 'F3P-24'
}}),
('fundraising_disbursements', # F3P
{'label': 'Fundraising', 'level': '2', 'type': {
'link': 'disbursements', 'P': 'F3P-25'
}}),
('exempt_legal_accounting_disbursement', # F3P
{'label': 'Exempt legal and accounting', 'level': '2', 'type': {
'link': 'disbursements', 'P': 'F3P-26'
}}),
('transfers_to_affiliated_committee', # F3X
{'label': 'Transfers to affiliated committees', 'level': '2', 'type': {
'link': 'disbursements', 'O': 'F3X-22'
}}),
('fed_candidate_committee_contributions', # F3X
{'label': 'Contributions to other committees', 'level': '2', 'type': {
'link': 'disbursements', 'O': 'F3X-23'
}}),
('independent_expenditures', # F3X
{'label': 'Independent expenditures', 'level': '2',
'link': 'independent-expenditures'}),
('coordinated_expenditures_by_party_committee', # F3X
{'label': 'Party coordinated expenditures', 'level': '2',
'link': 'party-coordinated-expenditures'}),
('loans_made', # F3X
{'label': 'Loans made', 'level': '2', 'type': {
'link': 'disbursements', 'O': 'F3X-27'
}}),
('loan_repayments_made', # F3X
{'label': 'Loan repayments made', 'level': '2', 'type': {
'link': 'disbursements', 'O': 'F3X-26'
}}),
('total_loan_repayments_made', # F3P, F3X
{'label': 'Total loan repayments made', 'level': '2'}),
('repayments_loans_made_by_candidate', # F3P
{'label': 'Candidate loan repayments', 'level': '3', 'type': {
'link': 'disbursements', 'P': 'F3P-27A'
}}),
('repayments_other_loans', # F3P
{'label': 'Other loan repayments', 'level': '3', 'type': {
'link': 'disbursements', 'P': 'F3P-27B'
}}),
('contribution_refunds', # F3, F3P, F3X
{'label': 'Total contribution refunds', 'level': '2'}),
('refunded_individual_contributions', # F3, F3P, F3X
{'label': 'Individual refunds', 'level': '3', 'type': {
'link': 'disbursements', 'P': 'F3P-28A', 'H': 'F3-20A', 'S': 'F3-20A', 'O': 'F3X-28A'
}}),
('refunded_political_party_committee_contributions', # F3, F3P, F3X
{'label': 'Political party refunds', 'level': '3', 'type': {
'link': 'disbursements', 'P': 'F3P-28B', 'H': 'F3-20B', 'S': 'F3-20B', 'O': 'F3X-28B'
}}),
('refunded_other_political_committee_contributions', # F3, F3P, F3X
{'label': 'Other committee refunds', 'level': '3', 'type': {
'link': 'disbursements', 'P': 'F3P-28C', 'H': 'F3-20C', 'S': 'F3-20C', 'O': 'F3X-28C'
}}),
('loan_repayments', # F3
{'label': 'Total loan repayments', 'level': '2'}),
('loan_repayments_candidate_loans', # F3
{'label': 'Candidate loan repayments', 'level': '3', 'type': {
'link': 'disbursements', 'H': 'F3-19A', 'S': 'F3-19A'
}}),
('loan_repayments_other_loans', # F3
{'label': 'Other loan repayments', 'level': '3', 'type': {
'link': 'disbursements', 'H': 'F3-19B', 'S': 'F3-19B'
}}),
('other_disbursements', # F3, F3P, F3X
{'label': 'Other disbursements', 'level': '2', 'type': {
'link': 'disbursements', 'P': 'F3P-29', 'H': 'F3-21', 'S': 'F3-21', 'O': 'F3X-29'
}}),
('fed_election_activity', # F3X
{'label': 'Total federal election activity', 'level': '2'}),
('shared_fed_activity', # F3X
{'label': 'Allocated federal election activity - federal share',
'level': '3'}),
('allocated_federal_election_levin_share', # F3X
{'label': 'Allocated federal election activity - Levin share',
'level': '3'}),
('non_allocated_fed_election_activity', # F3X
{'label': 'Federal election activity - federal only', 'level': '3'}),
('fed_disbursements', # F3X
{'label': 'Total federal disbursements', 'level': '2'}),
])
HOST_RAISING_FORMATTER = OrderedDict([
('receipts', # Line 20
{'label': 'Total receipts', 'level': '1', 'term': 'total receipts'}),
('federal_funds', # Line 13
{'label': 'Federal funds', 'level': '2'}),
('contributions', # Line 14
{'label': 'Total Contributions to Defray Convention Expenses', 'level': '2'}),
('individual_contributions', # Line 14a
{'label': 'Itemized Contributions to Defray Convention Expenses', 'level': '3'}),
('individual_unitemized_contributions', # Line 14b
{'label': 'Unitemized Contributions to Defray Convention Expenses', 'level': '3',
}),
('transfers_from_affiliated_party', # Line 15
{'label': 'Transfers from affiliated committees', 'level': '2'}),
('loans_and_loan_repayments', # Line 16
{'label': 'Loans and Loan Repayments Received', 'level': '2'}),
('all_loans_received', # Line 16a
{'label': 'Loans Received', 'level': '3'}),
('loan_repayments_received', # Line 16b
{'label': 'Loan Repayments Received', 'level': '3',
}),
('refunds_relating_convention_exp', # Line 17
{'label': 'Refunds, Rebates, Returns of Deposits Relating to Convention Expenditures', 'level': '2'}),
('itemized_refunds_relating_convention_exp', # Line 17a
{'label': ' Itemized Refunds, Rebates, Returns of Deposits Relating to Convention', 'level': '3'}),
('unitemized_refunds_relating_convention_exp', # Line 17b
{'label': 'Unitemized Refunds, Rebates, Returns of Deposits Relating to Convention', 'level': '3',
}),
('refunds_relating_convention_exp', # Line 18
{'label': 'Other Refunds, Rebates, Returns of Deposits', 'level': '2'}),
('itemized_refunds_relating_convention_exp', # Line 18a
{'label': ' Itemized Other Refunds, Rebates, Returns of Deposits', 'level': '3'}),
('unitemized_refunds_relating_convention_exp', # Line 18b
{'label': 'Unitemized Other Refunds, Rebates, Returns of Deposits', 'level': '3',
}),
('other_fed_receipts', # Line 19
{'label': ' Other Income', 'level': '2'}),
('itemized_other_income', # Line 19a
{'label': 'Itemized Other Income', 'level': '3'}),
('unitemized_other_income', # Line 19b
{'label': 'Unitemized Other Income', 'level': '3',
}),
])
HOST_SPENDING_FORMATTER = OrderedDict([
('disbursements',
{'label': 'Total disbursements', 'level': '1',
'term': 'total disbursements'}),
('convention_exp', # Line 21
{'label': 'Convention Expenditures',
'level': '2'}),
('itemized_convention_exp', # Line 21a
{'label': 'Itemized Convention Expenditures',
'level': '3'}),
('unitemized_convention_exp', # Line 21a
{'label': 'Unitemized Convention Expenditures',
'level': '3'}),
('transfers_to_affiliated_committee', # Line 22
{'label': 'Transfers to Affiliated Committees',
'level': '2'}),
('loans_and_loan_repayments_made', # Line 23
{'label': 'Loans and Loan Repayments Made',
'level': '2'}),
('loans_made', # Line 23a
{'label': 'Loans Made',
'level': '3'}),
('loan_repayments_made', # Line 23a
{'label': 'Loan Repayments Made',
'level': '3'}),
('other_disbursements', # Line 24
{'label': 'Other Disbursements',
'level': '2'}),
('itemized_other_disb', # Line 24a
{'label': 'Itemized Other Disbursements',
'level': '3'}),
('unitemized_other_disb', # Line 24a
{'label': 'Unitemized Other Disbursements',
'level': '3'}),
])
CASH_FORMATTER = OrderedDict([
('cash_on_hand_beginning_period', {'label': 'Beginning cash on hand', 'level': '2'}), #F3, F3P, #F3X
('last_cash_on_hand_end_period', {'label': 'Ending cash on hand', 'term': 'ending cash on hand', 'level': '2'}), #F3, F3P, #F3X
('last_debts_owed_to_committee', {'label': 'Debts/loans owed to committee', 'level': '2'}), #F3, F3P, F3X
('last_debts_owed_by_committee', {'label': 'Debts/loans owed by committee', 'level': '2'}), #F3, F3P, F3X
# Commenting out net numbers because the underlying logic is incorrect
# ('net_contributions', {'label': 'Net contributions', 'level': '2'}), #F3, F3X
# ('contributions', {'label': 'Total contributions', 'level': '3'}), #F3, #F3P, F3X
# ('contribution_refunds', {'label': '(Total contribution refunds)', 'level': '3'}), #F3, F3P, F3X
# ('net_operating_expenditures', {'label': 'Net operating expenditures', 'level': '2'}), #F3, F3X
# ('operating_expenditures', {'label': 'Operating expenditures', 'level': '3'}), #F3, F3P, F3X
# ('offsets_to_operating_expenditures', {'label': '(Offsets to operating expenditures)', 'level': '3'}), #F3, F3P, F3X
# ('subtotal_offsets_to_operating_expenditures', {'label': 'Offsets to operating expenditures', 'level': '3'}), #F3P
])
IE_FORMATTER = OrderedDict([
('total_independent_contributions', {'label': 'Contributions received', 'level': '1'}),
('total_independent_expenditures', {'label': 'Independent expenditures', 'level': '1'})
])
INAUGURAL_FORMATTER = OrderedDict([
('receipts', {'label': 'Total Donations Accepted', 'level': '1'}),
('contribution_refunds', {'label': 'Total Donations Refunded', 'level': '1'})
])
SENATE_CLASSES = {
'1': ['AZ', 'CA', 'CT', 'DE', 'FL', 'HI', 'IN', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NJ', 'NM', 'NY', 'ND', 'OH', 'PA', 'RI', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY'],
'2': ['AL', 'AK', 'AR', 'CO', 'DE', 'GA', 'ID', 'IL', 'IA', 'KS', 'KY', 'LA', 'ME', 'MA', 'MI', 'MN', 'MS', 'MT', 'NE', 'NH', 'NJ', 'NM', 'NC', 'OK', 'OR', 'RI', 'SC', 'SD', 'TN', 'TX', 'VA', 'WV', 'WY'],
'3': ['AL', 'AK', 'AZ', 'AR', 'CA', 'CO', 'CT', 'FL', 'GA', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'MD', 'MO', 'NV', 'NH', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR', 'PA', 'SC', 'SD', 'UT', 'VT', 'WA', 'WI']
}