Skip to main content

A fun way to customize your terminal with colors, styles etc...

Project description

Bored of your terminal? Try some :mage_man: Magic

Updates

(v0.0.4 Aug/25/2021)

Changes

None

Fixes

  • Fixed major issue causing the whole library to malfunction.

What is Magic ?

Magic is a tool that styles your terminal.

How does it work?

Basically it wraps your text with specific codes that tells the terminal to style this text.

Why would I use it?

Well just think how many times you've changed your terminal theme in the past. And how sick of it you're that you're searching for such thing in the first place. :laughing:

Alright enough of the FAQs lets talk code!

Installation

Windows

py -m pip install magic-terminal

Import

from magic import *

class Style

  • default

  • bright

  • underlined

  • blinking

  • fixed_color

class Color

  • black

  • red

  • green

  • yellow

  • blue

  • magenta

  • cyan

  • white

  • reset

class Highlight

  • black

  • red

  • green

  • yellow

  • blue

  • magenta

  • cyan

  • white


class Print

  • text - This allows you to print styled text with some extra values.

from magic import Print

 Print.text(
   text = "This is an example for Print.text",
   style = Style.bold,
   color = Color.green,
   end_with_new_line = True)

Output: This is an example for Print.text

  • type - This prints the text with a style based on their value type.

from magic import Print

Print.type(420)

Output: 420

class Get

  • styled_text - This returns a string of text with the specified style.

from magic import Get

styled_text = Get.styled_text(
    text = "This is a test for styled_text",
    style = Style.bright,
    color = Color.magenta
)

print(styled_text)

Output: This is a test for styled_text

  • layout - This returns the style code of a style.

from magic import Get

layout = Get.layout(
    style = Style.underlined,
    color = Color.red,
    highlight = Highlight.green
)

print(layout + "This is a test for layout" + Color.reset)

Output: This is a test for layout


Previous updates

v0.0.3

Changes

  • Updated README.md

Fixes

None

v0.0.2

Changes

  • Changes setup.py to setup.cfg
  • Updated README.md

Fixes

  • Remastered the setup system.

v0.0.1

:tada: Launched the library :tada:

Changes

  • Added LICENSE.txt
  • Added README.md
  • Added Print
  • Added Get

Fixes

None

v0.0.0-Alpha

Changes

  • Added MANIFEST.in
  • Added myproject.toml
  • Added setup.py
  • Added Style
  • Added Color
  • Added Highlight

Fixes

None

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

magic-terminal-0.0.4.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

magic_terminal-0.0.4-py3-none-any.whl (3.3 kB view hashes)

Uploaded Python 3

Supported by

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