Quick start
-
Install it. Pin the exact version. Latest version All versions are on GitHub Releases (API stability).
Published to Maven Central, so no extra repository is needed. Java 17+, Spring Boot 3.x.
dependencies {implementation "kr.suhsaechan:sejongpeia:<version>"}<dependency><groupId>kr.suhsaechan</groupId><artifactId>sejongpeia</artifactId><version><!-- the version you pin --></version></dependency>Put the latest version in
<version>. Check it on the Maven Central artifact page; all versions are listed in the repository index.Python 3.9+, no dependencies beyond the standard library.
터미널 창 pip install pro-sejongpeia==<version>Node 18+, zero dependencies, TypeScript types included, ESM and CommonJS.
터미널 창 npm install pro-sejongpeia@<version> -
Call student verification. One integrated call with a student ID and password.
Spring Boot auto-configuration registers a
SuhSejongAuthEnginebean.@RestController@RequiredArgsConstructorpublic class AuthController {private final SuhSejongAuthEngine sejongAuthEngine;@PostMapping("/auth/sejong")public SejongAuthResult authenticate(@RequestParam String studentId,@RequestParam String password) {return sejongAuthEngine.authenticate(studentId, password);}}from sejongpeia import authenticate, SejongAuthError, ErrorCodetry:result = authenticate("21011234", "password")print(result.name, result.major, result.grade)except SejongAuthError as error:if error.code == ErrorCode.AUTHENTICATION_FAILED:print("Wrong student ID or password")elif error.code == ErrorCode.ACCOUNT_LOCKED:print("The portal account is locked. Reset the password on the portal")import { authenticate, SejongAuthError, ErrorCode } from 'pro-sejongpeia';try {const result = await authenticate('21011234', 'password');console.log(result.name, result.major, result.grade);} catch (error) {if (error instanceof SejongAuthError && error.code === ErrorCode.AUTHENTICATION_FAILED) {console.log('Wrong student ID or password');} else if (error instanceof SejongAuthError && error.code === ErrorCode.ACCOUNT_LOCKED) {console.log('The portal account is locked. Reset the password on the portal');}}Branch on the error code, never on the message. The code list is in Error codes.
-
Call school data that needs no login. Get the department list, then the course listings of the first department (undergraduate).
"20"(undergraduate) and the semester value are the school’s own values.SejongPublicData publicData = new SejongPublicData(); // inject it as a bean in SpringList<Department> departments = publicData.departments("20", "2026", "20");List<Lecture> lectures = publicData.lectures("20", "2026", "20", departments.get(0).getCode(), "", "");from sejongpeia import SejongPublicDatapublic_data = SejongPublicData()departments = public_data.departments("20", "2026", "20") # undergraduatelectures = public_data.lectures("20", "2026", "20", department_code=departments[0].code)# Course number of a lecture > grade, semester and overview in that department's curriculum (empty list if none)courses = public_data.curriculum_courses(lectures[0].department_code, lectures[0].course_number)import { SejongPublicData } from 'pro-sejongpeia';const publicData = new SejongPublicData();const departments = await publicData.departments({ categoryCode: '20', year: '2026', semesterCode: '20' });const lectures = await publicData.lectures({ categoryCode: '20', year: '2026', semesterCode: '20', departmentCode: departments[0].code });Create one
SejongPublicDataper process. The in-memory cache (24 hours by default) and request coalescing live inside the instance.
Plain Java (without Spring)
Section titled “Plain Java (without Spring)”Spring Boot is an optional dependency, so a plain Java project does not pull it in. The JVM blocks the old TLS cipher the portal accepts, so call SejongTlsSupport.ensureLegacyCipherEnabled() first in main(), before any other HTTPS call.
import kr.suhsaechan.sejongpeia.auth.client.SejongPortalClient;import kr.suhsaechan.sejongpeia.auth.client.SejongSisClient;import kr.suhsaechan.sejongpeia.auth.model.SejongAuthResult;import kr.suhsaechan.sejongpeia.auth.parser.SejongClassicReadingParser;import kr.suhsaechan.sejongpeia.auth.parser.SejongSisParser;import kr.suhsaechan.sejongpeia.auth.parser.SejongStudentInfoParser;import kr.suhsaechan.sejongpeia.auth.service.SuhSejongAuthEngine;import kr.suhsaechan.sejongpeia.common.config.SejongAuthProperties;import kr.suhsaechan.sejongpeia.common.util.SejongTlsSupport;
SejongTlsSupport.ensureLegacyCipherEnabled(); // first in main(), before any other HTTPS callSejongAuthProperties properties = new SejongAuthProperties();SuhSejongAuthEngine engine = new SuhSejongAuthEngine(new SejongPortalClient(properties), new SejongStudentInfoParser(), new SejongClassicReadingParser(), new SejongSisClient(properties), new SejongSisParser());SejongAuthResult result = engine.authenticate(studentId, password);Called too late, authentication fails with CONNECTION_FAILED and a message that names the cause. The setting applies to the whole JVM. See Legacy TLS for why. Spring Boot handles it at startup, and Python and Node change only the TLS settings of their own connections.
