Pustaka Standar PythonΒΆ
Sementara Referensi Bahasa Python menjelaskan sintaks dan semantik bahasa Python yang tepat, manual referensi pustaka ini menggambarkan pustaka standar yang didistribusikan dengan Python. Ini juga menjelaskan beberapa komponen opsional yang biasanya termasuk dalam distribusi Python.
Perpustakaan standar Python sangat luas, menawarkan berbagai fasilitas seperti yang ditunjukkan oleh daftar isi yang tercantum di bawah ini. Pustaka berisi modul bawaan (ditulis dalam C) yang menyediakan akses ke fungsionalitas sistem seperti file I/O yang seharusnya tidak dapat diakses oleh programmer Python, serta modul yang ditulis dengan Python yang menyediakan solusi standar untuk banyak masalah yang terjadi pada pemrograman sehari-hari. Beberapa modul ini dirancang secara eksplisit untuk mendorong dan meningkatkan portabilitas program Python dengan mengabstraksi spesifik platform menjadi API platform-netral.
Pemasang Python untuk platform Windows biasanya menyertakan seluruh pustaka standar dan sering juga menyertakan banyak komponen tambahan. Untuk sistem operasi mirip Unix, Python biasanya disediakan sebagai kumpulan paket, jadi mungkin perlu menggunakan alat pengemasan yang disediakan dengan sistem operasi untuk mendapatkan beberapa atau semua komponen opsional.
Selain pustaka standar, ada koleksi berkembang beberapa ribu komponen (dari program individu dan modul ke paket dan seluruh kerangka kerja pengembangan aplikasi), tersedia dari Python Package Index.
- Pengenalan
- Fungsi Bawaan
- Konstanta Bawaan
- Tipe Bawaan
- Pengujian Kebenaran Nilai
- Operasi Boolean ---
and
,or
,not
- Perbandingan
- Numeric Types ---
int
,float
,complex
- Iterator Types
- Sequence Types ---
list
,tuple
,range
- Text Sequence Type ---
str
- Binary Sequence Types ---
bytes
,bytearray
,memoryview
- Set Types ---
set
,frozenset
- Mapping Types ---
dict
- Context Manager Types
- Other Built-in Types
- Atribut Spesial
- Integer string conversion length limitation
- Built-in Exceptions
- Layanan Pemrosesan Teks
string
--- Operasi umum pada string.re
--- Regular expression operationsdifflib
--- Helpers for computing deltastextwrap
--- Text wrapping and fillingunicodedata
--- Unicode Databasestringprep
--- Internet String Preparationreadline
--- GNU readline interfacerlcompleter
--- Completion function for GNU readline
- Servis Data Binary
- Tipe Data
datetime
--- Basic date and time typescalendar
--- Fungsi-fungsi umum yang terkait dengan modul calendarcollections
--- Container datatypescollections.abc
--- Abstract Base Classes for Containersheapq
--- Heap queue algorithmbisect
--- Array bisection algorithmarray
--- Efficient arrays of numeric valuesweakref
--- Weak referencestypes
--- Dynamic type creation and names for built-in typescopy
--- Operasi shallow copy dan deep copypprint
--- Data pretty printerreprlib
--- Alternaterepr()
implementationenum
--- Support for enumerations
- Modul Numerik dan Matematika
numbers
--- Numeric abstract base classesmath
--- Mathematical functionscmath
--- Mathematical functions for complex numbersdecimal
--- Decimal fixed point and floating point arithmeticfractions
--- Rational numbersrandom
--- Generate pseudo-random numbersstatistics
--- Mathematical statistics functions
- Modul Pemrograman Fungsional
- File and Directory Access
pathlib
--- Object-oriented filesystem pathsos.path
--- Common pathname manipulationsfileinput
--- Iterate over lines from multiple input streamsstat
--- Interpretingstat()
resultsfilecmp
--- File and Directory Comparisonstempfile
--- Generate temporary files and directoriesglob
--- Ekspansi pola nama jalur bergaya Unixfnmatch
--- Unix filename pattern matchinglinecache
--- Random access to text linesshutil
--- High-level file operations
- Persistensi Data
- Kompresi Data dan Pengarsipan
- File Formats
- Layanan Kriptografi
- Layanan Sistem Operasi Generik
os
--- Miscellaneous operating system interfacesio
--- Core tools for working with streamstime
--- Akses waktu dan konversiargparse
--- Parser for command-line options, arguments and sub-commandsgetopt
--- C-style parser for command line optionslogging
--- Logging facility for Pythonlogging.config
--- Logging configurationlogging.handlers
--- Logging handlersgetpass
--- Portable password inputcurses
--- Terminal handling for character-cell displayscurses.textpad
--- Text input widget for curses programscurses.ascii
--- Utilities for ASCII characterscurses.panel
--- A panel stack extension for cursesplatform
--- Access to underlying platform's identifying dataerrno
--- Standard errno system symbolsctypes
--- A foreign function library for Python
- Eksekusi Serentak
threading
--- Thread-based parallelismmultiprocessing
--- Process-based parallelismmultiprocessing.shared_memory
--- Provides shared memory for direct access across processes- Paket
concurrent
concurrent.futures
--- Launching parallel taskssubprocess
--- Subprocess managementsched
--- Event schedulerqueue
--- A synchronized queue classcontextvars
--- Context Variables_thread
--- Low-level threading API_dummy_thread
--- Drop-in pengganti untuk modul_thread
dummy_threading
--- Drop-in replacement for thethreading
module
- Komunikasi Interproses dan Networking
asyncio
--- Asynchronous I/Osocket
--- Low-level networking interfacessl
--- TLS/SSL wrapper for socket objectsselect
--- Waiting for I/O completionselectors
--- High-level I/O multiplexingasyncore
--- Asynchronous socket handlerasynchat
--- Asynchronous socket command/response handlersignal
--- Set handlers for asynchronous eventsmmap
--- Memory-mapped file support
- Penanganan Data Internet
email
--- Paket penanganan email dan MIMEjson
--- JSON encoder dan decodermailcap
--- Mailcap file handlingmailbox
--- Manipulate mailboxes in various formatsmimetypes
--- Map filenames to MIME typesbase64
--- Base16, Base32, Base64, Base85 Data Encodingsbinhex
--- Encode and decode binhex4 filesbinascii
--- Convert between binary and ASCIIquopri
--- Encode and decode MIME quoted-printable datauu
--- Encode and decode uuencode files
- Alat Pemroses Markup Terstruktur
html
--- Dukungan HyperText Markup Languagehtml.parser
--- Simple HTML and XHTML parserhtml.entities
--- Definisi entitas umum HTML- XML Processing Modules
xml.etree.ElementTree
--- The ElementTree XML APIxml.dom
--- The Document Object Model APIxml.dom.minidom
--- Minimal DOM implementationxml.dom.pulldom
--- Support for building partial DOM treesxml.sax
--- Support for SAX2 parsersxml.sax.handler
--- Base classes for SAX handlersxml.sax.saxutils
--- SAX Utilitiesxml.sax.xmlreader
--- Interface for XML parsersxml.parsers.expat
--- Fast XML parsing using Expat
- Protokol Internet dan Dukungan
webbrowser
--- Convenient Web-browser controllercgi
--- Common Gateway Interface supportcgitb
--- Traceback manager for CGI scriptswsgiref
--- WSGI Utilities and Reference Implementationurllib
--- Modul penanganan URLurllib.request
--- Extensible library for opening URLsurllib.response
--- Response classes used by urlliburllib.parse
--- Parse URLs into componentsurllib.error
--- Exception classes raised by urllib.requesturllib.robotparser
--- Parser for robots.txthttp
--- modul HTTPhttp.client
--- HTTP protocol clientftplib
--- FTP protocol clientpoplib
--- POP3 protocol clientimaplib
--- IMAP4 protocol clientnntplib
--- NNTP protocol clientsmtplib
--- SMTP protocol clientsmtpd
--- SMTP Servertelnetlib
--- Telnet clientuuid
--- UUID objects according to RFC 4122socketserver
--- A framework for network servershttp.server
--- HTTP servershttp.cookies
--- HTTP state managementhttp.cookiejar
--- Cookie handling for HTTP clientsxmlrpc
--- XMLRPC server and client modulesxmlrpc.client
--- akses klien XML-RPCxmlrpc.server
--- Basic XML-RPC serversipaddress
--- IPv4/IPv6 manipulation library
- Layanan Multimedia
audioop
--- Manipulate raw audio dataaifc
--- Read and write AIFF and AIFC filessunau
--- Read and write Sun AU fileswave
--- Read and write WAV fileschunk
--- Read IFF chunked datacolorsys
--- Conversions between color systemsimghdr
--- Determine the type of an imagesndhdr
--- Determine type of sound fileossaudiodev
--- Access to OSS-compatible audio devices
- Internasionalisasi
- Kerangka Program
- User Interfaces Grafis dengan Tk
- Alat Pengembangan
typing
--- Support for type hintspydoc
--- Documentation generator and online help systemdoctest
--- Contoh uji interaktif Pythonunittest
--- Unit testing frameworkunittest.mock
--- mock object libraryunittest.mock
--- getting started- 2to3 - Automated Python 2 to 3 code translation
test
--- Regression tests package for Pythontest.support
--- Utilities for the Python test suitetest.support.script_helper
--- Utilities for the Python execution tests
- Debugging dan Profiling
- Pengemasan dan Distribusi Perangkat Lunak
- Layanan Runtime Python
sys
--- System-specific parameters and functionssysconfig
--- Provide access to Python's configuration informationbuiltins
--- Objek-objek bawaan__main__
--- Lingkungan skrip tingkat ataswarnings
--- Warning controldataclasses
--- Data Classescontextlib
--- Utilities forwith
-statement contextsabc
--- Abstract Base Classesatexit
--- Exit handlerstraceback
--- Print or retrieve a stack traceback__future__
--- Future statement definitionsgc
--- Garbage Collector interfaceinspect
--- Inspect live objectssite
--- Site-specific configuration hook
- Ubahsuaian Interpreter Python
- Mengimpor Modul
- Layanan Bahasa Python
parser
--- Access Python parse treesast
--- Abstract Syntax Treessymtable
--- Access to the compiler's symbol tablessymbol
--- Constants used with Python parse treestoken
--- Konstanta digunakan dengan pohon pengurai (parse tree) Pythonkeyword
--- Pengujian untuk kata kunci Pythontokenize
--- Tokenizer for Python source- mod:tabnanny --- Deteksi indentasi ambigu
pyclbr
--- Python module browser supportpy_compile
--- Compile Python source filescompileall
--- Byte-compile Python librariesdis
--- Disassembler for Python bytecodepickletools
--- Tools for pickle developers
- Layanan Miscellaneous
- Layanan MS Windows Spesifik
- Layanan Khusus Unix
posix
--- The most common POSIX system callspwd
--- The password databasespwd
--- The shadow password databasegrp
--- The group databasecrypt
--- Function to check Unix passwordstermios
--- POSIX style tty controltty
--- Terminal control functionspty
--- Pseudo-terminal utilitiesfcntl
--- Thefcntl
andioctl
system callspipes
--- Interface to shell pipelinesresource
--- Resource usage informationnis
--- Interface to Sun's NIS (Yellow Pages)syslog
--- Unix syslog library routines
- Modul yang Diganti
- Undocumented Modules