Skip to main content

from _pyrepl import consolefrom anb_console import ConsoleProgressBarStyle

anb_console

Описание проекта

anb_console — это фреймворк на Python для создания командных интерфейсов (CLI) с богатой текстовой разметкой, обработкой ввода и настраиваемыми элементами пользовательского интерфейса. Он предоставляет классы для отображения текста, обработки ввода и повторно используемых элементов консоли.

Основные компоненты

Основные классы

  • Console: Основной класс для управления выводом в консоль и обработкой ввода.
  • ConsoleLine: Представляет строку текста со стилем и позиционированием.
  • ConsoleLineSegment: Отрезки текста внутри строки (например, для окрашенного текста).
  • ConsoleTextMarkup: Утилиты для форматирования и стилизации текста.

Читатели ввода

  • ConsoleTextReader: Базовый класс для обработки ввода текста.
  • ConsoleYesNoReader: Обработка запросов на подтверждение (да/нет).
  • ConsolePasswordReader: Безопасный ввод пароля.
  • ConsoleNumberReader: Валидация числового ввода.
  • ConsoleVariantReader: Многоопционный выбор.

Элементы пользовательского интерфейса

  • ConsoleTextBox: Поле ввода текста.
  • ConsoleProgressBar: Индикатор прогресса.
  • ConsoleSeparator: Визуальные разделительные линии.
  • ConsoleTextArea: Многострочная область текста.

Перечисления и абстракции

  • ConsoleReaderOption: Опции для обработки ввода.
  • ConsoleProgressBarStyle: Стили прогресс-баров.
  • ConsoleLineStyle: Опции стилизации текста.
  • ConsoleComponent (Абстрактный): Базовый класс для элементов UI.
  • ConsoleReader (Абстрактный): Базовый класс для обработчиков ввода.

Использование

  1. Импортируйте основные классы для работы с текстом:
from anb_console.classes import Console, ConsoleLine
  1. Используйте читатели ввода для интерактивных запросов:
from anb_console import Console, ConsoleYesNoReader

console = Console()
reader = ConsoleYesNoReader(console)
response = reader.read()
  1. Создайте элементы пользовательского интерфейса:
from anb_console import Console, ConsoleProgressBar, ConsoleProgressBarStyle

console = Console()
progress = ConsoleProgressBar(console.add_line(), 100)
progress.style = ConsoleProgressBarStyle.MARQUEE
progress.start()

Разработка

  • Классы организованы в anb_console/classes, anb_console/readers и anb_console/components
  • Энамы и абстрактные классы находятся в anb_console/enums и anb_console/abstracts

Ошибки

О найденных ошибках вы можете сообщать в GitFlic проблемах.

Metadata

Release files for anb-console 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for anb-console 1.0.1
File Size Uploaded Provenance Actions
anb_console-1.0.1.tar.gz 44.5 kB Without provenance Details for anb_console-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for anb-console 1.0.1
File Interpreter ABI Platform Actions
anb_console-1.0.1-py3-none-any.whl Python 3 none any Details for anb_console-1.0.1-py3-none-any.whl

Total release size: 108.5 kB

Release files / anb_console-1.0.1.tar.gz

Download URL anb_console-1.0.1.tar.gz
Size 44.5 kB
Tags Source
SHA-256 checksum
How to use checksums
48525395bb0879bc29f075927f886f1457e02fd2b4b8068344132b946c180cab
BLAKE2b-256 checksum
How to use checksums
c77a20b9e86b8442c590d8d87f4eaa8da947c0160ab729780643f80153ae7909
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Release files / anb_console-1.0.1-py3-none-any.whl

Download URL anb_console-1.0.1-py3-none-any.whl
Size 64.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1f1d629f58fac24b8d6a17eb31fe35236fa11fb5f1bbe44e949d06cae60cc7de
BLAKE2b-256 checksum
How to use checksums
4b9adf930231d119dffbc6baf58a94e1941ad4ded40d22007436a42a306cff97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Security for anb-console 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page