
Python :: Справочник
Наш справочник по языку программирования
Python содержит быстрые ссылки на основные разделы официального справочника, а также руководства и документации. Кроме того, в справочнике представлен каталог наиболее
популярных фреймворков, расширений и библиотек, а также других ресурсов, которые могут быть полезны python-программистам.
Почитать онлайн или скачать всю документацию нужной версии Python можно на официальной странице перейдя по ссылке здесь, а загрузить необходимую версию интерпретатора здесь.
Оглавление
Справочник языка
-
1. Introduction
- 1.1. Alternate Implementations
- 1.2. Notation
-
2. Lexical analysis
- 2.1. Line structure
- 2.2. Other tokens
- 2.3. Identifiers and keywords
- 2.4. Literals
- 2.5. Operators
- 2.6. Delimiters
-
3. Data model
- 3.1. Objects, values and types
- 3.2. The standard type hierarchy
- 3.3. Special method names
- 3.4. Coroutines
-
4. Execution model
- 4.1. Structure of a program
- 4.2. Naming and binding
- 4.3. Exceptions
-
5. The import system
- 5.1. importlib
- 5.2. Packages
- 5.3. Searching
- 5.4. Loading
- 5.5. The Path Based Finder
- 5.6. Replacing the standard import system
- 5.7. Package Relative Imports
- 5.8. Special considerations for __main__
- 5.9. Open issues
- 5.10. References
-
6. Expressions
- 6.1. Arithmetic conversions
- 6.2. Atoms
- 6.3. Primaries
- 6.4. Await expression
- 6.5. The power operator
- 6.6. Unary arithmetic and bitwise operations
- 6.7. Binary arithmetic operations
- 6.8. Shifting operations
- 6.9. Binary bitwise operations
- 6.10. Comparisons
- 6.11. Boolean operations
- 6.12. Assignment expressions
- 6.13. Conditional expressions
- 6.14. Lambdas
- 6.15. Expression lists
- 6.16. Evaluation order
- 6.17. Operator precedence
-
7. Simple statements
- 7.1. Expression statements
- 7.2. Assignment statements
- 7.3. The assert statement
- 7.4. The pass statement
- 7.5. The del statement
- 7.6. The return statement
- 7.7. The yield statement
- 7.8. The raise statement
- 7.9. The break statement
- 7.10. The continue statement
- 7.11. The import statement
- 7.12. The global statement
- 7.13. The nonlocal statement
-
8. Compound statements
- 8.1. The if statement
- 8.2. The while statement
- 8.3. The for statement
- 8.4. The try statement
- 8.5. The with statement
- 8.6. The match statement
- 8.7. Function definitions
- 8.8. Class definitions
- 8.9. Coroutines
-
9. Top-level components
- 9.1. Complete Python programs
- 9.2. File input
- 9.3. Interactive input
- 9.4. Expression input
- 10. Full Grammar specification
Стандартная библиотека
- Introduction
- Built-in Functions
- Built-in Constants
-
Built-in Types
- Truth Value Testing
- Boolean Operations — and, or, not
- Comparisons
- 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
- Type Annotation Types — Generic Alias, Union
- Other Built-in Types
- Special Attributes
- Integer string conversion length limitation
- Built-in Exceptions
-
Text Processing Services
- string — Common string operations
- re — Regular expression operations
- difflib — Helpers for computing deltas
- textwrap — Text wrapping and filling
- unicodedata — Unicode Database
- stringprep — Internet String Preparation
- readline — GNU readline interface
- rlcompleter — Completion function for GNU readline
- Binary Data Services
-
Data Types
- datetime — Basic date and time types
- zoneinfo — IANA time zone support
- calendar — General calendar-related functions
- collections — Container datatypes
- collections.abc — Abstract Base Classes for Containers
- heapq — Heap queue algorithm
- bisect — Array bisection algorithm
- array — Efficient arrays of numeric values
- weakref — Weak references
- types — Dynamic type creation and names for built-in types
- copy — Shallow and deep copy operations
- pprint — Data pretty printer
- reprlib — Alternate repr() implementation
- enum — Support for enumerations
- graphlib — Functionality to operate with graph-like structures
- Numeric and Mathematical Modules
- Functional Programming Modules
-
File and Directory Access
- pathlib — Object-oriented filesystem paths
- os.path — Common pathname manipulations
- fileinput — Iterate over lines from multiple input streams
- stat — Interpreting stat() results
- filecmp — File and Directory Comparisons
- tempfile — Generate temporary files and directories
- glob — Unix style pathname pattern expansion
- fnmatch — Unix filename pattern matching
- linecache — Random access to text lines
- shutil — High-level file operations
- Data Persistence
- Data Compression and Archiving
- File Formats
- Cryptographic Services
-
Generic Operating System Services
- os — Miscellaneous operating system interfaces
- io — Core tools for working with streams
- time — Time access and conversions
- argparse — Parser for command-line options, arguments and sub-commands
- getopt — C-style parser for command line options
- logging — Logging facility for Python
- logging.config — Logging configuration
- logging.handlers — Logging handlers
- getpass — Portable password input
- curses — Terminal handling for character-cell displays
- curses.textpad — Text input widget for curses programs
- curses.ascii — Utilities for ASCII characters
- curses.panel — A panel stack extension for curses
- platform — Access to underlying platform’s identifying data
- errno — Standard errno system symbols
- ctypes — A foreign function library for Python
-
Concurrent Execution
- threading — Thread-based parallelism
- multiprocessing — Process-based parallelism
- multiprocessing.shared_memory — Shared memory for direct access across processes
- The concurrent package
- concurrent.futures — Launching parallel tasks
- subprocess — Subprocess management
- sched — Event scheduler
- queue — A synchronized queue class
- contextvars — Context Variables
- _thread — Low-level threading API
- Networking and Interprocess Communication
-
Internet Data Handling
- email — An email and MIME handling package
- json — JSON encoder and decoder
- mailbox — Manipulate mailboxes in various formats
- mimetypes — Map filenames to MIME types
- base64 — Base16, Base32, Base64, Base85 Data Encodings
- binhex — Encode and decode binhex4 files
- binascii — Convert between binary and ASCII
- quopri — Encode and decode MIME quoted-printable data
-
Structured Markup Processing Tools
- html — HyperText Markup Language support
- html.parser — Simple HTML and XHTML parser
- html.entities — Definitions of HTML general entities
- XML Processing Modules
- xml.etree.ElementTree — The 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
-
Internet Protocols and Support
- webbrowser — Convenient web-browser controller
- wsgiref — WSGI Utilities and Reference Implementation
- urllib — URL handling modules
- urllib.request — Extensible library for opening URLs
- urllib.response — Response classes used by urllib
- urllib.parse — Parse URLs into components
- urllib.error — Exception classes raised by urllib.request
- urllib.robotparser — Parser for robots.txt
- http — HTTP modules
- http.client — HTTP protocol client
- ftplib — FTP protocol client
- poplib — POP3 protocol client
- imaplib — IMAP4 protocol client
- smtplib — SMTP protocol client
- uuid — UUID objects according to RFC 4122
- socketserver — A framework for network servers
- http.server — HTTP servers
- http.cookies — HTTP state management
- http.cookiejar — Cookie handling for HTTP clients
- xmlrpc — XMLRPC server and client modules
- xmlrpc.client — XML-RPC client access
- xmlrpc.server — Basic XML-RPC servers
- ipaddress — IPv4/IPv6 manipulation library
- Multimedia Services
- Internationalization
- Program Frameworks
-
Graphical User Interfaces with Tk
- tkinter — Python interface to Tcl/Tk
- tkinter.colorchooser — Color choosing dialog
- tkinter.font — Tkinter font wrapper
- Tkinter Dialogs
- tkinter.messagebox — Tkinter message prompts
- tkinter.scrolledtext — Scrolled Text Widget
- tkinter.dnd — Drag and drop support
- tkinter.ttk — Tk themed widgets
- tkinter.tix — Extension widgets for Tk
- IDLE
-
Development Tools
- typing — Support for type hints
- pydoc — Documentation generator and online help system
- Python Development Mode
- Effects of the Python Development Mode
- ResourceWarning Example
- Bad file descriptor error example
- doctest — Test interactive Python examples
- unittest — Unit testing framework
- unittest.mock — mock object library
- unittest.mock — getting started
- 2to3 — Automated Python 2 to 3 code translation
- test — Regression tests package for Python
- test.support — Utilities for the Python test suite
- test.support.socket_helper — Utilities for socket tests
- test.support.script_helper — Utilities for the Python execution tests
- test.support.bytecode_helper — Support tools for testing correct bytecode generation
- test.support.threading_helper — Utilities for threading tests
- test.support.os_helper — Utilities for os tests
- test.support.import_helper — Utilities for import tests
- test.support.warnings_helper — Utilities for warnings tests
- Debugging and Profiling
- Software Packaging and Distribution
-
Python Runtime Services
- sys — System-specific parameters and functions
- sysconfig — Provide access to Python’s configuration information
- builtins — Built-in objects
- __main__ — Top-level code environment
- warnings — Warning control
- dataclasses — Data Classes
- contextlib — Utilities for with-statement contexts
- abc — Abstract Base Classes
- atexit — Exit handlers
- traceback — Print or retrieve a stack traceback
- __future__ — Future statement definitions
- gc — Garbage Collector interface
- inspect — Inspect live objects
- site — Site-specific configuration hook
- Custom Python Interpreters
- Importing Modules
-
Python Language Services
- ast — Abstract Syntax Trees
- symtable — Access to the compiler’s symbol tables
- token — Constants used with Python parse trees
- keyword — Testing for Python keywords
- tokenize — Tokenizer for Python source
- tabnanny — Detection of ambiguous indentation
- pyclbr — Python module browser support
- py_compile — Compile Python source files
- compileall — Byte-compile Python libraries
- dis — Disassembler for Python bytecode
- pickletools — Tools for pickle developers
- MS Windows Specific Services
-
Unix Specific Services
- posix — The most common POSIX system calls
- pwd — The password database
- grp — The group database
- termios — POSIX style tty control
- tty — Terminal control functions
- pty — Pseudo-terminal utilities
- fcntl — The fcntl and ioctl system calls
- resource — Resource usage information
- syslog — Unix syslog library routines
-
Superseded Modules
- aifc — Read and write AIFF and AIFC files
- asynchat — Asynchronous socket command/response handler
- asyncore — Asynchronous socket handler
- audioop — Manipulate raw audio data
- cgi — Common Gateway Interface support
- cgitb — Traceback manager for CGI scripts
- chunk — Read IFF chunked data
- crypt — Function to check Unix passwords
- imghdr — Determine the type of an image
- imp — Access the import internals
- mailcap — Mailcap file handling
- msilib — Read and write Microsoft Installer files
- nis — Interface to Sun’s NIS (Yellow Pages)
- nntplib — NNTP protocol client
- optparse — Parser for command line options
- ossaudiodev — Access to OSS-compatible audio devices
- pipes — Interface to shell pipelines
- smtpd — SMTP Server
- sndhdr — Determine type of sound file
- spwd — The shadow password database
- sunau — Read and write Sun AU files
- telnetlib — Telnet client
- uu — Encode and decode uuencode files
- xdrlib — Encode and decode XDR data
- Security Considerations
Фреймворки и библиотеки
- Фреймворк для веб-приложений Django
- Микрофреймворк для веб-приложений Flask
- Асинхронный фреймворк для веб-приложений Tornado
- Графический интерфейс пользователя PySide
- Графический интерфейс пользователя wxPython
- Графический интерфейс пользователя Kivy
- Библиотека обработки графики Python Pillow
- Библиотека обработки 2D-графики PyCairo
- Библиотека обработки графики scikit-image
- Библиотека обработки многомерных массивов NumPy
- Библиотека визуализации данных Matplotlib
- Библиотека визуализации данных Plotly
- Библиотека для научных расчетов SciPy
- Библиотека обработки и анализа данных Pandas
- Библиотека для машинного обучения Scikit Learn
- Библиотека для машинного обучения TensorFlow
- Открытая нейросетевая библиотека Keras
- Библиотека компьютерного зрения OpenCV

Фреймворк для веб-приложений Django
Django (в рус. Джанго) – свободный фреймворк для веб-приложений на языке Python, использующий шаблон проектирования MVC.
Официальный сайт: https://www.djangoproject.com
Документация: https://docs.djangoproject.com/en/3.2/
Документация на русском: https://django.fun/ru/docs/django/4.0/
Имя для менеджера пакетов pip: «django».
Микрофреймворк для веб-приложений Flask
Flask – свободный микрофреймворк для создания веб-приложений на языке программирования Python, использующий набор инструментов Werkzeug, а также шаблон проектирования Jinja2.
Официальный сайт: https://palletsprojects.com/p/flask/
Документация: https://flask.palletsprojects.com/en/2.0.x/
Документация на русском: https://flask-russian-docs.readthedocs.io/ru/latest/
Имя для менеджера пакетов pip: «flask».
Асинхронный фреймворк для веб-приложений Tornado
Tornado – расширяемый, неблокирующий веб-сервер и фреймворк, написанный на Python. Данный асинхронный фреймворк способен одновременно поддерживать множество пользовательских соединений в течение длительного времени.
Официальный сайт: https://www.tornadoweb.org/en/stable/
Документация: https://readthedocs.org/projects/tornado/downloads/
Имя для менеджера пакетов pip: «tornado».
Графический интерфейс пользователя PySide
PySide – привязка языка Python к инструментарию Qt, совместимая на уровне API с PyQt. В отличие от PyQt, PySide доступна для свободного использования как в открытых, так и закрытых, в частности, коммерческих проектах, поскольку лицензирована по LGPL. PySide поддерживает платформы: Linux, macOS и Windows.
Оф. сайт и документация: https://www.qt.io/qt-for-python
Руководство: https://doc.qt.io/qtforpython/tutorials/index.html
Пособие для начинающих: https://zetcode.com/gui/pysidetutorial/
Имя для менеджера пакетов pip: «pyside6».
Графический интерфейс пользователя wxPython
wxPython – удобная обёртка библиотеки кроссплатформенного графического интерфейса пользователя для Python. wxPython поддерживает платформы: Linux, macOS, Windows.
Официальный сайт: https://wxpython.org
Документация: https://docs.wxpython.org
Пособие для начинающих: https://zetcode.com/wxpython/
Имя для менеджера пакетов pip: «wxpython».
Графический интерфейс пользователя Kivy
Kivy – графический фреймворк на Python с открытым исходным кодом для быстрой разработки мобильных и других приложений, использующих инновационные пользовательские интерфейсы, такие как мультитач-приложения. Kivy поддерживает платформы: Linux, macOS, Windows, Android, iOS и Raspberry Pi.
Официальный сайт: https://kivy.org
Документация: https://kivy.org/doc/stable/
Имя для менеджера пакетов pip: «kivy».
Библиотека обработки графики Python Pillow
Python Pillow (от англ. Python Imaging Library) – форк, принятый на замену оригинальной библиотеки PIL языка Python для работы с растровой графикой.
Официальный сайт: https://python-pillow.org
Документация: https://pillow.readthedocs.io/en/stable/
Имя для менеджера пакетов pip: «pillow».
Библиотека обработки 2D-графики PyCairo
PyCairo – набор привязок python-кода для популярной графической библиотеки Cairo, которая предназначена для обработки векторной 2D-графики.
Официальный сайт: https://www.cairographics.org
Документация: https://www.cairographics.org/documentation/
Имя для менеджера пакетов pip: «pycairo».
Библиотека обработки графики scikit-image
scikit-image – это библиотека обработки изображений с открытым исходным кодом для языка программирования Python. Она реализует алгоритмы и утилиты для использования в исследовательских, образовательных и промышленных приложениях.
Официальный сайт: https://scikit-image.org
Документация: https://scikit-image.org/docs/stable/
Имя для менеджера пакетов pip: «scikit-image».
Библиотека обработки многомерных массивов NumPy
NumPy (от англ. Numerical Python) – библиотека с открытым исходным кодом для языка программирования Python, которая обеспечивает поддержку многомерных массивов (включая матрицы) и высокоуровневых математических функций, предназначенных для работы с многомерными массивами.
Официальный сайт: https://numpy.org
Документация: https://numpy.org/doc/stable/contents.html
Имя для менеджера пакетов pip: «numpy».
Библиотека визуализации данных Matplotlib
Matplotlib – библиотека на языке программирования Python, предназначенная для визуализации данных двумерной и трехмерной графикой. Получаемые изображения могут быть использованы в качестве иллюстраций в публикациях.
Официальный сайт: https://matplotlib.org/stable/index.html
Документация: https://matplotlib.org/stable/contents.html
Имя для менеджера пакетов pip: «matplotlib».
Библиотека визуализации данных Plotly
Plotly – графическая онлайн-библиотека, предназначенная для интерактивной визуализации данных.
Официальный сайт: https://plotly.com
Документация: https://plotly.com/python/
Имя для менеджера пакетов pip: «plotly».
Библиотека для научных расчетов SciPy
SciPy – это библиотека для языка программирования Python с открытым исходным кодом, предназначенная для выполнения научных и инженерных расчётов.
Официальный сайт: https://scipy.org
Документация: https://docs.scipy.org/doc/scipy/
Имя для менеджера пакетов pip: «scipy».
Библиотека обработки и анализа данных Pandas
Pandas – это программная библиотека на языке Python для обработки и анализа данных.
Официальный сайт: https://pandas.pydata.org
Документация: https://pandas.pydata.org/docs/
Имя для менеджера пакетов pip: «pandas».
Библиотека для машинного обучения Scikit Learn
Scikit Learn – это бесплатная библиотека машинного обучения для языка программирования Python.
Официальный сайт: https://scikit-learn.org/stable/
Имя для менеджера пакетов pip: «scikit-learn».
Библиотека для машинного обучения TensorFlow
TensorFlow – открытая программная библиотека для машинного обучения, разработанная компанией Google для решения задач построения и тренировки нейронной сети с целью автоматического нахождения и классификации образов, достигая качества человеческого восприятия.
Официальный сайт: https://www.tensorflow.org
Имя для менеджера пакетов pip: «tensorflow».
Открытая нейросетевая библиотека Keras
Keras – открытая нейросетевая библиотека, написанная на языке Python и предназначенная для работы с сетями глубинного обучения.
Официальный сайт: https://keras.io/
Документация: https://keras.io/api/
Документация на русском: https://ru-keras.com/home/
Имя для менеджера пакетов pip: «keras».
Библиотека компьютерного зрения OpenCV
OpenCV (от англ. Open Source Computer Vision Library) – библиотека алгоритмов компьютерного зрения, обработки изображений и численных алгоритмов общего назначения с открытым исходным кодом.
Официальный сайт: https://opencv.org
Документация: https://docs.opencv.org/4.5.1/
Имя для менеджера пакетов pip: «opencv-python».