Skip to content

Commit

Permalink
Vfep 1364 - add API's for IpedsIcAy, IpedsIcPy & IpedsIc (#1114)
Browse files Browse the repository at this point in the history
* add api for ipedsicay

* apis for ipedsid, ipedsicay, and ipedsicpy
  • Loading branch information
GcioGregg authored May 6, 2024
1 parent 40c097b commit fe3356c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
16 changes: 16 additions & 0 deletions app/controllers/dashboards_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ def upload_file(class_nm, csv)
file = "tmp/#{params[:csv_type]}s.csv"
file = 'tmp/InstitutionCampus.csv' if class_nm.eql?('AccreditationInstituteCampus')
file = 'tmp/hd2022.csv' if class_nm.eql?('IpedsHd')
file = 'tmp/ic2022_ay.csv' if class_nm.eql?('IpedsIcAy')
file = 'tmp/ic2022_py.csv' if class_nm.eql?('IpedsIcPy')
file = 'tmp/ic2022.csv' if class_nm.eql?('IpedsIc')

upload.csv = file
file_options = {
Expand Down Expand Up @@ -206,6 +209,19 @@ def download_csv(klass)
_stdout, _stderr, status = Open3.capture3("curl -X GET \
https://nces.ed.gov/ipeds/datacenter/data/HD2022.zip \
-H 'Content-Type: application/json' -o tmp/download.zip")
when klass.name.eql?('IpedsIcAy')
_stdout, _stderr, status = Open3.capture3("curl -X GET \
https://nces.ed.gov/ipeds/datacenter/data/IC2022_AY.zip \
-H 'Content-Type: application/json' -o tmp/download.zip")
when klass.name.eql?('IpedsIcPy')
_stdout, _stderr, status = Open3.capture3("curl -X GET \
https://nces.ed.gov/ipeds/datacenter/data/IC2022_PY.zip \
-H 'Content-Type: application/json' -o tmp/download.zip")
when klass.name.eql?('IpedsIc')
_stdout, _stderr, status = Open3.capture3("curl -X GET \
https://nces.ed.gov/ipeds/datacenter/data/IC2022.zip \
-H 'Content-Type: application/json' -o tmp/download.zip")

end
# rubocop:enable Style/EmptyCaseCondition
status.success?
Expand Down
9 changes: 9 additions & 0 deletions config/csv_file_defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ Hcm:
IpedsHd:
liberal_parsing: true

IpedsIcAy:
liberal_parsing: true

IpedsIcPy:
liberal_parsing: true

IpedsIc:
liberal_parsing: true

Complaint:
skip_lines: 7

Expand Down
6 changes: 3 additions & 3 deletions config/initializers/csv_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
{ klass: EightKey, required?: true },
{ klass: Hcm, required?: true },
{ klass: IpedsHd, required?: true, has_api?: true, no_api_key?: true },
{ klass: IpedsIcAy, required?: true },
{ klass: IpedsIcPy, required?: true },
{ klass: IpedsIc, required?: true },
{ klass: IpedsIcAy, required?: true, has_api?: true, no_api_key?: true },
{ klass: IpedsIcPy, required?: true, has_api?: true, no_api_key?: true },
{ klass: IpedsIc, required?: true, has_api?: true, no_api_key?: true },
{ klass: Mou, required?: true },
{ klass: Outcome, required?: true },
{ klass: Scorecard, required?: true, has_api?: true },
Expand Down

0 comments on commit fe3356c

Please sign in to comment.