Python 标准库非常庞大,所提供的组件涉及范围十分广泛,正如以下内容目录所显示的。这个库包含了多个内置模块 (以 C 编写),Python 程序员必须依靠它们来实现系统级功能,例如文件 I/O,此外还有大量以 Python 编写的模块,提供了日常编程中许多问题的标准解决方案。其中有些模块经过专门设计,通过将特定平台功能抽象化为平台中立的 API 来鼓励和加强 Python 程序的可移植性。

  • 概述

    • 可用性注释
  • 内置函数
  • 内置常量
    • 由 site 模块添加的常量
  • 内置类型
    • 逻辑值检测
    • 布尔运算 --- andornot
    • 比较
    • 数字类型 --- intfloatcomplex
    • 迭代器类型
    • 序列类型 --- listtuplerange
    • 文本序列类型 --- str
    • 二进制序列类型 --- bytesbytearraymemoryview
    • 集合类型 --- setfrozenset
    • 映射类型 --- dict
    • 上下文管理器类型
    • 其他内置类型
    • 特殊属性
  • 内置异常
    • 基类
    • 具体异常
    • 警告
    • 异常层次结构
  • 文本处理服务
    • string --- 常见的字符串操作
    • re --- 正则表达式操作
    • difflib --- 计算差异的辅助工具
    • textwrap --- 文本自动换行与填充
    • unicodedata --- Unicode 数据库
    • stringprep --- 因特网字符串预备
    • readline --- GNU readline 接口
    • rlcompleter --- GNU readline 的补全函数
  • 二进制数据服务
    • struct --- 将字节串解读为打包的二进制数据
    • codecs --- 编解码器注册和相关基类
  • 数据类型
    • datetime --- 基本的日期和时间类型
    • calendar --- 日历相关函数
    • collections --- 容器数据类型
    • collections.abc --- 容器的抽象基类
    • heapq --- 堆队列算法
    • bisect --- 数组二分查找算法
    • array --- 高效的数值数组
    • weakref --- 弱引用
    • types --- 动态类型创建和内置类型名称
    • copy --- 浅层 (shallow) 和深层 (deep) 复制操作
    • pprint --- 数据美化输出
    • reprlib --- 另一种 repr() 实现
    • enum --- 对枚举的支持
  • 数字和数学模块
    • numbers --- 数字的抽象基类
    • math --- 数学函数
    • cmath --- 关于复数的数学函数
    • decimal --- 十进制定点和浮点运算
    • fractions --- 分数
    • random --- 生成伪随机数
    • statistics --- 数学统计函数
  • 函数式编程模块
    • itertools --- 为高效循环而创建迭代器的函数
    • functools --- 高阶函数和可调用对象上的操作
    • operator --- 标准运算符替代函数
  • 文件和目录访问
    • pathlib --- 面向对象的文件系统路径
    • os.path --- 常用路径操作
    • fileinput --- Iterate over lines from multiple input streams
    • stat --- Interpreting stat() results
    • filecmp --- 文件及目录的比较
    • tempfile --- 生成临时文件和目录
    • glob --- Unix style pathname pattern expansion
    • fnmatch --- Unix 文件名模式匹配
    • linecache --- 随机读写文本行
    • shutil --- 高阶文件操作
  • 数据持久化
    • pickle --- Python 对象序列化
    • copyreg --- 注意 pickle 支持函数
    • shelve --- Python object persistence
    • marshal --- Internal Python object serialization
    • dbm --- Interfaces to Unix "databases"
    • sqlite3 --- SQLite 数据库 DB-API 2.0 接口模块
  • 数据压缩和存档
    • zlib --- 与 gzip 兼容的压缩
    • gzip --- 对 gzip 格式的支持
    • bz2 --- 对 bzip2 压缩算法的支持
    • lzma --- 用 LZMA 算法压缩
    • zipfile --- 使用ZIP存档
    • tarfile --- 读写tar归档文件
  • 文件格式
    • csv --- CSV 文件读写
    • configparser --- Configuration file parser
    • netrc --- netrc file processing
    • xdrlib --- Encode and decode XDR data
    • plistlib --- Generate and parse Mac OS X .plist files
  • 加密服务
    • hashlib --- 安全哈希与消息摘要
    • hmac --- 基于密钥的消息验证
    • secrets --- Generate secure random numbers for managing secrets
  • 通用操作系统服务
    • os --- 各种各样的操作系统接口
    • io --- 处理流的核心工具
    • time --- 时间的访问和转换
    • argparse --- 命令行选项、参数和子命令解析器
    • getopt --- C-style parser for command line options
    • logging --- Python 的日志记录工具
    • logging.config --- 日志记录配置
    • logging.handlers --- 日志处理
    • getpass --- 便携式密码输入工具
    • curses --- 终端字符单元显示的处理
    • curses.textpad --- Text input widget for curses programs
    • curses.ascii --- Utilities for ASCII characters
    • curses.panel --- A panel stack extension for curses
    • platform --- 获取底层平台的标识数据
    • errno --- Standard errno system symbols
    • ctypes --- Python 的外部函数库
  • 并发执行
    • threading --- 基于线程的并行
    • multiprocessing --- 基于进程的并行
    • multiprocessing.shared_memory --- 可从进程直接访问的共享内存
    • concurrent 包
    • concurrent.futures --- 启动并行任务
    • subprocess --- 子进程管理
    • sched --- 事件调度器
    • queue --- 一个同步的队列类
    • _thread --- 底层多线程 API
    • _dummy_thread --- _thread 的替代模块
    • dummy_threading --- 可直接替代 threading 模块。
  • contextvars --- Context Variables
    • Context Variables
    • Manual Context Management
    • asyncio support
  • 网络和进程间通信
    • asyncio --- 异步 I/O
    • socket --- 底层网络接口
    • ssl --- TLS/SSL wrapper for socket objects
    • select --- 等待 I/O 完成
    • selectors --- 高级 I/O 复用库
    • asyncore --- 异步socket处理器
    • asynchat --- 异步 socket 指令/响应 处理器
    • signal --- 设置异步事件处理程序
    • mmap --- 内存映射文件支持
  • 互联网数据处理
    • email --- 电子邮件与 MIME 处理包
    • json --- JSON 编码和解码器
    • mailcap --- Mailcap file handling
    • mailbox --- Manipulate mailboxes in various formats
    • mimetypes --- Map filenames to MIME types
    • base64 --- Base16, Base32, Base64, Base85 数据编码
    • binhex --- 对binhex4文件进行编码和解码
    • binascii --- 二进制和 ASCII 码互转
    • quopri --- 编码与解码经过 MIME 转码的可打印数据
    • uu --- 对 uuencode 文件进行编码与解码
  • 结构化标记处理工具
    • html --- 超文本标记语言支持
    • html.parser --- 简单的 HTML 和 XHTML 解析器
    • html.entities --- HTML 一般实体的定义
    • XML处理模块
    • xml.etree.ElementTree --- ElementTree XML API
    • xml.dom --- The Document Object Model API
    • xml.dom.minidom --- Minimal DOM implementation
    • xml.dom.pulldom --- Support for building partial DOM trees
    • xml.sax --- Support for SAX2 parsers
    • xml.sax.handler --- Base classes for SAX handlers
    • xml.sax.saxutils --- SAX Utilities
    • xml.sax.xmlreader --- Interface for XML parsers
    • xml.parsers.expat --- Fast XML parsing using Expat
  • 互联网协议和支持
    • webbrowser --- 方便的Web浏览器控制器
    • cgi --- Common Gateway Interface support
    • cgitb --- 用于 CGI 脚本的回溯管理器
    • wsgiref --- WSGI Utilities and Reference Implementation
    • urllib --- URL 处理模块
    • urllib.request --- 用于打开 URL 的可扩展库
    • urllib.response --- urllib 使用的 Response 类
    • urllib.parse --- Parse URLs into components
    • urllib.error --- urllib.request 引发的异常类
    • urllib.robotparser --- robots.txt 语法分析程序
    • http --- HTTP 模块
    • http.client --- HTTP 协议客户端
    • ftplib --- FTP 协议客户端
    • poplib --- POP3 protocol client
    • imaplib --- IMAP4 protocol client
    • nntplib --- NNTP protocol client
    • smtplib ---SMTP协议客户端
    • smtpd --- SMTP 服务器
    • telnetlib --- Telnet client
    • uuid --- UUID objects according to RFC 4122
    • socketserver --- A framework for network servers
    • http.server --- HTTP 服务器
    • http.cookies --- HTTP状态管理
    • http.cookiejar —— HTTP 客户端的 Cookie 处理
    • xmlrpc --- XMLRPC 服务端与客户端模块
    • xmlrpc.client --- XML-RPC client access
    • xmlrpc.server --- Basic XML-RPC servers
    • ipaddress --- IPv4/IPv6 manipulation library
  • 多媒体服务
    • audioop --- Manipulate raw audio data
    • aifc --- Read and write AIFF and AIFC files
    • sunau --- 读写 Sun AU 文件
    • wave --- 读写WAV格式文件
    • chunk --- Read IFF chunked data
    • colorsys --- 颜色系统间的转换
    • imghdr --- 推测图像类型
    • sndhdr --- 推测声音文件的类型
    • ossaudiodev --- Access to OSS-compatible audio devices
  • 国际化
    • gettext --- 多语种国际化服务
    • locale --- 国际化服务
  • 程序框架
    • turtle --- 海龟绘图
    • cmd --- 支持面向行的命令解释器
    • shlex --- Simple lexical analysis
  • Tk图形用户界面(GUI)
    • tkinter --- Tcl/Tk的Python接口
    • tkinter.ttk --- Tk主题小部件
    • tkinter.tix --- Extension widgets for Tk
    • tkinter.scrolledtext --- 滚动文字控件
    • IDLE
    • 其他图形用户界面(GUI)包
  • 开发工具
    • typing --- 类型标注支持
    • pydoc --- Documentation generator and online help system
    • doctest --- 测试交互性的Python示例
    • unittest --- 单元测试框架
    • unittest.mock --- mock对象库
    • unittest.mock 上手指南
    • 2to3 - 自动将 Python 2 代码转为 Python 3 代码
    • test --- Regression tests package for Python
    • test.support --- Utilities for the Python test suite
    • test.support.script_helper --- Utilities for the Python execution tests
  • 调试和分析
    • 审核事件表
    • bdb --- Debugger framework
    • faulthandler --- Dump the Python traceback
    • pdb --- Python的调试器
    • Python Profilers 分析器
    • timeit --- 测量小代码片段的执行时间
    • trace --- Trace or track Python statement execution
    • tracemalloc --- 跟踪内存分配
  • 软件打包和分发
    • distutils --- 构建和安装 Python 模块
    • ensurepip --- Bootstrapping the pip installer
    • venv --- 创建虚拟环境
    • zipapp --- Manage executable Python zip archives
  • Python运行时服务
    • sys --- 系统相关的参数和函数
    • sysconfig --- Provide access to Python's configuration information
    • builtins --- 内建对象
    • __main__ --- 顶层脚本环境
    • warnings --- Warning control
    • dataclasses --- 数据类
    • contextlib --- Utilities for with-statement contexts
    • abc --- 抽象基类
    • atexit --- 退出处理器
    • traceback --- 打印或检索堆栈回溯
    • __future__ --- Future 语句定义
    • gc --- 垃圾回收器接口
    • inspect --- 检查对象
    • site --- Site-specific configuration hook
  • 自定义 Python 解释器
    • code --- 解释器基类
    • codeop --- 编译Python代码
  • 导入模块
    • zipimport --- Import modules from Zip archives
    • pkgutil --- Package extension utility
    • modulefinder --- 查找脚本使用的模块
    • runpy --- Locating and executing Python modules
    • importlib --- import 的实现
    • Using importlib.metadata
  • Python 语言服务
    • parser --- Access Python parse trees
    • ast --- 抽象语法树
    • symtable --- Access to the compiler's symbol tables
    • symbol --- 与 Python 解析树一起使用的常量
    • token --- 与Python解析树一起使用的常量
    • keyword --- 检验Python关键字
    • tokenize --- Tokenizer for Python source
    • tabnanny --- 模糊缩进检测
    • pyclbr --- Python class browser support
    • py_compile --- Compile Python source files
    • compileall --- Byte-compile Python libraries
    • dis --- Python 字节码反汇编器
    • pickletools --- Tools for pickle developers
  • 杂项服务
    • formatter --- Generic output formatting
  • Windows系统相关模块
    • msilib --- Read and write Microsoft Installer files
    • msvcrt --- Useful routines from the MS VC++ runtime
    • winreg --- Windows 注册表访问
    • winsound --- Sound-playing interface for Windows
  • Unix 专有服务
    • posix --- The most common POSIX system calls
    • pwd --- 用户密码数据库
    • spwd --- The shadow password database
    • grp --- The group database
    • crypt --- Function to check Unix passwords
    • termios --- POSIX style tty control
    • tty --- 终端控制功能
    • pty --- Pseudo-terminal utilities
    • fcntl --- The fcntl and ioctl system calls
    • pipes --- Interface to shell pipelines
    • resource --- Resource usage information
    • nis --- Interface to Sun's NIS (Yellow Pages)
    • Unix syslog 库例程
  • 被取代的模块
    • optparse --- 解析器的命令行选项
    • imp --- Access the import internals
  • 未创建文档的模块
    • 平台特定模块

Python 标准库 API参考文档相关推荐

  1. dita文档_使用DITADoclet和DITA API专业化生成DITA Java™API参考文档

    dita文档 2009年12月11日修订说明:在" 目标"和" 安装org.dita.dost插件 "标题下添加了两个指向可下载资源的链接. 2014年3月7日 ...

  2. python 操作mongodb数据库参考文档

    参考文档链接:https://pypi.python.org/pypi/pymongo pymongo的参考文档http://api.mongodb.com/python/current/tutori ...

  3. xwiki开发者指南-XWiki API 参考文档

    XWiki开发团队考虑到安全使用(即,保证后向兼容性).我们可以从Java或直接从wiki页面使用一个脚本语言 (Velocity, Groovy, Python, Ruby等)调用API. 作为XW ...

  4. Google Weather API 参考文档

    基础篇     首先是如何调用Google Weather API,如果你在Google里搜索能够搜索出以下的内容,但是完全没有原始来源,看上去是很简单,说明也还算详细.    1.邮政编码法:(只支 ...

  5. AutoCAD二次开发2-.NET API参考文档

    AutoCAD .NET API中有许多不同类型的对象.例如: 图形对象,例如直线,圆弧,文本和尺寸 样式设置,例如文本和尺寸样式 组织结构,例如层,组和块 工程图显示,例如视图和视口 图纸及应用 h ...

  6. 微信开放平台提供什么服务器,微信开放平台:朋友圈API参考文档

    POST /timeline URL: https://api.weixin.qq.com/timeline.format 参数列表 参数含义 content_type 指定消息的类型,必填,目前支持 ...

  7. Python 参考文档

    Python 参考文档 笔者在学习 Python ,查找相关资料时觉得比较有用的参考文档,将持续更新- python 官方文档 简明 Python 教程 PyCharm(2018.2)专业版破解PyC ...

  8. 不在以下合法域名列表中,请参考文档:https://mp.weixin.qq.com/debug/wxadoc/dev/api/network-request.html

    出现"不在以下合法域名列表中,请参考文档:https://mp.weixin.qq.com/debug/wxadoc/dev/api/network-request.html"这种 ...

  9. 彻底弄懂Python标准库源码(一)—— os模块

    目录 第1~22行 模块整体注释.nt与posix 第24~46行 模块引入._exists方法._get_exports_list方法 第48~97行 根据系统不同导入不同的方法和属性 第100~1 ...

  10. hibernate参考文档

    http://docs.jboss.org/hibernate/annotations/3.4/reference/zh_cn/html_single/#d0e224 Hibernate Annota ...

最新文章

  1. 如何开启mysql的慢日志_mysql如何开启慢查询日志?
  2. 含根式的定积分计算_不定积分计算法则总结
  3. [洛谷P4012] [网络流24题] 深海机器人问题
  4. javascript作用域容易记错的两个地方
  5. 列出所有K个元素的子集-----2013年1月26日
  6. 说说我最近比较迷的Criminal Minds
  7. 学计算机的一开学叫要带电脑吗,大一新生开学需要带电脑吗?辅导员给出建议,学生需提前了解...
  8. java数组数据结构_Java数据结构之数组
  9. Android开发笔记(一百七十六)借助FileProvider发送彩信
  10. xp升级windows7_微软大升级!Windows系统电脑将告别杀毒软件
  11. python爬楼梯算法_Python算法:如何解决楼梯台阶问题
  12. html5 ogv格式转换,ffmpeg – Mac上的HTML5视频OGV转换
  13. SQL Server之创建数据库和表
  14. 详述win10下配置tensorflow-gpu
  15. opencv c++实现棋盘格标定
  16. 【Torch】Dataloader torch.utils.data.DataLoader全面详实概念理解
  17. 数字图像处理之目标颜色识别
  18. Ser232Mon免费串口监视
  19. python 数据分类汇总_python对Excel分类汇总
  20. 从To C到To B、To G,多多云科技如何实现转型

热门文章

  1. UWB定位/RSSI定位 三边测量法trilateration C语言代码详解
  2. 多种矿石混合的抗干扰矿石对讲机
  3. Inno Setup 简体中文语言包
  4. 5款App帮你创建时间轴
  5. OSPF开销值、协议优先级及计时器的修改
  6. 【NISP一级】6.3 社会工程学攻击
  7. 删除oracle安装目录,Oracle 卸载
  8. 清华计算机科学技术复试2018,2018清华大学计算机科学与技术系考研复试名单
  9. Expo大作战(四十一)【完】--expo sdk 之 Assets,BarCodeScanner,AppLoading
  10. 热敏电阻(NTC)的作用