Skip to main content

pro-sejongpeia (Python)

Pro Sejongpeia: 세종대 개발자들의 작은 유토피아. 학번 인증부터 학과·강의·학사일정·학식까지, Python에서 호출 한 번으로. 표준 라이브러리 외 의존성이 없습니다.

사이트 · 브라우저에서 체험 · 전체 기능표 · GitHub · 한국어 | English

PyPI License: MIT Live portal check

pip install pro-sejongpeia

바로 해 보기

학번도 비밀번호도 필요 없습니다. 2026학년도 2학기 학과 목록과 소프트웨어학과(3220) 개설강좌입니다.

from sejongpeia import SejongPublicData

public_data = SejongPublicData()
departments = public_data.departments("20", "2026", "20")
lectures = public_data.lectures("20", "2026", "20", department_code="3220")
print(len(departments), lectures[0].name)

실제로 돌린 결과입니다 (Python, 2026-10-30, 학교 서버 3번 호출에 0.3초).

SejongPublicData를 실제로 호출한 결과: 학과 103개, 소프트웨어학과 개설강좌, 학사일정

학번 인증

학번과 포털 비밀번호로 세종대 재학생 여부를 확인하고 학과, 학년, 고전독서 인증, 연락처를 가져옵니다. 표준 라이브러리 외 의존성이 없고, 호출 한 번에 포털 로그인 한 번(약 0.8초)입니다. 비밀번호가 틀리면 바로 멈추고, 매일 실제 포털로 점검합니다.

from sejongpeia import authenticate, SejongAuthError, ErrorCode

try:
    result = authenticate("21011234", "비밀번호")
    print(result.name, result.major, result.grade)
except SejongAuthError as error:
    if error.code == ErrorCode.AUTHENTICATION_FAILED:
        print("학번 또는 비밀번호가 틀렸습니다")
    elif error.code == ErrorCode.ACCOUNT_LOCKED:
        print("포털 계정이 잠겼습니다. 포털에서 비밀번호를 재설정하세요")
함수 반환
authenticate(id, pw, include_raw=False, include_extra=False) 학생 정보 + 고전독서 + 연락처 (연락처 조회가 실패하면 연락처만 None, include_raw=True 면 raw_html·raw_json 원문 포함: 세션값·접속 IP가 있어 외부에 그대로 전달 금지, include_extra=True 면 나머지 SIS 필드 extra. 학과 코드 department_code 등 SIS 코드 11개는 항상 포함)
authenticate_dhc(id, pw, include_raw=False) 학생 정보 + 고전독서
authenticate_sis(id, pw, include_raw=False, include_extra=False) 학생 정보 + 이메일, 전화번호, 영문 이름 + 학교 제공 코드 11개 (department_code 등)
fetch_sis_business_periods(id, pw, year, month="") SIS 학사 업무 기간 목록 (로그인 필요, 학교 공개 학사일정과 다른 자료, month 비우면 연간 전체)

로그인 결과에는 고전독서 학기 3개(completed_semesters, certified_semesters, certification_status), 사용자 구분(user_category), 학과의 상위 소속 이름(parent_unit_name)도 포함됩니다.

전부 지원합니다

Java·Python·Node가 같은 기능, 같은 결과를 줍니다. 로그인 없이 쓰는 학교 공개 데이터까지 모두 이 패키지 하나로 됩니다. 한눈에 보는 전체 기능표는 루트 README에 있습니다.

정보 (로그인 없음) 메서드
단과대·학과 코드 (소속 분류, 학기별) organization_categories, terms, departments
개설강좌 (학과·과목명·교수명으로 검색, 모두 비우면 그 학기 전체) lectures, course_types, selective_domains
학과 교육과정의 과목 (권장 학년·학기, 학점, 교과목 개요) curriculum_courses
학사일정 calendar
대학원 학사일정 (사이트별) graduate_calendar
기숙사 식단·공지 dormitory_menu, dormitory_notices
학식 식당 목록·메뉴, 캠퍼스 장소 cafeteria_places, cafeteria_menu, campus_places
비교과 프로그램 일정 extracurricular_events
from sejongpeia import SejongPublicData

public_data = SejongPublicData()
departments = public_data.departments("20", "2026", "20")          # 학부, 2026년 2학기
lectures = public_data.lectures("20", "2026", "20", department_code=departments[0].code)
# 강의의 과목 번호로 그 학과 교육과정의 학년·학기·교과목 개요 (없으면 빈 목록)
courses = public_data.curriculum_courses(lectures[0].department_code, lectures[0].course_number)
  • 학교 값을 그대로 돌려주고, 쓰지 않은 학교 필드는 extra에 담깁니다. 코드표를 박아 두지 않아 학과가 바뀌어도 코드를 고칠 필요가 없습니다.
  • 한 곳이 실패해도 나머지는 그대로: 실패하면 마지막 캐시 값이나 빈 목록을 돌려주고 예외를 던지지 않습니다 (잘못된 입력값만 예외). 결과는 메모리에 24시간 캐시합니다.
  • 계약과 필드 대응: spec/PUBLIC_DATA.md

대신 해결해 주는 것

직접 구현하려면 모두 풀어야 하는 부분입니다.

  • 최신 환경의 기본 설정이 막는, 포털이 유일하게 허용하는 암호(TLS_RSA_WITH_AES_256_CBC_SHA)를 Python ssl 설정으로 자동 허용
  • 방화벽이 막는 기본 User-Agent 대신 식별 가능한 User-Agent 전송
  • 여러 세종대 도메인에 걸친 SSO 쿠키와 리다이렉트 처리
  • 200 응답 안의 판정으로 비밀번호 오류, 계정 잠금, 이용 불가를 즉시 구분 (틀린 비밀번호는 재시도하지 않음)
  • DHC의 HTML 표와 SIS의 JSON을 타입이 있는 결과로 변환

설정: SejongAuthClient(timeout_seconds=10, max_retry=3, ssl_verification=True).

에러 코드(error.code): AUTHENTICATION_FAILED, ACCOUNT_LOCKED, ACCOUNT_UNAVAILABLE, INVALID_INPUT, CONNECTION_FAILED, CONNECTION_TIMEOUT, SESSION_ERROR, DATA_FETCH_FAILED, PARSE_ERROR, SSL_CONFIGURATION_ERROR. 메시지가 아니라 코드로 분기하세요.

계정 잠금. 세종대 포털은 비밀번호를 여러 번 틀리면(약 5회) 계정을 잠급니다. https://portal.sejong.ac.kr/jsp/inquiry/pwinquiry.jsp 에서 비밀번호를 재설정해야 풀립니다. 라이브러리는 거부된 로그인을 재시도하지 않습니다. 누구나 학번을 입력할 수 있는 서비스라면 학번별 실패 횟수를 제한하세요.

Python 3.9 이상. 세종대학교 공식 제품이 아닙니다.

문서, 라이브 데모, Java·Node 버전: https://cassiiopeia.github.io/pro-sejongpeia/

English

Verify a Sejong University student with a student ID and portal password, and get their major, year, classic-reading certification and contact info. The API above is the same in English; error messages are in English. Full English docs: README.en.md.

Also included: public data (no login): course lists, academic calendar, dormitory and cafeteria menus, campus places and extracurricular events via SejongPublicData, with caching and failure isolation. See the Korean section above and README.en.md.

Metadata

Release files for pro-sejongpeia 1.2.61

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pro-sejongpeia 1.2.61
File Size Uploaded Provenance Actions
pro_sejongpeia-1.2.61.tar.gz 46.1 kB With provenance Details for pro_sejongpeia-1.2.61.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pro-sejongpeia 1.2.61
File Interpreter ABI Platform Actions
pro_sejongpeia-1.2.61-py3-none-any.whl Python 3 none any Details for pro_sejongpeia-1.2.61-py3-none-any.whl

Total release size: 90.2 kB

Release files / pro_sejongpeia-1.2.61.tar.gz

Download URL pro_sejongpeia-1.2.61.tar.gz
Size 46.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e259048cb2cdbbfa15ee82ebe99bfec1b90baabd8caafe8a1928ba1265ea1dc0
BLAKE2b-256 checksum
How to use checksums
18d2833a4ebf0a9d1b31af2ee71ce7a66a2e77f9214bf93373c2316306c44e9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / pro_sejongpeia-1.2.61-py3-none-any.whl

Download URL pro_sejongpeia-1.2.61-py3-none-any.whl
Size 44.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a3eba9008dc51ebc7bcd80c7857489e5413fd73db65a5d3c82df1089fcabc08f
BLAKE2b-256 checksum
How to use checksums
e84b60080224842254ca14116b885fc6be45c170fa19a56f355e55c45b612599
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Security for pro-sejongpeia 1.2.61

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pro_sejongpeia-1.2.61.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page