Skip to main content

`themecor` is a Python package that provides a centralized theme manager to ensure visual consistency across different packages within an application. It offers styles and methods to display messages, prompts, and progress bars in a uniform manner.

Project description

themecor

themecor is a Python package that provides a centralized theme manager to ensure visual consistency across different packages within an application. It offers styles and methods to display messages, prompts, and progress bars in a uniform manner.

Installation

pip install themecor

Note: This package is under development and may contain breaking changes.

Usage

Here's an example of how to use themecor:

from themecor import ThemeManager

# Initialize the theme manager
theme_manager = ThemeManager()

# Use methods to display messages
theme_manager.info("Information message")
theme_manager.success("Success message")
theme_manager.warning("Warning message")
theme_manager.error("Error message")
theme_manager.debug("Debug message")

# Use methods to display headers and panels
theme_manager.header("Main Title", "Optional Subtitle")
theme_manager.panel("Panel content", "Panel Title")

# Use methods for prompts and tables
response = theme_manager.confirm("Confirm action?", default=True)
table = theme_manager.table(title="Data Table", headers=["Column 1", "Column 2"])
table.add_row("Data 1", "Data 2")
theme_manager.console.print(table)

# Use methods for progress bar management
progress, task_id = theme_manager.manage_progress(None, None, "Task in progress...", 100)
theme_manager.update_progress(progress, task_id, 50)
# ... (Your task code)
theme_manager.update_progress(progress, task_id, 100)
theme_manager.stop_progress(progress)

Features

  • Centralized Theme Management: Ensures a consistent look and feel throughout the application.
  • Customizable Styles: Allows defining custom styles for messages, prompts, etc.
  • Rich Integration: Uses the Rich library for colorful and styled displays.
  • Typer Integration: Provides a pre-configured Typer instance for command-line management.
  • Progress Bar Management: Simplifies the creation and management of progress bars.

Configuration

You can customize the theme by passing a dictionary of custom styles when initializing ThemeManager:

custom_theme = {
    "primary": "green",
    "success": "blue",
}

theme_manager = ThemeManager(custom_theme=custom_theme)

Contribution

Contributions are welcome! Feel free to submit pull requests or report issues.

License

This project is licensed under the MIT License.

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

themecor-0.1.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

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

themecor-0.1.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file themecor-0.1.0.tar.gz.

File metadata

  • Download URL: themecor-0.1.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.9 Darwin/24.3.0

File hashes

Hashes for themecor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 61dd3be8d59d92f82bbaafc78ce044c849c23f6573f13b367b6df358b3ab9ada
MD5 9b1a7a0c689e4860ef54ec323770a1c5
BLAKE2b-256 71db99fdd46739bc7c46530d8d0c665f0cc62c903316c3ad70f63f751f276590

See more details on using hashes here.

File details

Details for the file themecor-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: themecor-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.9 Darwin/24.3.0

File hashes

Hashes for themecor-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f8035cab9323bd4bb2a94bc2cf67fe6ef688b4aabd21bf093f4649dade03539c
MD5 292a5c94cf56d7d82558974e2bfc2d00
BLAKE2b-256 d6259eeca281822f821ef14c12b88e13778e90bba0f10bc1d837006655dce91c

See more details on using hashes here.

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