All Projects → ilovecode1 → Pyfancy-2

ilovecode1 / Pyfancy-2

Licence: MIT license
Simple terminal formatting in Python!

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pyfancy-2

Polished
A lightweight toolset for writing styles in JavaScript ✨
Stars: ✭ 7,074 (+22006.25%)
Mutual labels:  styling
Vcl Styles Plugins
Skin plugins for third party installers and apps
Stars: ✭ 131 (+309.38%)
Mutual labels:  styling
React Native Extended Stylesheet
Extended StyleSheets for React Native
Stars: ✭ 2,732 (+8437.5%)
Mutual labels:  styling
Gemma
A lightweight CSS library.
Stars: ✭ 94 (+193.75%)
Mutual labels:  styling
Css In Js
A thorough analysis of all the current CSS-in-JS solutions with SSR & TypeScript support for Next.js
Stars: ✭ 127 (+296.88%)
Mutual labels:  styling
Fela
State-Driven Styling in JavaScript
Stars: ✭ 2,097 (+6453.13%)
Mutual labels:  styling
Reflexjs
Starter kits, themes and blocks to help you build Gatsby and Next.js sites faster. Built on top of a best-in-class styling library.
Stars: ✭ 571 (+1684.38%)
Mutual labels:  styling
react-native-weather
This project is to explore React Navigation (Drawer, Tab, and Stack Navigators). And explore best practices around styling, design, and collaborating with designers for better UX for building great apps.
Stars: ✭ 51 (+59.38%)
Mutual labels:  styling
Sty
String styling for your terminal.
Stars: ✭ 129 (+303.13%)
Mutual labels:  styling
Jcf
Advanced form elements customization using CSS/JS
Stars: ✭ 203 (+534.38%)
Mutual labels:  styling
Quark
Quark.js is a microscopic atomic CSS polyfill in JS just 140 bytes
Stars: ✭ 97 (+203.13%)
Mutual labels:  styling
Herb
🌿 Clojurescript CSS styling using functions.
Stars: ✭ 120 (+275%)
Mutual labels:  styling
Bash Coding Style
A Bash coding style
Stars: ✭ 179 (+459.38%)
Mutual labels:  styling
Interfacss
The CSS-inspired styling and layout framework for iOS
Stars: ✭ 92 (+187.5%)
Mutual labels:  styling
Vcl Styles Utils
Extend and improve the Delphi VCL Styles
Stars: ✭ 238 (+643.75%)
Mutual labels:  styling
Styled System
⬢ Style props for rapid UI development
Stars: ✭ 7,126 (+22168.75%)
Mutual labels:  styling
Filbert Js
A lightweight(~1kb) css-in-js framework
Stars: ✭ 167 (+421.88%)
Mutual labels:  styling
tsstyled
A small, fast, and simple CSS-in-JS solution for React.
Stars: ✭ 52 (+62.5%)
Mutual labels:  styling
Further
🦄🌈🍄 algebraic style composition for functional UIs
Stars: ✭ 254 (+693.75%)
Mutual labels:  styling
React Native Render Html
iOS/Android pure javascript react-native component that renders your HTML into 100% native views
Stars: ✭ 2,617 (+8078.13%)
Mutual labels:  styling

Build Status FOSSA Status Shield Badge

Download

Go to the releases page and download the latest (or previous) version.

Or use pip pip install pyfancy

Overview

pyfancy is a simple Python library that provides a mechanism for easily styling text in some terminal environments. Text is styled by chaining together methods that add escape codes for color modifiers to the text.

Usage

Formatting using pyfancy all follows the same basic pattern. First, there is the initializer, which just sets up the pyfancy object. Next is a chain of function calls that provide text formatting. Finally, there is a last method chained on which either returns the text string with format escape codes, or which directly outputs the text using the print statement / method. (The output method should be compatible with Python 2 and 3.)

This chain of code looks basically like this:

pyfancy().[chained statements].output() # To print using print statement / method
pyfancy().[chained statements].get()    # To get formatted text string

There are two different ways to use the chained statements. The first is to provide the text that is to be chained as part of the statement call. For example, the following prints “Hello, world!” in red:

pyfancy().red("Hello, world!").output()

However, chained statements are really just modifiers with an optional text argument. The following example works identically to the previous example:

pyfancy().red().add("Hello, world!").output()

Using chained statements, then, allows for modifiers to be stacked:

pyfancy().red().bold().add("Hello, world!").output()

# or

pyfancy().red().bold("Hello, world!").output()

# The red() and bold() calls can also be in the opposite order.

Of course, there can only be, for example, one color active at a time. This allows for the creation of multicolored statements:

pyfancy().red("Hello").magenta(", ").blue("world!").output()

It is also possible to reset all styles, either to get default styling, or to ensure that styles are reset, using the raw modifier:

pyfancy().raw("You walk into a ").red().bold("DANGEROUS").raw(" room.").output()

Parsing is a simple, shorter and faster way to use Pyfancy 2. Instead of:

pyfancy().red("Hello").blue(" world!").output()

You can do this:

pyfancy("{red Hello {blue world!}}").output()

For parsing you can also import from a text file:

pyfancy().open("import.txt").output()

In order to use pyfancy, import the module with from pyfancy.pyfancy import pyfancy.

Types of effects

Text Effect Background  
     
bold n/a  
dim n/a Light/Dark
underlined n/a n/a
blinking n/a n/a
black black_bg n/a
red red_bg dark_red
green green_bg dark_green
yellow yellow_bg dark_yellow
blue blue_bg dark_blue
magenta n/a dark_magenta
cyan n/a dark_cyan
n/a gray_bg light_gray
white n/a n/a
rainbow n/a n/a
multi n/a n/a
n/a dark_gray_bg dark_gray
n/a light_red_bg light_red
n/a light_green_bg light_green
n/a light_yellow_bg light_yellow
n/a light_blue_bg light_blue
n/a light_purple_bg light_purple
n/a light_cyan_bg light_cyan
n/a white_bg white

License

Pyfancy-2 is under the MIT license.

FOSSA Status Large Badge

Contributors

Note: Because v2 was made in a fork the contribution graph does not truely reflect the contributions made by the bellow contributers.

Project by CosmicWebServices

TheMonsterFromTheDeep

joker314

baranskistad

jonathan50

rogersouza

vutondesign

cruxicheiros

hiccup01

Kristinita

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].