파이썬 표준 라이브러리¶
파이썬 언어 레퍼런스 는 파이썬 언어의 정확한 문법과 의미를 설명하고 있지만, 이 라이브러리 레퍼런스 설명서는 파이썬과 함께 배포되는 표준 라이브러리를 설명합니다. 또한, 파이썬 배포판에 일반적으로 포함되어있는 선택적 구성 요소 중 일부를 설명합니다.
파이썬의 표준 라이브러리는 매우 광범위하며, 아래 나열된 긴 목차에 표시된 대로 다양한 기능을 제공합니다. 라이브러리에는 일상적인 프로그래밍에서 발생하는 많은 문제에 대한 표준적인 해결책을 제공하는 파이썬으로 작성된 모듈뿐만 아니라, 파일 I/O와 같은 시스템 기능에 액세스하는 (C로 작성된) 내장 모듈들이 포함됩니다 (이 모듈들이 없다면 파이썬 프로그래머가 액세스할 방법은 없습니다). 이 모듈 중 일부는 플랫폼 관련 사항을 플랫폼 중립적인 API들로 추상화시킴으로써, 파이썬 프로그램의 이식성을 권장하고 개선하도록 명시적으로 설계되었습니다.
윈도우 플랫폼용 파이썬 설치 프로그램은 일반적으로 전체 표준 라이브러리를 포함하며 종종 많은 추가 구성 요소도 포함합니다. 유닉스와 같은 운영체제의 경우, 파이썬은 일반적으로 패키지 모음으로 제공되기 때문에, 운영 체제와 함께 제공되는 패키지 도구를 사용하여 선택적 구성 요소의 일부 또는 전부를 구해야 할 수 있습니다.
표준 라이브러리 외에도, 수십만 가지 컴포넌트(개별 프로그램과 모듈부터 패키지 및 전체 응용 프로그램 개발 프레임워크까지)로 구성된 활발한 모음이 있는데, 파이썬 패키지 색인 에서 얻을 수 있습니다.
- 소개
- 내장 함수
- 내장 상수
- 내장형
- 논리값 검사
- 논리 연산 —
and
,or
,not
- 비교
- 숫자 형 —
int
,float
,complex
- Boolean Type -
bool
- 이터레이터 형
- 시퀀스 형 —
list
,tuple
,range
- Text and Binary Sequence Type Methods Summary
- 텍스트 시퀀스 형 —
str
- 바이너리 시퀀스 형 —
bytes
,bytearray
,memoryview
- 집합 형 —
set
,frozenset
- 매핑 형 —
dict
- 컨텍스트 관리자 형
- Type Annotation Types — Generic Alias, Union
- 기타 내장형
- 특수 어트리뷰트
- Integer string conversion length limitation
- 내장 예외
- 텍스트 처리 서비스
- 바이너리 데이터 서비스
- 데이터형
datetime
— Basic date and time typeszoneinfo
— IANA time zone supportcalendar
— General calendar-related functionscollections
— Container datatypescollections.abc
— Abstract Base Classes for Containersheapq
— Heap queue algorithmbisect
— Array bisection algorithmarray
— Efficient arrays of numeric valuesweakref
— 약한 참조types
— Dynamic type creation and names for built-in typescopy
— 얕은 복사와 깊은 복사 연산pprint
— Data pretty printerreprlib
— Alternaterepr()
implementationenum
— Support for enumerationsgraphlib
— Functionality to operate with graph-like structures
- 숫자와 수학 모듈
- 함수형 프로그래밍 모듈
- 파일과 디렉터리 액세스
pathlib
— Object-oriented filesystem pathsos.path
— Common pathname manipulationsstat
— Interpretingstat()
resultsfilecmp
— 파일과 디렉터리 비교tempfile
— Generate temporary files and directoriesglob
— Unix style pathname pattern expansionfnmatch
— 유닉스 파일명 패턴 일치linecache
— 텍스트 줄에 대한 무작위 액세스shutil
— High-level file operations
- 데이터 지속성
- 데이터 압축 및 보관
- 파일 형식
- 암호화 서비스
- 일반 운영 체제 서비스
os
— Miscellaneous operating system interfacesio
— Core tools for working with streamstime
— Time access and conversionslogging
— Logging facility for Pythonlogging.config
— Logging configurationlogging.handlers
— Logging handlersplatform
— Access to underlying platform’s identifying dataerrno
— Standard errno system symbolsctypes
— A foreign function library for Python
- Command Line Interface Libraries
argparse
— Parser for command-line options, arguments and subcommandsoptparse
— Parser for command line optionsgetpass
— 이식성 있는 암호 입력fileinput
— 여러 입력 스트림에서 줄을 이터레이트 하기curses
— Terminal handling for character-cell displayscurses.textpad
— curses 프로그램을 위한 텍스트 입력 위젯curses.ascii
— ASCII 문자용 유틸리티curses.panel
— curses 용 패널 스택 확장
- 동시 실행
threading
— Thread-based parallelismmultiprocessing
— Process-based parallelismmultiprocessing.shared_memory
— Shared memory for direct access across processesconcurrent
패키지concurrent.futures
— Launching parallel taskssubprocess
— Subprocess managementsched
— 이벤트 스케줄러queue
— A synchronized queue classcontextvars
— Context Variables_thread
— Low-level threading API
- 네트워킹과 프로세스 간 통신
- 인터넷 데이터 처리
- 구조화된 마크업 처리 도구
html
— 하이퍼텍스트 마크업 언어 지원html.parser
— Simple HTML and XHTML parserhtml.entities
— HTML 일반 엔티티의 정의- XML 처리 모듈
xml.etree.ElementTree
— The ElementTree XML APIxml.dom
— 문서 객체 모델 APIxml.dom.minidom
— Minimal DOM implementationxml.dom.pulldom
— 부분 DOM 트리 구축 지원xml.sax
— SAX2 구문 분석기 지원xml.sax.handler
— Base classes for SAX handlersxml.sax.saxutils
— SAX 유틸리티xml.sax.xmlreader
— XML 구문 분석기 인터페이스xml.parsers.expat
— Fast XML parsing using Expat
- 인터넷 프로토콜과 지원
webbrowser
— Convenient web-browser controllerwsgiref
— WSGI Utilities and Reference Implementationurllib
— URL 처리 모듈urllib.request
— Extensible library for opening URLsurllib.response
— urllib가 사용하는 응답 클래스urllib.parse
— Parse URLs into componentsurllib.error
— urllib.request에 의해 발생하는 예외 클래스urllib.robotparser
— robots.txt 구문 분석기http
— HTTP moduleshttp.client
— HTTP protocol clientftplib
— FTP protocol clientpoplib
— POP3 프로토콜 클라이언트imaplib
— IMAP4 protocol clientsmtplib
— SMTP protocol clientuuid
— UUID objects according to RFC 9562socketserver
— A framework for network servershttp.server
— HTTP servershttp.cookies
— HTTP state managementhttp.cookiejar
— Cookie handling for HTTP clientsxmlrpc
— XMLRPC 서버와 클라이언트 모듈xmlrpc.client
— XML-RPC client accessxmlrpc.server
— Basic XML-RPC serversipaddress
— IPv4/IPv6 manipulation library
- 멀티미디어 서비스
- 국제화
- 프로그램 프레임워크
- Tk를 사용한 그래픽 사용자 인터페이스
- 개발 도구
typing
— Support for type hintspydoc
— Documentation generator and online help system- 파이썬 개발 모드
doctest
— Test interactive Python examplesunittest
— Unit testing frameworkunittest.mock
— mock object libraryunittest.mock
— getting startedtest
— Regression tests package for Pythontest.support
— 파이썬 테스트 스위트용 유틸리티test.support.socket_helper
— 소켓 테스트용 유틸리티test.support.script_helper
— 파이썬 실행 테스트용 유틸리티test.support.bytecode_helper
— 올바른 바이트 코드 생성 테스트를 위한 지원 도구test.support.threading_helper
— Utilities for threading teststest.support.os_helper
— Utilities for os teststest.support.import_helper
— Utilities for import teststest.support.warnings_helper
— Utilities for warnings tests
- 디버깅과 프로파일링
- 소프트웨어 패키징 및 배포
- 파이썬 실행시간 서비스
sys
— System-specific parameters and functionssys.monitoring
— Execution event monitoringsysconfig
— Provide access to Python’s configuration informationbuiltins
— 내장 객체__main__
— Top-level code environmentwarnings
— Warning controldataclasses
— Data Classescontextlib
—with
문 컨텍스트를 위한 유틸리티abc
— Abstract Base Classesatexit
— 종료 처리기traceback
— Print or retrieve a stack traceback__future__
— Future statement definitionsgc
— 가비지 수거기 인터페이스inspect
— Inspect live objectsannotationlib
— Functionality for introspecting annotationssite
— Site-specific configuration hook
- 사용자 정의 파이썬 인터프리터
- 모듈 임포트 하기
zipimport
— Zip 저장소에서 모듈 임포트pkgutil
— 패키지 확장 유틸리티modulefinder
— 스크립트에서 사용되는 모듈 찾기runpy
— Locating and executing Python modulesimportlib
—import
의 구현importlib.resources
– Package resource reading, opening and accessimportlib.resources.abc
– Abstract base classes for resourcesimportlib.metadata
– Accessing package metadata- The initialization of the
sys.path
module search path
- 파이썬 언어 서비스
ast
— Abstract Syntax Treessymtable
— Access to the compiler’s symbol tablestoken
— Constants used with Python parse treeskeyword
— 파이썬 키워드 검사tokenize
— Tokenizer for Python sourcetabnanny
— 모호한 들여쓰기 감지pyclbr
— 파이썬 모듈 브라우저 지원py_compile
— 파이썬 소스 파일 컴파일compileall
— 파이썬 라이브러리 바이트 컴파일하기dis
— Disassembler for Python bytecodepickletools
— 피클 개발자를 위한 도구
- MS 윈도우 특정 서비스
- 유닉스 특정 서비스
- Modules command-line interface (CLI)
- 대체된 모듈
- Removed Modules
- Security Considerations