Skip to main content

from _pyrepl import consolefrom anb_console import ConsoleProgressBarStyle

anb_console

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

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

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

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

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

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

  • 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

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
File Size Uploaded Provenance Actions
anb_console-1.0.tar.gz 44.5 kB Without provenance Details for anb_console-1.0.tar.gz

Built distribution (wheel)

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

Total release size: 108.4 kB

Release files / anb_console-1.0.tar.gz

Download URL anb_console-1.0.tar.gz
Size 44.5 kB
Tags Source
SHA-256 checksum
How to use checksums
55a91635dac7b023185ae2d742b65fd099e4ffeb81d153eafb81b276fb07178f
BLAKE2b-256 checksum
How to use checksums
4f5cc3998400a258ca79246786ca3e70f5c6949da1877dceae5f852c2acba7f7
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-py3-none-any.whl

Download URL anb_console-1.0-py3-none-any.whl
Size 63.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
60216f87b536404de9b7da495ffabe14a4acb8438210d02a41ef0562c89d7a87
BLAKE2b-256 checksum
How to use checksums
2adc8ca41d5d229275a9d8cfc5230abf9ec98986ebeef1c59570d0dfedf5cac4
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

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 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