Skip to main content

Modern Python library for building beautiful terminal applications.

Project description

EightBits Terminal by 8 Bits

Biblioteca moderna para crear aplicaciones de terminal elegantes en Python.

🚀 Características

Input

Clase para manejo de entrada de datos con validación:

  • text(): Entrada de texto
  • integer(): Entrada y validación de números enteros
  • float(): Entrada y validación de números decimales
  • confirm(): Entrada de opciones sí/no
  • date(): Entrada y validación de fechas
  • email(): Entrada y validación de correos electrónicos
  • password(): Entrada de contraseñas
  • choice(): Entrada de selección de menú

Output

Clase para mostrar información formateada:

  • print(): Impresión con colores
  • warning(): Muestra mensajes de advertencia
  • error(): Muestra mensajes de error
  • confirm(): Muestra mensajes de confirmación
  • clear(): Limpia la pantalla
  • press_enter_to_continue(): Pausa hasta que se presione Enter
  • set_locale(): Configura la localización
  • format_currency(): Formatea números como moneda
  • print_title(): Imprime un título con formato
  • show_progress_bar(): Muestra una barra de progreso

Colors

Clase base para manejo de colores en terminal:

  • Códigos de color para texto
  • Códigos de color para fondos
  • Utilidades de formateo

Alignment

Clase para manejo de alineación de texto:

  • LEFT: Alineación a la izquierda
  • CENTER: Alineación centrada
  • RIGHT: Alineación a la derecha

Tabular

Clase para manejo de tablas en terminal:

  • print(): Genera una tabla con los datos proporcionados

📦 Instalación

pip install eightbits-terminal

🎮 Ejemplo de Uso

from eightbits import Input, Output, Colors, Alignment, Tabular

# Entrada de datos
nombre = Input.text("Ingrese su nombre:", Colors.GREEN, Colors.BLUE)
edad = Input.integer("Ingrese su edad:", Colors.GREEN, Colors.BLUE, 0, 120)
peso = Input.float("Ingrese su peso:", Colors.GREEN, Colors.BLUE, 50, 150)
continuar = Input.confirm("¿Deseas continuar? (si/no):", Colors.GREEN, Colors.BLUE)

# Salida formateada
Output.print(nombre, Colors.WHITE)
Output.print(edad, Colors.WHITE)
Output.print(peso, Colors.WHITE)
Output.print(continuar, Colors.WHITE)

Output.warning("Esto es un mensaje de advertencia.")
Output.error("Esto es un mensaje de error.")
Output.confirm("Esto es un mensaje de confirmación.")
Output.clear()
Output.print("Esto es un mensaje de limpieza.", Colors.RED)
Output.set_locale("es_AR")
Output.print(f"Mi sueldo es de {Output.format_currency(367000)}", Colors.GREEN)

# Alineación de texto
Output.print("Texto alineado a la izquierda")
Output.print("Texto centrado", color=Colors.BLUE, alignment=Alignment.CENTER)
Output.print("Texto alineado a la derecha", alignment=Alignment.RIGHT)

# Datos de ejemplo para la tabla
data = [
    {
        "nombre": "Juan Carlos González",
        "descripción": "Este es un texto muy largo que necesitará ser dividido",
        "ciudad": "Madrid"
    },
    {
        "nombre": "María",
        "descripción": "Texto corto",
        "ciudad": "Barcelona"
    }
]

# Usar el método estático directamente
Tabular.print(data, title="Lista de Usuarios")

# O especificar un ancho máximo
Tabular.print(data, title="Lista de Usuarios", max_width=80)

# Barra de progreso
total_iterations = 100
for i in range(total_iterations + 1):
    Output.show_progress_bar(i, total_iterations)
    time.sleep(0.1)

🛠️ Requisitos

  • Python 3.9 o superior

📜 Licencia

Este proyecto está bajo la Licencia MIT. Ver el archivo LICENSE para más detalles.

🎥 Video de Presentación

Puedes ver el video de presentación del proyecto en YouTube: https://youtu.be/2EZBuveqP9E

🤝 Contribuir

Las contribuciones son bienvenidas. Por favor, siéntete libre de:

  • Reportar bugs
  • Sugerir nuevas funcionalidades
  • Enviar pull requests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eightbits_terminal-2.0.0.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eightbits_terminal-2.0.0-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file eightbits_terminal-2.0.0.tar.gz.

File metadata

  • Download URL: eightbits_terminal-2.0.0.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for eightbits_terminal-2.0.0.tar.gz
Algorithm Hash digest
SHA256 f98471393de7efb2ea5abb11d08e7d987f9f44f3e46b815ce86e7aebe424f9cb
MD5 cd31e106cea0fdb26f1a8eeb8bd01896
BLAKE2b-256 46b0b61c96cdf9c7239f01766e7534b768bc55fc30fae0fc37daf02cad150909

See more details on using hashes here.

Provenance

The following attestation bundles were made for eightbits_terminal-2.0.0.tar.gz:

Publisher: python-publish.yml on agustincomolli/eightbits-terminal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eightbits_terminal-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for eightbits_terminal-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 33f7a5b2f3e032c850c65e29f563eaa6036709d59f0bcf353409cf0bce8a0c24
MD5 054e41dafc2b3b334c516b3127ec50c6
BLAKE2b-256 1054267f4991f36c0c11a07f6db9e49089cb7905bc00a14933e41b59d6a95596

See more details on using hashes here.

Provenance

The following attestation bundles were made for eightbits_terminal-2.0.0-py3-none-any.whl:

Publisher: python-publish.yml on agustincomolli/eightbits-terminal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page