|
| 1 | +import gzip |
1 | 2 | import json
|
2 | 3 | import logging
|
3 | 4 | import os
|
4 | 5 | from collections import OrderedDict
|
5 |
| -from flask import request |
| 6 | +from flask import request, Response |
6 | 7 | from sqlalchemy import func, desc, Numeric, BigInteger, Integer, text, or_, and_
|
7 | 8 |
|
8 | 9 | import app.utils.jsonutils as jsonutils
|
|
29 | 30 | COMMOD_MAP_DATA_JSON = "commodities_map_data.json"
|
30 | 31 | COMMOD_STATE_DISTRIBUTION_DATA_JSON = "commodities_state_distribution_data.json"
|
31 | 32 | COMMOD_SUBPROGRAMS_DATA_JSON = "commodities_subprograms_data.json"
|
| 33 | +ARC_PLC_DATA_JSON = "arc_plc_payments_Current.json.gz" |
| 34 | +I_PROPOSALS_SUBTITLE_A_DATA_PATH = os.path.join(TITLE_I_DATA_PATH, "proposals", "subtitle-a") |
| 35 | +ARC_PLC_PROPOSAL_DATA_JSON = "arc_plc_payments_Proposed.json.gz" |
32 | 36 | I_SUBTITLE_D_DATA_PATH = os.path.join(TITLE_I_DATA_PATH, "subtitle-d")
|
33 | 37 | DMC_STATE_DISTRIBUTION_DATA_JSON = "dmc_state_distribution_data.json"
|
34 | 38 | DMC_SUBPROGRAMS_DATA_JSON = "dmc_subprograms_data.json"
|
@@ -437,6 +441,32 @@ def titles_title_i_subtitles_subtitle_e_summary_search():
|
437 | 441 | return endpoint_response
|
438 | 442 |
|
439 | 443 |
|
| 444 | +# /pdl/titles/title-i/subtitles/subtitle-a/arc-plc-payments/current |
| 445 | +def titles_title_i_subtitles_subtitle_a_arc_plc_payments_current_search(): |
| 446 | + # set the file path |
| 447 | + arc_plc_current_data = os.path.join(I_SUBTITLE_A_DATA_PATH, ARC_PLC_DATA_JSON) |
| 448 | + |
| 449 | + with open(arc_plc_current_data, 'rb') as current_data: |
| 450 | + file_data = current_data.read() |
| 451 | + |
| 452 | + response = Response(file_data, mimetype='application/json') |
| 453 | + response.headers['Content-Encoding'] = 'gzip' |
| 454 | + return response |
| 455 | + |
| 456 | + |
| 457 | +# /pdl/titles/title-i/subtitles/subtitle-a/arc-plc-payments/proposed |
| 458 | +def titles_title_i_subtitles_subtitle_a_arc_plc_payments_proposed_search(): |
| 459 | + # set the file path |
| 460 | + arc_plc_proposed_data = os.path.join(I_PROPOSALS_SUBTITLE_A_DATA_PATH, ARC_PLC_PROPOSAL_DATA_JSON) |
| 461 | + |
| 462 | + with open(arc_plc_proposed_data, 'rb') as proposed_data: |
| 463 | + file_data = proposed_data.read() |
| 464 | + |
| 465 | + response = Response(file_data, mimetype='application/json') |
| 466 | + response.headers['Content-Encoding'] = 'gzip' |
| 467 | + return response |
| 468 | + |
| 469 | + |
440 | 470 | # /pdl/titles/title-ii/summary:
|
441 | 471 | def titles_title_ii_summary_search():
|
442 | 472 | title_id = get_title_id(TITLE_II_NAME)
|
|
0 commit comments