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.
In addition to the standard library, there is a growing collection of several thousand components (from individual programs and modules to packages and entire application development frameworks), available from the Python Package Index.
- 1. Pengenalan
- 2. Fungsi Bawaan
- 3. Konstanta Bawaan
- 4. Tipe Bawaan
- 4.1. Pengujian Kebenaran Nilai
- 4.2. Boolean Operations ---
and
,or
,not
- 4.3. Perbandingan
- 4.4. Numeric Types ---
int
,float
,complex
- 4.5. Iterator Types
- 4.6. Sequence Types ---
list
,tuple
,range
- 4.7. Text Sequence Type ---
str
- 4.8. Binary Sequence Types ---
bytes
,bytearray
,memoryview
- 4.9. Set Types ---
set
,frozenset
- 4.10. Mapping Types ---
dict
- 4.11. Context Manager Types
- 4.12. Other Built-in Types
- 4.13. Atribut Spesial
- 5. Built-in Exceptions
- 6. Layanan Pemrosesan Teks
- 6.1.
string
--- Common string operations - 6.2.
re
--- Regular expression operations - 6.3.
difflib
--- Helpers for computing deltas - 6.4.
textwrap
--- Text wrapping and filling - 6.5.
unicodedata
--- Unicode Database - 6.6.
stringprep
--- Internet String Preparation - 6.7.
readline
--- GNU readline interface - 6.8.
rlcompleter
--- Completion function for GNU readline
- 6.1.
- 7. Binary Data Services
- 8. Tipe Data
- 8.1.
datetime
--- Basic date and time types - 8.2.
calendar
--- Fungsi-fungsi umum yang terkait dengan modul calendar - 8.3.
collections
--- Container datatypes - 8.4.
collections.abc
--- Abstract Base Classes for Containers - 8.5.
heapq
--- Heap queue algorithm - 8.6.
bisect
--- Array bisection algorithm - 8.7.
array
--- Efficient arrays of numeric values - 8.8.
weakref
--- Weak references - 8.9.
types
--- Dynamic type creation and names for built-in types - 8.10.
copy
--- Shallow and deep copy operations - 8.11.
pprint
--- Data pretty printer - 8.12.
reprlib
--- Alternaterepr()
implementation - 8.13.
enum
--- Support for enumerations
- 8.1.
- 9. Modul Numerik dan Matematika
- 9.1.
numbers
--- Numeric abstract base classes - 9.2.
math
--- Mathematical functions - 9.3.
cmath
--- Mathematical functions for complex numbers - 9.4.
decimal
--- Decimal fixed point and floating point arithmetic - 9.5.
fractions
--- Rational numbers - 9.6.
random
--- Generate pseudo-random numbers - 9.7.
statistics
--- Mathematical statistics functions
- 9.1.
- 10. Modul Pemrograman Fungsional
- 11. File and Directory Access
- 11.1.
pathlib
--- Object-oriented filesystem paths - 11.2.
os.path
--- Common pathname manipulations - 11.3.
fileinput
--- Iterate over lines from multiple input streams - 11.4.
stat
--- Interpretingstat()
results - 11.5.
filecmp
--- File and Directory Comparisons - 11.6.
tempfile
--- Generate temporary files and directories - 11.7.
glob
--- Unix style pathname pattern expansion - 11.8.
fnmatch
--- Unix filename pattern matching - 11.9.
linecache
--- Random access to text lines - 11.10.
shutil
--- High-level file operations - 11.11.
macpath
--- Mac OS 9 path manipulation functions
- 11.1.
- 12. Persistensi Data
- 13. Kompresi Data dan Pengarsipan
- 14. File Formats
- 15. Layanan Kriptografi
- 16. Layanan Sistem Operasi Generik
- 16.1.
os
--- Miscellaneous operating system interfaces - 16.2.
io
--- Core tools for working with streams - 16.3.
time
--- Akses waktu dan konversi - 16.4.
argparse
--- Parser for command-line options, arguments and sub-commands - 16.5.
getopt
--- C-style parser for command line options - 16.6.
logging
--- Logging facility for Python - 16.7.
logging.config
--- Logging configuration - 16.8.
logging.handlers
--- Logging handlers - 16.9.
getpass
--- Portable password input - 16.10.
curses
--- Terminal handling for character-cell displays - 16.11.
curses.textpad
--- Text input widget for curses programs - 16.12.
curses.ascii
--- Utilities for ASCII characters - 16.13.
curses.panel
--- A panel stack extension for curses - 16.14.
platform
--- Access to underlying platform's identifying data - 16.15.
errno
--- Standard errno system symbols - 16.16.
ctypes
--- A foreign function library for Python
- 16.1.
- 17. Eksekusi Serentak
- 17.1.
threading
--- Thread-based parallelism - 17.2.
multiprocessing
--- Process-based parallelism - 17.3. Paket
concurrent
- 17.4.
concurrent.futures
--- Launching parallel tasks - 17.5.
subprocess
--- Subprocess management - 17.6.
sched
--- Event scheduler - 17.7.
queue
--- A synchronized queue class - 17.8.
dummy_threading
--- Drop-in replacement for thethreading
module - 17.9.
_thread
--- Low-level threading API - 17.10.
_dummy_thread
--- Drop-in replacement for the_thread
module
- 17.1.
- 18. Interprocess Communication and Networking
- 18.1.
socket
--- Low-level networking interface - 18.2.
ssl
--- TLS/SSL wrapper for socket objects - 18.3.
select
--- Waiting for I/O completion - 18.4.
selectors
--- High-level I/O multiplexing - 18.5.
asyncio
--- Asynchronous I/O, event loop, coroutines and tasks - 18.6.
asyncore
--- Asynchronous socket handler - 18.7.
asynchat
--- Asynchronous socket command/response handler - 18.8.
signal
--- Set handlers for asynchronous events - 18.9.
mmap
--- Memory-mapped file support
- 18.1.
- 19. Penanganan Data Internet
- 19.1.
email
--- An email and MIME handling package - 19.2.
json
--- JSON encoder and decoder - 19.3.
mailcap
--- Mailcap file handling - 19.4.
mailbox
--- Manipulate mailboxes in various formats - 19.5.
mimetypes
--- Map filenames to MIME types - 19.6.
base64
--- Base16, Base32, Base64, Base85 Data Encodings - 19.7.
binhex
--- Encode and decode binhex4 files - 19.8.
binascii
--- Convert between binary and ASCII - 19.9.
quopri
--- Encode and decode MIME quoted-printable data - 19.10.
uu
--- Encode and decode uuencode files
- 19.1.
- 20. Structured Markup Processing Tools
- 20.1.
html
--- HyperText Markup Language support - 20.2.
html.parser
--- Simple HTML and XHTML parser - 20.3.
html.entities
--- Definisi entitas umum HTML - 20.4. XML Processing Modules
- 20.5.
xml.etree.ElementTree
--- The ElementTree XML API - 20.6.
xml.dom
--- The Document Object Model API - 20.7.
xml.dom.minidom
--- Minimal DOM implementation - 20.8.
xml.dom.pulldom
--- Support for building partial DOM trees - 20.9.
xml.sax
--- Support for SAX2 parsers - 20.10.
xml.sax.handler
--- Base classes for SAX handlers - 20.11.
xml.sax.saxutils
--- SAX Utilities - 20.12.
xml.sax.xmlreader
--- Interface for XML parsers - 20.13.
xml.parsers.expat
--- Fast XML parsing using Expat
- 20.1.
- 21. Protokol Internet dan Dukungan
- 21.1.
webbrowser
--- Convenient Web-browser controller - 21.2.
cgi
--- Common Gateway Interface support - 21.3.
cgitb
--- Traceback manager for CGI scripts - 21.4.
wsgiref
--- WSGI Utilities and Reference Implementation - 21.5.
urllib
--- URL handling modules - 21.6.
urllib.request
--- Extensible library for opening URLs - 21.7.
urllib.response
--- Response classes used by urllib - 21.8.
urllib.parse
--- Parse URLs into components - 21.9.
urllib.error
--- Exception classes raised by urllib.request - 21.10.
urllib.robotparser
--- Parser for robots.txt - 21.11.
http
--- modul HTTP - 21.12.
http.client
--- HTTP protocol client - 21.13.
ftplib
--- FTP protocol client - 21.14.
poplib
--- POP3 protocol client - 21.15.
imaplib
--- IMAP4 protocol client - 21.16.
nntplib
--- NNTP protocol client - 21.17.
smtplib
--- SMTP protocol client - 21.18.
smtpd
--- SMTP Server - 21.19.
telnetlib
--- Telnet client - 21.20.
uuid
--- UUID objects according to RFC 4122 - 21.21.
socketserver
--- A framework for network servers - 21.22.
http.server
--- HTTP servers - 21.23.
http.cookies
--- HTTP state management - 21.24.
http.cookiejar
--- Cookie handling for HTTP clients - 21.25.
xmlrpc
--- XMLRPC server and client modules - 21.26.
xmlrpc.client
--- akses klien XML-RPC - 21.27.
xmlrpc.server
--- Basic XML-RPC servers - 21.28.
ipaddress
--- IPv4/IPv6 manipulation library
- 21.1.
- 22. Layanan Multimedia
- 22.1.
audioop
--- Manipulate raw audio data - 22.2.
aifc
--- Read and write AIFF and AIFC files - 22.3.
sunau
--- Read and write Sun AU files - 22.4.
wave
--- Read and write WAV files - 22.5.
chunk
--- Read IFF chunked data - 22.6.
colorsys
--- Conversions between color systems - 22.7.
imghdr
--- Determine the type of an image - 22.8.
sndhdr
--- Determine type of sound file - 22.9.
ossaudiodev
--- Access to OSS-compatible audio devices
- 22.1.
- 23. Internasionalisasi
- 24. Kerangka Program
- 25. Graphical User Interfaces with Tk
- 26. Alat Pengembangan
- 26.1.
typing
--- Support for type hints - 26.2.
pydoc
--- Documentation generator and online help system - 26.3.
doctest
--- Test interactive Python examples - 26.4.
unittest
--- Unit testing framework - 26.5.
unittest.mock
--- mock object library - 26.6.
unittest.mock
--- getting started - 26.7. 2to3 - Automated Python 2 to 3 code translation
- 26.8.
test
--- Regression tests package for Python - 26.9.
test.support
--- Utilities for the Python test suite
- 26.1.
- 27. Debugging dan Profiling
- 27.1.
bdb
--- Debugger framework - 27.2.
faulthandler
--- Dump the Python traceback - 27.3.
pdb
--- The Python Debugger - 27.4. The Python Profilers
- 27.5.
timeit
--- Measure execution time of small code snippets - 27.6.
trace
--- Trace or track Python statement execution - 27.7.
tracemalloc
--- Trace memory allocations
- 27.1.
- 28. Pengemasan dan Distribusi Perangkat Lunak
- 29. Layanan Runtime Python
- 29.1.
sys
--- System-specific parameters and functions - 29.2.
sysconfig
--- Provide access to Python's configuration information - 29.3.
builtins
--- Objek-objek bawaan - 29.4.
__main__
--- Lingkungan skrip tingkat atas - 29.5.
warnings
--- Warning control - 29.6.
contextlib
--- Utilities forwith
-statement contexts - 29.7.
abc
--- Abstract Base Classes - 29.8.
atexit
--- Exit handlers - 29.9.
traceback
--- Print or retrieve a stack traceback - 29.10.
__future__
--- Future statement definitions - 29.11.
gc
--- Garbage Collector interface - 29.12.
inspect
--- Inspect live objects - 29.13.
site
--- Site-specific configuration hook - 29.14.
fpectl
--- Floating point exception control
- 29.1.
- 30. Ubahsuaian Interpreter Python
- 31. Mengimpor Modul
- 32. Layanan Bahasa Python
- 32.1.
parser
--- Access Python parse trees - 32.2.
ast
--- Abstract Syntax Trees - 32.3.
symtable
--- Access to the compiler's symbol tables - 32.4.
symbol
--- Constants used with Python parse trees - 32.5.
token
--- Konstanta digunakan dengan pohon pengurai (parse tree) Python - 32.6.
keyword
--- Pengujian untuk kata kunci Python - 32.7.
tokenize
--- Tokenizer for Python source - 32.8.
tabnanny
--- Detection of ambiguous indentation - 32.9.
pyclbr
--- Python class browser support - 32.10.
py_compile
--- Compile Python source files - 32.11.
compileall
--- Byte-compile Python libraries - 32.12.
dis
--- Disassembler for Python bytecode - 32.13.
pickletools
--- Tools for pickle developers
- 32.1.
- 33. Miscellaneous Services
- 34. MS Windows Specific Services
- 35. Layanan Khusus Unix
- 35.1.
posix
--- The most common POSIX system calls - 35.2.
pwd
--- The password database - 35.3.
spwd
--- The shadow password database - 35.4.
grp
--- The group database - 35.5.
crypt
--- Function to check Unix passwords - 35.6.
termios
--- POSIX style tty control - 35.7.
tty
--- Terminal control functions - 35.8.
pty
--- Pseudo-terminal utilities - 35.9.
fcntl
--- Thefcntl
andioctl
system calls - 35.10.
pipes
--- Interface to shell pipelines - 35.11.
resource
--- Resource usage information - 35.12.
nis
--- Interface to Sun's NIS (Yellow Pages) - 35.13.
syslog
--- Unix syslog library routines
- 35.1.
- 36. Superseded Modules
- 37. Undocumented Modules