Skip to content

Python package for matching K-12 course names and descriptions to standardized NCES School Courses for the Exchange of Data (SCED) codes.

License

Notifications You must be signed in to change notification settings

LeosonH/sced-matcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NCES School Courses for the Exchange of Data (SCED) Codes Matching Tool

A Python package for matching K-12 course names and descriptions to standardized NCES School Courses for the Exchange of Data (SCED) codes.

An API key from Google AI Studio (Gemini) is required.

Installation

Install the package using pip:

pip install sced-matcher

Usage

Basic Usage

from sced_matcher import SCEDMatcher

# Initialize the matcher with your Google Gemini API key
matcher = SCEDMatcher(api_key="your-gemini-api-key")
# Or set GEMINI_API_KEY environment variable and use:
# matcher = SCEDMatcher()

# Get SCED code for a single course
sced_code = matcher.get_sced_match("Advanced Algebra")
print(sced_code)  # Returns SCED code

# Get detailed information
code, name, description = matcher.get_sced_match("Advanced Algebra", return_details=True)
print(f"Code: {code}, Name: {name}, Description: {description}")

Processing DataFrames

import pandas as pd

# Create or load your DataFrame
df = pd.DataFrame({
    'Course_Name': ['Advanced Algebra', 'Biology I', 'World History'],
    'Course_Description': ['Advanced algebra concepts', 'Introduction to biology', 'World history survey']
})

# Process the DataFrame
result_df = matcher.process_dataframe(df)
print(result_df)  # DataFrame with added SCED_Code column

Processing CSV Files

# Process a CSV file directly
result_df = matcher.process_csv_file('input.csv', 'output_with_sced.csv')

Requirements

  • Python 3.8+
  • Google Gemini (AI Studio) API key
  • Required packages: google-genai, pandas, python-dotenv

Environment Setup

Create a .env file in your project root:

GEMINI_API_KEY=your-gemini-api-key-here

About

Python package for matching K-12 course names and descriptions to standardized NCES School Courses for the Exchange of Data (SCED) codes.

Topics

Resources

License

Stars

Watchers

Forks

Languages