Skip to main content

pro-sejongpeia (Python)

세종대학교 통합 라이브러리 (Python) · Sejong University integrated library: portal login and public school data (세종대 로그인 API)

한국어 | English

학번과 포털 비밀번호로 세종대 재학생 여부를 확인하고 학과, 학년, 고전독서 인증, 연락처를 가져옵니다. 표준 라이브러리 외 의존성이 없습니다.

로그인 없이 쓰는 학교 공개 데이터(학과 코드, 개설강좌, 학사일정 등)도 같은 패키지에서 제공합니다. 자세한 사용법은 루트 README를 보세요.

▶ 브라우저에서 바로 체험하기 · 호출 한 번에 포털 로그인 한 번 (약 0.8초) · Java·Node 패키지와 같은 결과 · 비밀번호가 틀리면 바로 멈춤 · 매일 실제 포털로 점검

pip install pro-sejongpeia
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) 학생 정보 + 고전독서
fetch_sis_business_periods(id, pw, year, month="") SIS 학사 업무 기간 목록 (로그인 필요, 학교 공개 학사일정과 다른 자료, month 비우면 연간 전체)
authenticate_sis(id, pw, include_raw=False, include_extra=False) 학생 정보 + 이메일, 전화번호, 영문 이름 + 학교 제공 코드 11개 (department_code 등)

로그인 없이 쓰는 학교 데이터

학번·비밀번호 없이 학교가 공개로 내려주는 정보를 받습니다. Java·Node 패키지와 같은 메서드, 같은 결과입니다.

정보 메서드
단과대·학과 코드 (소속 분류, 학기별) organization_categories, terms, departments
개설강좌 (학과·과목명·교수명으로 검색) lectures, course_types, selective_domains
학과 교육과정의 과목 (권장 학년·학기, 학점, 교과목 개요) curriculum_courses
학사일정 calendar
대학원 학사일정 (사이트별) graduate_calendar
기숙사 식단·공지 dormitory_menu, dormitory_notices
학식 메뉴, 캠퍼스 장소 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에 담깁니다. 코드표를 박아 두지 않아 학과가 바뀌어도 코드를 고칠 필요가 없습니다.
  • 한 곳이 실패해도 나머지는 그대로: 실패하면 마지막 캐시 값이나 빈 목록을 돌려주고 예외를 던지지 않습니다 (검색 조건이 하나도 없는 lectures만 예외). 결과는 메모리에 24시간 캐시합니다.
  • 계약과 필드 대응: spec/PUBLIC_DATA.md

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

대신 해결해 주는 것

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

  • 최신 환경의 기본 설정이 막는, 포털이 유일하게 허용하는 암호(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.45

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.45
File Size Uploaded Provenance Actions
pro_sejongpeia-1.2.45.tar.gz 38.6 kB With provenance Details for pro_sejongpeia-1.2.45.tar.gz

Built distribution (wheel)

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

Total release size: 71.4 kB

Release files / pro_sejongpeia-1.2.45.tar.gz

Download URL pro_sejongpeia-1.2.45.tar.gz
Size 38.6 kB
Tags Source
SHA-256 checksum
How to use checksums
54aad258408f344158b920f7258d5850817c0a1ef33220b99e6fb221476c3aa6
BLAKE2b-256 checksum
How to use checksums
79350c92ba875b2cec37b856020a6d8daf3c9705811e378118edaa7456f29ed3
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 29, 2026.

Transparency log

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

Download URL pro_sejongpeia-1.2.45-py3-none-any.whl
Size 32.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1556003aa0f419fc7078c8ce9f78fff81cb6d9b175ed007db36e1fb88f1a6de2
BLAKE2b-256 checksum
How to use checksums
1ac773962dcac3a2ff69417cfd1720b4b7e19934e01018f772965b4c4a09a27a
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 29, 2026.

Transparency log

Security for pro-sejongpeia 1.2.45

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.45.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 29, 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