-
Notifications
You must be signed in to change notification settings - Fork 106
/
Copy pathdocs.py
2709 lines (2178 loc) · 96.7 KB
/
docs.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
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
"""Narrative API documentation."""
API_DESCRIPTION = '''
This application programming interface (API) allows you to explore the way \
candidates and committees fund their campaigns.
The Federal Election Commission (FEC) API is a RESTful web service supporting full-text and field-specific searches on
FEC data. [Bulk downloads](https://www.fec.gov/data/advanced/?tab=bulk-data) are available on the current
site. Information is tied to the underlying forms by file ID and image ID. Data are updated
nightly.
There are a lot of data, and a good place to start is to use search to find
interesting candidates and committees. Then, you can use their IDs to find report or line
item details with the other endpoints. If you are interested in individual donors, check
out contributor information in the `/schedule_a/` endpoints.
<b class="body" id="getting_started_head">Getting started with the openFEC API</b><br>
If you would like to use the FEC's API programmatically, you can sign up for your own API \
key using our form. Alternatively, you can still try out our API without an API key by using \
the web interface and using DEMO_KEY. Note that when you use the openFEC API you are \
subject to the [Terms of Service](https://github.com/fecgov/FEC/blob/master/TERMS-OF-SERVICE.md) \
and [Acceptable Use policy](https://github.com/fecgov/FEC/blob/master/ACCEPTABLE-USE-POLICY.md).
Signing up for an API key will enable you to place up to 1,000 calls an hour. Each call \
is limited to 100 results per page. You can email questions, comments or a request to get \
a key for 7,200 calls an hour (120 calls per minute) to <a href="mailto:[email protected]">[email protected]</a>. You \
can also ask questions and discuss the data in a community led \
[group](https://groups.google.com/forum/#!forum/fec-data).
The model definitions and schema are available at [/swagger](/swagger/). This is useful for
making wrappers and exploring the data.
A few restrictions limit the way you can use FEC data. For example, you can’t use contributor
lists for commercial purposes or to solicit donations.
[Learn more here](https://www.fec.gov/updates/sale-or-use-contributor-information/).
[Inspect our source code](https://github.com/fecgov/openFEC). We welcome issues and pull requests!
<p><br></p>
<h2 class="title" id="signup_head">Sign up for an API key</h2>
<div id="apidatagov_signup">Loading signup form...</div>
'''
PAGES = '''
Number of pages in the document
'''
SORT = '''
Provide a field to sort by. Use `-` for descending order. \
ex: `-case_no`
'''
# ======== candidate start ===========
CANDIDATE_TAG = '''
Candidate endpoints give you access to information about the people running for office.
This information is organized by `candidate_id`. If you're unfamiliar with candidate IDs,
using `/candidates/search/` will help you locate a particular candidate.
Officially, a candidate is an individual seeking nomination for election to a federal
office. People become candidates when they (or agents working on their behalf)
raise contributions or make expenditures that exceed $5,000.
The candidate endpoints primarily use data from FEC registration
[Form 1](https://www.fec.gov/resources/cms-content/documents/fecfrm1.pdf) for committee information and
[Form 2](https://www.fec.gov/resources/cms-content/documents/fecfrm2.pdf) for candidate information.
'''
CANDIDATE_ID = '''
A unique identifier assigned to each candidate registered with the FEC.
If a person runs for several offices, that person will have separate candidate IDs for each office.
First character indicates office - [P]residential, [H]ouse, [S]enate].
Second character is the last digit of the two-year period the ID was created.
Third and fourth is the candidate state. Presidential IDs don't have state.
Fifth and sixth is the district when the candidate first ran. This does not change if the
candidate/member's district changes during re-districting. Presidential IDs don't have districts.
The rest is sequence.
'''
CANDIDATE_INACTIVE = '''
True indicates that a candidate is inactive.
'''
CANDIDATE_CYCLE = '''
Two-year election cycle in which a candidate runs for office.
Calculated from Form 2. The cycle begins with
an odd year and is named for its ending, even year. This cycle follows
the traditional house election cycle and subdivides the presidential
and Senate elections into comparable two-year blocks. To retrieve data for
the entire four years of a presidential term or six years of a senatorial term,
you will need the `election_full` flag.
'''
# committee uses a different definition for cycle because it is less straight forward
CYCLE = '''
Filter records to only those that are applicable to a given two-year
period. This cycle follows the traditional House election cycle and
subdivides the presidential and Senate elections into comparable
two-year blocks. The cycle begins with an odd year and is named for its
ending, even year.
'''
NAME_SEARCH = '''
Search for candidates or committees by name. If you're looking for information on a
particular person or group, using a name to find the `candidate_id` or `committee_id` on
this endpoint can be a helpful first step.
'''
CANDIDATE_LIST = '''
Fetch basic information about candidates, and use parameters to filter results to the
candidates you're looking for.
Each result reflects a unique FEC candidate ID. That ID is particular to the candidate for a
particular office sought. If a candidate runs for the same office multiple times, the ID
stays the same. If the same person runs for another office — for example, a House
candidate runs for a Senate office — that candidate will get a unique ID for each office.
'''
CANDIDATE_HISTORY = '''
Find out a candidate's characteristics over time. This is particularly useful if the
candidate runs for the same office in different districts or you want to know more about a candidate's
previous races.
This information is organized by `candidate_id`, so it won't help you find a candidate
who ran for different offices over time; candidates get a new ID for each office.
'''
CANDIDATE_SEARCH = '''
Fetch basic information about candidates and their principal committees.
Each result reflects a unique FEC candidate ID. That ID is assigned to the candidate for a
particular office sought. If a candidate runs for the same office over time, that ID
stays the same. If the same person runs for multiple offices — for example, a House
candidate runs for a Senate office — that candidate will get a unique ID for each office.
The candidate endpoints primarily use data from FEC registration
[Form 1](https://www.fec.gov/pdf/forms/fecfrm1.pdf) for committee information and
[Form 2](https://www.fec.gov/pdf/forms/fecfrm2.pdf) for candidate information.
'''
CANDIDATE_DETAIL = '''
This endpoint is useful for finding detailed information about a particular candidate. Use the
`candidate_id` to find the most recent information about that candidate.
'''
CANDIDATE_NAME = 'Name of candidate running for office'
CANDIDATE_FIRST_NAME = 'First name of candidate running for office'
CANDIDATE_LAST_NAME = 'Last name of candidate running for office'
CANDIDATE_MIDDLE_NAME = 'Middle name of candidate running for office'
CANDIDATE_PREFIX = 'Name prefix of candidate running for office'
CANDIDATE_SUFFIX = 'Name suffix of candidate running for office'
OFFICE_FULL = 'Federal office candidate runs for: House, Senate or presidential'
OFFICE = 'Federal office candidate runs for: H, S or P'
STATE = 'US state or territory where a candidate runs for office'
YEAR = 'Retrieve records pertaining to a particular election year. The list of election years \
is based on a candidate filing a statement of candidacy (F2) for that year.'
DISTRICT = 'Two-digit US House distirict of the office the candidate is running for. \
Presidential, Senate and House at-large candidates will have District 00.'
CANDIDATE_STATUS = 'One-letter code explaining if the candidate is:\n\
- C present candidate\n\
- F future candidate\n\
- N not yet a candidate\n\
- P prior candidate\n\
'
LAST_F2_DATE = 'The day the FEC received the candidate\'s most recent Form 2'
FIRST_CANDIDATE_FILE_DATE = 'The day the FEC received the candidate\'s first filing. \
This is a F2 candidate registration.'
LAST_CANDIDATE_FILE_DATE = 'The day the FEC received the candidate\'s most recent filing'
INCUMBENT_CHALLENGE = "One-letter code ('I', 'C', 'O') explaining if the candidate is an incumbent, a challenger, \
or if the seat is open."
INCUMBENT_CHALLENGE_FULL = 'Explains if the candidate is an incumbent, a challenger, or if the seat is open.'
ACTIVE_THROUGH = 'Last year a candidate was active. This field is specific to the candidate_id so \
if the same person runs for another office, there may be a different record for them.'
HAS_RAISED_FUNDS = 'A boolean that describes if a candidate\'s committee has ever received any receipts \
for their campaign for this particular office. (Candidates have separate candidate IDs for each office.)'
FEDERAL_FUNDS_FLAG = 'A boolean the describes if a presidential candidate has accepted federal funds. \
The flag will be false for House and Senate candidates.'
CANDIDATE_ELECTION_YEARS = 'Years in which a candidate ran for office.'
CANDIDATE_ELECTION_YEAR = 'Year a candidate runs for federal office.'
ROUNDED_ELECTION_YEARS = 'Rounded election years in which a candidate ran for office'
FEC_CYCLES_IN_ELECTION = 'FEC cycles are included in candidate election years.'
LAST_CANDIDATE_ELECTION_YEAR = 'The last year of the cycle for this election.'
F2_CANDIDATE_CITY = 'City of candidate\'s address, as reported on their Form 2.'
F2_CANDIDATE_STATE = 'State of candidate\'s address, as reported on their Form 2.'
F2_CANDIDATE_STREET_1 = 'Street of candidate\'s address, as reported on their Form 2.'
F2_CANDIDATE_STREET_2 = 'Additional street information of candidate\'s address, as reported on their Form 2.'
F2_CANDIDATE_ZIP = 'Zip code of candidate\'s address, as reported on their Form 2.'
AGGREGATE_BY = 'Candidate totals aggregate_by (Chose one of dropdown options):\n\
- \' \' grouped by election year\n\
- office grouped by election year, by office\n\
- office-state grouped by election year, by office, by state\n\
- office-state-district grouped by election year, by office, by state, by district\n\
- office-party grouped by election year, by office, by party\n\
'
# ======== candidate end ===========
# ======== committee start ===========
COMMITTEE_TAG = '''
Committees are entities that spend and raise money in an election. Their characteristics and
relationships with candidates can change over time.
You might want to use filters or search endpoints to find the committee you're looking
for. Then you can use other committee endpoints to explore information about the committee
that interests you.
Financial information is organized by `committee_id`, so finding the committee you're interested in
will lead you to more granular financial information.
The committee endpoints include all FEC filers, even if they aren't registered as a committee.
Officially, committees include the committees and organizations that file with the FEC.
Several different types of organizations file financial reports with the FEC:
*Campaign committees authorized by particular candidates to raise and spend funds in
their campaigns. Non-party committees (e.g., PACs), some of which may be sponsored by corporations,
unions, trade or membership groups, etc. Political party committees at the national, state, and local levels.
Groups and individuals making only independent expenditures
Corporations, unions, and other organizations making internal communications*
The committee endpoints primarily use data from FEC registration Form 1 and Form 2.
'''
COMMITTEE_ID = '''
A unique identifier assigned to each committee or filer registered with the FEC. In general \
a committee id begins with the letter C which is followed by eight digits.
'''
COMMITTEE_NAME = 'The name of the committee. If a committee changes its name, \
the most recent name will be shown. Committee names are not unique. Use committee_id \
for looking up records.'
COMMITTEE_LIST = '''
Fetch basic information about committees and filers. Use parameters to filter for
particular characteristics.
'''
COMMITTEE_DETAIL = '''
This endpoint is useful for finding detailed information about a particular committee or
filer. Use the `committee_id` to find the most recent information about the committee.
'''
COMMITTEE_HISTORY = '''
Explore a filer's characteristics over time. This can \
be particularly useful if the committees change \
treasurers, designation, or `committee_type`.
'''
COMMITTEE_CYCLE = '''
A two year election cycle that the committee was active- (after original registration
date but before expiration date in Form 1s) The cycle begins with
an odd year and is named for its ending, even year.
'''
COMMITTEE_CYCLES_HAS_FINANCIAL = '''
A two year election cycle that the committee was active- (after original registration
date but before expiration date in Form 1s), and the committee files the financial reports
('F3', 'F3X', 'F3P', 'F3L', 'F4', 'F5', 'F7', 'F13') during this cycle.
'''
COMMITTEE_LAST_CYCLE_HAS_FINANCIAL = '''
The latest two year election cycle that the committee files the financial reports
('F3', 'F3X', 'F3P', 'F3L', 'F4', 'F5', 'F7', 'F13').
'''
COMMITTEE_CYCLES_HAS_ACTIVITY = '''
A two year election cycle that the committee was active- (after original registration
date but before expiration date in Form 1), and the committee has filling activity during the cycle
'''
COMMITTEE_LAST_CYCLE_HAS_ACTIVITY = '''
The latest two year election cycle that the committee has filings
'''
RECORD_CYCLE = '''
Filter records to only those that were applicable to a given
two-year period.The cycle begins with an odd year and is named
for its ending, even year.
'''
RECORD_YEAR = '''
Filter records to only those that were applicable to a given year.
'''
ELECTION_FULL = '''`True` indicates that full election period of a candidate.
`False` indicates that two year election cycle.'''
COMMITTEE_STREET_1 = '''
Street address of committee as reported on the Form 1
'''
COMMITTEE_STREET_2 = '''
Second line of street address of committee as reported on the Form 1
'''
COMMITTEE_CITY = '''
City of committee as reported on the Form 1
'''
COMMITTEE_STATE = '''
State of the committee\'s address as filed on the Form 1
'''
COMMITTEE_STATE_FULL = '''
State of committee as reported on the Form 1
'''
COMMITTEE_ZIP = '''
Zip code of committee as reported on the Form 1
'''
COMMITTEE_EMAIL = '''
Email as reported on the Form 1
'''
COMMITTEE_FAX = '''
Fax as reported on the Form 1
'''
COMMITTEE_WEBSITE = '''
Website url as reported on the Form 1
'''
COMMITTEE_YEAR = 'A year that the committee was active— (after original registration date \
or filing but before expiration date)'
CONVERT_TO_PAC_FLAG = 'True indicates that a candidate committee had been converted to a PAC'
FILING_FREQUENCY = 'The one-letter \n\
code of the filing frequency:\n\
- A Administratively terminated\n\
- D Debt\n\
- M Monthly filer\n\
- Q Quarterly filer\n\
- T Terminated\n\
- W Waived\n\
'
DESIGNATION = 'The one-letter designation code of the organization:\n\
- A authorized by a candidate\n\
- J joint fundraising committee\n\
- P principal campaign committee of a candidate\n\
- U unauthorized\n\
- B lobbyist/registrant PAC\n\
- D leadership PAC\n\
'
ORGANIZATION_TYPE = 'The one-letter code for the kind for organization:\n\
- C corporation\n\
- L labor organization\n\
- M membership organization\n\
- T trade association\n\
- V cooperative\n\
- W corporation without capital stock\n\
'
COMMITTEE_TYPE = 'The one-letter type code of the organization:\n\
- C communication cost\n\
- D delegate\n\
- E electioneering communication\n\
- H House\n\
- I independent expenditure filer (not a committee)\n\
- N PAC - nonqualified\n\
- O independent expenditure-only (super PACs)\n\
- P presidential\n\
- Q PAC - qualified\n\
- S Senate\n\
- U single candidate independent expenditure\n\
- V PAC with non-contribution account, nonqualified\n\
- W PAC with non-contribution account, qualified\n\
- X party, nonqualified\n\
- Y party, qualified\n\
- Z national party non-federal account\n\
'
COMMITTEE_TYPE_STATE_AGGREGATE_TOTALS = COMMITTEE_TYPE + '\
- all All Committee Types\n\
- all_candidates All Candidate Committee Types (H, S, P)\n\
- all_pacs All PAC Committee Types (N, O, Q, V, W)\n\
'
PAC_PARTY_TYPE = 'The one-letter type code of a PAC/Party organization:\n\
- N PAC - nonqualified\n\
- O independent expenditure-only (super PACs)\n\
- Q PAC - qualified\n\
- V PAC with non-contribution account, nonqualified account, qualified\n\
- X party, nonqualified\n\
- Y party, qualified\n\
'
COMMITTEE_LABEL = '''
Display the label of committee based on committee type, designation and organization type
'''
LEADERSHIP_PAC_INDICATE = '''
Indicates if the committee is a leadership PAC
'''
LOBBIST_REGISTRANT_PAC_INDICATE = '''
Indicates if the committee is a lobbyist registrant PAC
'''
PARTY_TYPE = '''
Code for the type of party the committee is, only if applicable
'''
PARTY_TYPE_FULL = '''
Description of the type of party the committee is, only if applicable
'''
HOUSE_PERSONAL_FUNDS = 'House personal funds'
SENATE_PERSONAL_FUNDS = 'Senate personal funds'
OPPOSITION_PERSONAL_FUNDS = 'Opposition personal funds'
TREASURER_NAME = 'Name of the Committee\'s treasurer. If multiple treasurers for the \
committee, the most recent treasurer will be shown.'
TREASURER_CITY = '''
City of committee treasurer as reported on the Form 1
'''
TREASURER_NAME_1 = '''
Name 1 of committee treasurer as reported on the Form 1
'''
TREASURER_NAME_2 = '''
Name 2 of committee treasurer as reported on the Form 1
'''
TREASURER_NAME_MIDDLE = '''
Middle name of committee treasurer as reported on the Form 1
'''
TREASURER_NAME_PREFIX = '''
Name Prefix of committee treasurer as reported on the Form 1
'''
TREASURER_NAME_SUFFIX = '''
Name suffix of committee treasurer as reported on the Form 1
'''
TREASURER_PHONE = '''
Phone of committee treasurer as reported on the Form 1
'''
TREASURER_STATE = '''
State of committee treasurer as reported on the Form 1
'''
TREASURER_STREET_1 = '''
Street of committee treasurer as reported on the Form 1
'''
TREASURER_STREET_2 = '''
Second line of the street of committee treasurer as reported on the Form 1
'''
TREASURER_NAME_TITLE = '''
Name title of committee treasurer as reported on the Form 1
'''
TREASURER_ZIP = '''
Zip code of committee treasurer as reported on the Form 1
'''
CUSTODIAN_CITY = '''
City of committee custodian as reported on the Form 1
'''
CUSTODIAN_NAME1 = '''
Name 1 of committee custodian as reported on the Form 1
'''
CUSTODIAN_NAME2 = '''
Name 2 of committee custodian as reported on the Form 1
'''
CUSTODIAN_MIDDLE_NAME = '''
Middle name of committee custodian as reported on the Form 1
'''
CUSTODIAN_NAME_FULL = '''
Full name of committee custodian as reported on the Form 1
'''
CUSTODIAN_PHONE = '''
Phone number of committee custodian as reported on the Form 1
'''
CUSTODIAN_NAME_PREFIX = '''
Name prefix of committee custodian as reported on the Form 1
'''
CUSTODIAN_STATE = '''
State of committee custodian as reported on the Form 1
'''
CUSTODIAN_STREET_1 = '''
Street address of the committee custodian as reported on the Form 1
'''
CUSTODIAN_STREET_2 = '''
Second line of the street address of the committee custodian as reported on the Form 1
'''
CUSTODIAN_NAME_SUFFIX = '''
Suffix name of the committee custodian as reported on the Form 1
'''
CUSTODIAN_NAME_TITLE = '''
Name title of the committee custodian as reported on the Form 1
'''
CUSTODIAN_ZIP = '''
Zip code of the committee custodian as reported on the Form 1
'''
FIRST_FILE_DATE = 'The day the FEC received the committee\'s first filing. \
This is usually a Form 1 committee registration.'
LAST_FILE_DATE = 'The day the FEC received the committee\'s most recent filing'
FIRST_F1_DATE = 'The day the FEC received the committee\'s first Form 1'
LAST_F1_DATE = 'The day the FEC received the committee\'s most recent Form 1'
MEANS_FILED = 'The method used to file with the FEC, either electronic or on paper.'
MIN_FIRST_FILE_DATE = 'Filter for committees whose first filing was received on or after this date.'
MAX_FIRST_FILE_DATE = 'Filter for committees whose first filing was received on or before this date.'
MIN_LAST_FILE_DATE = 'Filter for committees whose last filing was received on or after this date.'
MAX_LAST_FILE_DATE = 'Filter for committees whose last filing was received on or before this date.'
MIN_FIRST_F1_DATE = 'Filter for committees whose first Form 1 was received on or after this date.'
MAX_FIRST_F1_DATE = 'Filter for committees whose first Form 1 was received on or before this date.'
MIN_LAST_F1_DATE = 'Filter for committees whose latest Form 1 was received on or after this date.'
MAX_LAST_F1_DATE = 'Filter for committees whose latest Form 1 was received on or before this date.'
AFFILIATED_COMMITTEE_NAME = '''
Affiliated committee or connected organization
'''
IS_COMMITTEE_ACTIVE = '''
True indicates that a committee is active.
'''
SPONSOR_CANDIDATE_ID = '''
A unique identifier assigned to each candidate registered with the FEC. \
If a person runs for several offices, that person will have separate \
candidate IDs for each office. This is a filter for Leadership PAC sponsor.
'''
PREVIOUS_FILE_NUMBER = '''
Previous filing ID number
'''
AMENDMENT_VERSION = '''
Amendment version
'''
BANK_DEPOSITORY_NM = '''
Primary bank or depository in which the committee deposits funds,\
holds accounts, rents safety deposit boxes or maintains funds.
'''
BANK_DEPOSITORY_ST1 = '''
Street of bank or depository as reported on their Form 1.
'''
BANK_DEPOSITORY_ST2 = '''
Second line of the street of bank or depository as reported on the Form 1
'''
BANK_DEPOSITORY_CITY = '''
City of bank or depository as reported on the Form 1
'''
BANK_DEPOSITORY_ST = '''
State of bank or depository as reported on the Form 1
'''
BANK_DEPOSITORY_ZIP = '''
Zip code of bank or depository as reported on the Form 1
'''
ADDITIONAL_BANK_NAMES = '''
Additional banks or depositories in which the committee deposits funds,\
holds accounts, rents safety deposit boxes or maintains funds.
'''
FILER_NAME_TEXT = '''
Keyword search for filer name or ID
'''
SPENDER_NAME_TEXT = '''
Keyword search for spender name or ID
'''
PRIMARY_GENERAL_INDICATOR = '''
Primary general indicator
'''
# ======== committee end ===========
# ======== election start ===========
ELECTION_SEARCH = '''
List elections by cycle, office, state, and district.
'''
ELECTIONS = '''
Look at the top-level financial information for all candidates running for the same
office.
Choose a 2-year cycle, and `house`, `senate` or `presidential`.
If you are looking for a Senate seat, you will need to select the state using a two-letter
abbreviation.
House races require state and a two-digit district number.
Since this endpoint reflects financial information, it will only have candidates once they file
financial reporting forms. Query the `/candidates` endpoint to retrieve an-up-to-date list of all the
candidates that filed to run for a particular seat.
'''
STATE_ELECTION_OFFICES = '''
State laws and procedures govern elections for state or local offices as well as
how candidates appear on election ballots.
Contact the appropriate state election office for more information.
'''
STATE_ELECTION_OFFICES_ADDRESS = '''
Enter a state (Ex: AK, TX, VA etc..) to find the local election offices contact
information.
'''
ELECTION_DATES = '''
FEC election dates since 1995.
'''
ELECTION_STATE = '''
State or territory of the office sought.
'''
ELECTION_DISTRICT = '''
House district of the office sought, if applicable.
'''
ELECTION_PARTY = '''
Party, if applicable.
'''
OFFICE_SOUGHT = '''
House, Senate or presidential office.
'''
MIN_ELECTION_DATE = '''
The minimum date of election.
'''
MAX_ELECTION_DATE = '''
The maximum date of election.
'''
ELECTION_TYPE_ID = '''
Election type id
'''
MIN_CREATE_DATE = '''
The minimum date this record was added to the system.(MM/DD/YYYY or YYYY-MM-DD)
'''
MAX_CREATE_DATE = '''
The maximum date this record was added to the system.(MM/DD/YYYY or YYYY-MM-DD)
'''
MIN_UPDATE_DATE = '''
The minimum date this record was last updated.(MM/DD/YYYY or YYYY-MM-DD)
'''
MAX_UPDATE_DATE = '''
The maximum date this record was last updated.(MM/DD/YYYY or YYYY-MM-DD)
'''
CANDIDATE_PCC_ID = 'The candidate\'s primary campaign committee ID'
CANDIDATE_PCC_NAME = 'The candidate\'s primary campaign committee name'
# ======== election end ===========
# ======== financial start ===========
FINANCIAL_TAG = '''
Fetch key information about a committee's Form 3, Form 3X, Form 13, or Form 3P financial reports.
Most committees are required to summarize their financial activity in each filing; those summaries
are included in these files. Generally, committees file reports on a quarterly or monthly basis, but
some must also submit a report 12 days before primary elections. Therefore, during the primary
season, the period covered by this file may be different for different committees. These totals
also incorporate any changes made by committees, if any report covering the period is amended.
Information is made available on the API as soon as it's processed. Keep in mind, complex
paper filings take longer to process.
The financial endpoints use data from FEC [form 5](https://www.fec.gov/pdf/forms/fecfrm5.pdf),
for independent expenditors; or the summary and detailed summary pages of the FEC
[Form 3](https://www.fec.gov/pdf/forms/fecfrm3.pdf), for House and Senate committees;
[Form 3X](https://www.fec.gov/pdf/forms/fecfrm3x.pdf), for PACs and parties;
[Form 13](https://www.fec.gov/pdf/forms/fecfrm13.pdf) for inaugural committees;
and [Form 3P](https://www.fec.gov/pdf/forms/fecfrm3p.pdf), for presidential committees.
'''
WIP_TAG = '''
DISCLAIMER: The field labels contained within this resource are subject to change. We are attempting to succinctly
label these fields while conveying clear meaning to ensure accessibility for all users.
'''
REPORTS = '''
Each report represents the summary information from Form 3, Form 3X and Form 3P.
These reports have key statistics that illuminate the financial status of a given committee.
Things like cash on hand, debts owed by committee, total receipts, and total disbursements
are especially helpful for understanding a committee's financial dealings.
By default, this endpoint includes both amended and final versions of each report. To restrict
to only the final versions of each report, use `is_amended=false`; to retrieve only reports that
have been amended, use `is_amended=true`.
Several different reporting structures exist, depending on the type of organization that
submits financial information. To see an example of these reporting requirements,
look at the summary and detailed summary pages of Form 3, Form 3X, and Form 3P.
'''
REPORTS += WIP_TAG
BEGINNING_IMAGE_NUMBER = '''
Unique identifier for the electronic or paper report. This number is used to construct
PDF URLs to the original document.
'''
REPORT_YEAR = '''
Year that the record applies to. Sometimes records are amended in subsequent
years so this can differ from underlying form's receipt date.
'''
IS_AMENDED = '''
False indicates that a report is the most recent. True indicates that the report has been superseded by an amendment.
'''
MOST_RECENT = '''
Report is either new or is the most-recently filed amendment
'''
MOST_RECENT_IE = '''
The report associated with the transaction is either new or is the most-recently \
filed amendment. Undetermined version (`null`) is always included.
'''
HTML_URL = '''
HTML link to the filing.
'''
FEC_URL = '''
fec link to the filing.
'''
PDF_URL = '''
pdf link to the filing
'''
TWO_YEAR_TRANSACTION_PERIOD = '''
This is a two-year period that is derived from the year a transaction took place in the
Itemized Schedule A and Schedule B tables. In cases where we have the date of the transaction
(contribution_receipt_date in schedules/schedule_a, disbursement_date in schedules/schedule_b)
the two_year_transaction_period is named after the ending, even-numbered year. If we do not
have the date of the transaction, we fall back to using the report year (report_year in both
tables) instead, making the same cycle adjustment as necessary. If no transaction year is
specified, the results default to the most current cycle.
'''
TOTALS = '''
This endpoint provides information about a committee's Form 3, Form 3X, or Form 3P financial reports,
which are aggregated by two-year period. We refer to two-year periods as a `cycle`.
The cycle is named after the even-numbered year and includes the year before it. To obtain
totals from 2013 and 2014, you would use 2014. In odd-numbered years, the current cycle
is the next year — for example, in 2015, the current cycle is 2016.
For presidential and Senate candidates, multiple two-year cycles exist between elections.
'''
SCHEDULE_A_TAG = '''
This collection of endpoints includes Schedule A records reported by a committee. \
Schedule A records describe itemized receipts, including contributions from individuals. \
If you are interested in contributions from individuals, use the /schedules/schedule_a/ endpoint. \
For a more complete description of all Schedule A records visit \
[About receipts data](https://www.fec.gov/campaign-finance-data/about-campaign-finance-data/about-receipts-data/). \
If you are interested in our "is_individual" methodology visit \
our [methodology page](https://www.fec.gov/campaign-finance-data/about-campaign-finance-data/methodology/).\n
Schedule A is also available as a database dump file that is updated weekly on Sunday.
The database dump files are \
here: https://www.fec.gov/files/bulk-downloads/index.html?prefix=bulk-downloads/data-dump/schedules/. \
The instructions are here: https://www.fec.gov/files//bulk-downloads/data-dump/schedules/README.txt. \
We cannot provide help with restoring the database dump files, but you can refer to \
this community led [group](https://groups.google.com/forum/#!forum/fec-data) for discussion.
'''
SCHEDULE_A = '''
This description is for both `/schedules/schedule_a/` and `/schedules/schedule_a/{sub_id}/`.
This endpoint provides itemized receipts. Schedule A records describe itemized receipts, \
including contributions from individuals. If you are interested in contributions from an \
individual, use the `/schedules/schedule_a/` endpoint. For a more complete description of all \
Schedule A records visit \
[About receipts data](https://www.fec.gov/campaign-finance-data/about-campaign-finance-data/about-receipts-data/). \
If you are interested in our "is_individual" methodology visit our \
[methodology page](https://www.fec.gov/campaign-finance-data/about-campaign-finance-data/methodology/). \
The `/schedules/schedule_a/` endpoint is not paginated by page number. This endpoint uses keyset \
pagination to improve query performance and these indices are required to properly page through \
this large dataset. To request the next page, you should append the values found in the \
`last_indexes` object from pagination to the URL of your last request as additional parameters. \
For example, when sorting by `contribution_receipt_date`, you might receive a page of results \
with the two scenarios of following pagination information:
case #1:
```
pagination: {\n\
pages: 2152643,\n\
per_page: 20,\n\
is_count_exact: False,\n\
count: 43052850,\n\
last_indexes: {\n\
last_index: "230880619",\n\
last_contribution_receipt_date: "2014-01-01"\n\
}\n\
}\n\
```
<br/>
case #2 (results which include contribution_receipt_date = NULL):
```
pagination: {\n\
pages: 2152644,\n\
per_page: 20,\n\
count: 43052850,\n\
is_count_exact: False,\n\
last_indexes: {\n\
last_index: "230880639",\n\
sort_null_only: True\n\
}\n\
}\n\
```
To fetch the next page of sorted results, append `last_index=230880619` and \
`last_contribution_receipt_date=2014-01-01` to the URL and \
when reaching `contribution_receipt_date=NULL`, append `last_index=230880639` \
and `sort_null_only=True`. We strongly advise paging through these results \
using sort indices. The default sort is acending by `contribution_receipt_date` \
(`deprecated`, will be descending). \
If you do not page using sort indices, some transactions may be unintentionally filtered out.
Calls to `/schedules/schedule_a/` may return many records. For large result sets, the record \
counts found in the pagination object are approximate; you will need to page through the records \
until no records are returned.
To avoid throwing the "out of range" exception on the last page, one recommandation is \
to use total count and `per_page` to control the traverse loop of results.
The `/schedules/schedule_a/{sub_id}/` endpoint returns a single transaction, but it does \
include a pagination object class. Please ignore the information in that object class.
'''
SUB_ID = '''
A unique database identifier for itemized receipts or disbursements.
'''
SCHEDULE_B_TAG = '''
Schedule B filings describe itemized disbursements. This data
explains how committees and other filers spend their money. These figures are
reported as part of forms F3, F3X and F3P.
'''
SCHEDULE_B = SCHEDULE_B_TAG + '''
The data are divided in two-year periods, called `two_year_transaction_period`, which
is derived from the `report_year` submitted of the corresponding form. If no value is supplied, the results will
default to the most recent two-year period that is named after the ending,
even-numbered year.
Due to the large quantity of Schedule B filings, this endpoint is not paginated by
page number. Instead, you can request the next page of results by adding the values in
the `last_indexes` object from `pagination` to the URL of your last request. For
example, when sorting by `disbursement_date`, you might receive a page of
results with the following pagination information:
```
pagination: {\n\
pages: 965191,\n\
per_page: 20,\n\
count: 19303814,\n\
is_count_exact: False,\n\
last_indexes: {\n\
last_index: "230906248",\n\
last_disbursement_date: "2014-07-04"\n\
}\n\
}\n\
```
To fetch the next page of sorted results, append `last_index=230906248` and
`last_disbursement_date=2014-07-04` to the URL. We strongly advise paging through
these results by using the sort indices (defaults to sort by disbursement date, e.g.
`last_disbursement_date`), otherwise some resources may be unintentionally filtered out.
This resource uses keyset pagination to improve query performance
and these indices are required to properly page through this large dataset.
Note: because the Schedule B data includes many records, counts for
large result sets are approximate; you will want to page through the records until no records are returned.
'''
SCHEDULE_B_BY_PURPOSE = '''
Schedule B disbursements aggregated by disbursement purpose category. To avoid double counting,
memoed items are not included.
Purpose is a combination of transaction codes, category codes and disbursement description.
Inspect the `disbursement_purpose` sql function within the migrations for more details.
'''
SCHEDULE_B_BY_RECIPIENT = '''
Schedule B disbursements aggregated by recipient name. To avoid double counting,
memoed items are not included.
'''
SCHEDULE_B_BY_RECIPIENT_ID = '''
Schedule B disbursements aggregated by recipient committee ID, if applicable.
To avoid double counting, memoed items are not included.
'''
MEMO_TOTAL = '''
Schedule B disbursements aggregated by memoed items only
'''
NON_MEMO_TOTAL = '''
Schedule B disbursements aggregated by non-memoed items only
'''
SCHEDULE_C_TAG = '''
Schedule C shows all loans, endorsements and loan guarantees a committee
receives or makes.
'''
SCHEDULE_C = SCHEDULE_C_TAG + '''
The committee continues to report the loan until it is repaid.
'''
SCHEDULE_D_TAG = '''
Schedule D, it shows debts and obligations owed to or by the committee that are
required to be disclosed.
'''
SCHEDULE_D = SCHEDULE_D_TAG + '''
'''
SCHEDULE_E_TAG = '''
Schedule E covers the line item expenditures for independent expenditures. For example, if a super PAC
bought ads on TV to oppose a federal candidate, each ad purchase would be recorded here with