> **Источник:** https://python-all.ru/3.10/library/text.html
>
> «Документация Python на русском» – неофициальный перевод официальной документации Python: версии от 2.6 до 3.16, полнотекстовый поиск, английский оригинал рядом с переводом. Эта Markdown-версия страницы предназначена для работы с LLM: вставьте её в ChatGPT, Claude или Cursor.

---

# Службы обработки текста

Модули, описанные в этой главе, предоставляют широкий набор операций по работе со строками и других служб обработки текста.

Модуль [`codecs`](https://python-all.ru/3.10/library/codecs.html#module-codecs), описанный в разделе [Службы двоичных данных](https://python-all.ru/3.10/library/binary.html#binaryservices), также имеет прямое отношение к обработке текста. Дополнительно см. документацию по встроенному строковому типу Python в [Тип последовательности текста – str](https://python-all.ru/3.10/library/stdtypes.html#textseq).

- [`string` – Общие операции со строками](https://python-all.ru/3.10/library/string.html)

  - [Строковые константы](https://python-all.ru/3.10/library/string.html#string-constants)
  - [Пользовательское форматирование строк](https://python-all.ru/3.10/library/string.html#custom-string-formatting)
  - [Синтаксис строки форматирования](https://python-all.ru/3.10/library/string.html#format-string-syntax)

    - [Мини-язык спецификации формата](https://python-all.ru/3.10/library/string.html#format-specification-mini-language)
    - [Примеры форматирования](https://python-all.ru/3.10/library/string.html#format-examples)
  - [Строки-шаблоны](https://python-all.ru/3.10/library/string.html#template-strings)
  - [Вспомогательные функции](https://python-all.ru/3.10/library/string.html#helper-functions)
- [`re` – Операции с регулярными выражениями](https://python-all.ru/3.10/library/re.html)

  - [Синтаксис регулярных выражений](https://python-all.ru/3.10/library/re.html#regular-expression-syntax)
  - [Содержимое модуля](https://python-all.ru/3.10/library/re.html#module-contents)

    - [Флаги](https://python-all.ru/3.10/library/re.html#flags)
    - [Функции](https://python-all.ru/3.10/library/re.html#functions)
    - [Исключения](https://python-all.ru/3.10/library/re.html#exceptions)
  - [Объекты регулярных выражений](https://python-all.ru/3.10/library/re.html#regular-expression-objects)
  - [Объекты Match](https://python-all.ru/3.10/library/re.html#match-objects)
  - [Примеры регулярных выражений](https://python-all.ru/3.10/library/re.html#regular-expression-examples)

    - [Проверка на пару](https://python-all.ru/3.10/library/re.html#checking-for-a-pair)
    - [Имитация scanf()](https://python-all.ru/3.10/library/re.html#simulating-scanf)
    - [search() и match()](https://python-all.ru/3.10/library/re.html#search-vs-match)
    - [Создание телефонного справочника](https://python-all.ru/3.10/library/re.html#making-a-phonebook)
    - [Преобразование текста](https://python-all.ru/3.10/library/re.html#text-munging)
    - [Поиск всех наречий](https://python-all.ru/3.10/library/re.html#finding-all-adverbs)
    - [Поиск всех наречий и их позиций](https://python-all.ru/3.10/library/re.html#finding-all-adverbs-and-their-positions)
    - [Сырая строковая нотация](https://python-all.ru/3.10/library/re.html#raw-string-notation)
    - [Написание токенизатора](https://python-all.ru/3.10/library/re.html#writing-a-tokenizer)
- [`difflib` – Вспомогательные функции для вычисления разностей](https://python-all.ru/3.10/library/difflib.html)

  - [Объекты SequenceMatcher](https://python-all.ru/3.10/library/difflib.html#sequencematcher-objects)
  - [Примеры SequenceMatcher](https://python-all.ru/3.10/library/difflib.html#sequencematcher-examples)
  - [Объекты Differ](https://python-all.ru/3.10/library/difflib.html#differ-objects)
  - [Пример Differ](https://python-all.ru/3.10/library/difflib.html#differ-example)
  - [Интерфейс командной строки для difflib](https://python-all.ru/3.10/library/difflib.html#a-command-line-interface-to-difflib)
- [`textwrap` – Перенос и заполнение текста](https://python-all.ru/3.10/library/textwrap.html)
- [`unicodedata` – База данных Unicode](https://python-all.ru/3.10/library/unicodedata.html)
- [`stringprep` – Подготовка строк для интернета](https://python-all.ru/3.10/library/stringprep.html)
- [`readline` – Интерфейс GNU readline](https://python-all.ru/3.10/library/readline.html)

  - [Файл инициализации](https://python-all.ru/3.10/library/readline.html#init-file)
  - [Буфер строки](https://python-all.ru/3.10/library/readline.html#line-buffer)
  - [Файл истории](https://python-all.ru/3.10/library/readline.html#history-file)
  - [Список истории](https://python-all.ru/3.10/library/readline.html#history-list)
  - [Перехватчики запуска](https://python-all.ru/3.10/library/readline.html#startup-hooks)
  - [Автодополнение](https://python-all.ru/3.10/library/readline.html#completion)
  - [Пример](https://python-all.ru/3.10/library/readline.html#example)
- [`rlcompleter` – Функция автодополнения для GNU readline](https://python-all.ru/3.10/library/rlcompleter.html)

  - [Объекты Completer](https://python-all.ru/3.10/library/rlcompleter.html#completer-objects)
