Skip to main content

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.

Metadata

Release files for themecor 0.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 themecor 0.1.0
File Size Uploaded Provenance
themecor-0.1.0.tar.gz 5.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for themecor 0.1.0
File Interpreter ABI Platform
themecor-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.7 kB

Release files / themecor-0.1.0.tar.gz

Download URL themecor-0.1.0.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
61dd3be8d59d92f82bbaafc78ce044c849c23f6573f13b367b6df358b3ab9ada
BLAKE2b-256 checksum
How to use checksums
71db99fdd46739bc7c46530d8d0c665f0cc62c903316c3ad70f63f751f276590
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.9 Darwin/24.3.0

Release files / themecor-0.1.0-py3-none-any.whl

Download URL themecor-0.1.0-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f8035cab9323bd4bb2a94bc2cf67fe6ef688b4aabd21bf093f4649dade03539c
BLAKE2b-256 checksum
How to use checksums
d6259eeca281822f821ef14c12b88e13778e90bba0f10bc1d837006655dce91c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.9 Darwin/24.3.0

Security for themecor 0.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

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