-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from OKN-CollabNext/fetch-custom-institutions
Adding custom institutions pipelines and data for HowardU and HBCUs
- Loading branch information
Showing
9 changed files
with
169 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
yarn.lock | ||
node_modules/ | ||
bkp/ | ||
|
||
# Ignore python related files (cache, virtual environment, etc.) | ||
*.pyc | ||
*.pyo | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
from pyalex import Institutions, Institution | ||
import pandas as pd | ||
import json | ||
|
||
def get_institutions_howardu() -> list[Institution]: | ||
return Institutions().filter(openalex="I137853757").get() | ||
|
||
def get_institutions_hbcus(dataloadtype) -> list[Institution]: | ||
institutions_hbcus = [] | ||
|
||
if dataloadtype == "local": | ||
try: | ||
institutions_hbcus = json.load(open("data/institutions_hbcus.json")) | ||
except Exception as e: | ||
print("Error loading HBCUs JSON data:", e) | ||
|
||
if dataloadtype == "api" or len(institutions_hbcus) == 0: | ||
try: | ||
# Read list of HBCUs Names from Eligibility Data | ||
inst_df = pd.read_csv("data/institutions_hbcus.csv") | ||
inst_df["query"] = inst_df["name"].str.lower() | ||
inst_df["query"] = inst_df["query"].str.replace(" &", "") | ||
|
||
# Run API search for HBCUs and add filtered results | ||
for query in inst_df["query"].tolist(): | ||
institutions_query = Institutions().filter(display_name={"search": query}).get() | ||
|
||
for inst in institutions_query: | ||
hbcu_inst_ids = [x["id"] for x in institutions_hbcus] | ||
if (inst["display_name"] in inst_df["name"].tolist()) and (inst["id"] not in hbcu_inst_ids): | ||
print("Adding institution:", inst["display_name"]) | ||
institutions_hbcus.append(inst) | ||
except Exception as e: | ||
print("Error reading HBCUs names from CSV and fetching API data:", e) | ||
|
||
return institutions_hbcus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
DATA_LOAD_TYPE = "local" | ||
# DATA_LOAD_TYPE = "api" | ||
INSTITUTION_FILTER = "howardu" | ||
# INSTITUTION_FILTER = "hbcus" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
name | ||
Alabama A & M University | ||
Alabama State University | ||
Albany State University | ||
Alcorn State University | ||
Allen University | ||
American Baptist College | ||
Arkansas Baptist College | ||
Benedict College | ||
Bennett College | ||
Bethune-Cookman University | ||
Bishop State Community College | ||
Bluefield State College | ||
Bowie State University | ||
Central State University | ||
Charles R Drew University of Medicine and Science | ||
Cheyney University of Pennsylvania | ||
Claflin University | ||
Clark Atlanta University | ||
Clinton College | ||
Coahoma Community College | ||
Coppin State University | ||
Delaware State University | ||
Denmark Technical College | ||
Dillard University | ||
Edward Waters College | ||
Elizabeth City State University | ||
Fayetteville State University | ||
Fisk University | ||
Florida Agricultural and Mechanical University | ||
Florida Memorial University | ||
Fort Valley State University | ||
Gadsden State Community College | ||
Grambling State University | ||
H Councill Trenholm State Community College | ||
Hampton University | ||
Harris-Stowe State University | ||
Hinds Community College | ||
Howard University | ||
Huston-Tillotson University | ||
J. F. Drake State Community and Technical College | ||
Jackson State University | ||
Jarvis Christian College | ||
Johnson C Smith University | ||
Kentucky State University | ||
Lane College | ||
Langston University | ||
Lawson State Community College | ||
Le Moyne-Owen College | ||
Lincoln University | ||
Lincoln University | ||
Livingstone College | ||
Meharry Medical College | ||
Miles College | ||
Mississippi Valley State University | ||
Morehouse College | ||
Morehouse School of Medicine | ||
Morgan State University | ||
Morris Brown College | ||
Morris College | ||
Norfolk State University | ||
North Carolina A & T State University | ||
North Carolina Central University | ||
Oakwood University | ||
Paine College | ||
Paul Quinn College | ||
Philander Smith College | ||
Prairie View A & M University | ||
Rust College | ||
Saint Augustine's University | ||
Savannah State University | ||
Shaw University | ||
Shelton State Community College | ||
Shorter College | ||
Simmons College of Kentucky | ||
South Carolina State University | ||
Southern University and A & M College | ||
Southern University at New Orleans | ||
Southern University at Shreveport | ||
Southwestern Christian College | ||
Spelman College | ||
St Philip's College | ||
Stillman College | ||
Talladega College | ||
Tennessee State University | ||
Texas College | ||
Texas Southern University | ||
Tougaloo College | ||
Tuskegee University | ||
University of Arkansas at Pine Bluff | ||
University of Maryland Eastern Shore | ||
University of the District of Columbia | ||
University of the Virgin Islands | ||
Virginia State University | ||
Virginia Union University | ||
Virginia University of Lynchburg | ||
Voorhees College | ||
West Virginia State University | ||
Wilberforce University | ||
Wiley College | ||
Winston-Salem State University | ||
Xavier University of Louisiana |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
invoke | ||
pyalex | ||
python-dotenv | ||
poetry | ||
pandas |