printmoji
Description
A simple package to format text in the terminal with emojis rather than ANSI codes or HTML tags.
Installation
pip install printmoji
Usage
Coloring
Use the following emojis to color your text:
- 🟥 - Red
- 🟧 - Orange
- 🟨 - Yellow
- 🟩 - Green
- ⏹ - Cyan
- 🟦 - Blue
- 🟪 - Magenta
- ⬜ - White
- ⬛ - Black
- ❎ - Reset
I know what you're thinking: "How do I type emojis on the computer? This seems really inconvenient". Stop that.
Press Win+. on Windows or Ctrl+Cmd+Space on Mac to open the emoji keyboard. Type "square" and these emojis will show up.
from printmoji import print
print("🟦Hello 🟥world!")
Outputs:
Hello world!
Indentation
The print function returns a context manager that will indent all text printed within it.
from printmoji import print
with print("Parent"):
print("Hello")
print("World")
with print('Parent', indent=' | '):
print('Pipes!')
print('More pipes!')
print.indent()
print('Indented manually')
print.dedent()
print('Dedented manually')
Outputs:
Parent
Hello
World
Parent
| Pipes!
| More pipes!
Indented manually
Dedented manually
There is an optional close argument that will print a character after the block is closed. This is useful for creating tree structures.
from printmoji import print
with print('Grandparent', close='---\n'):
with print('Parent', close='+++\n'):
print('Child')
Outputs:
Grandparent
Parent
Child
+++
---
Metadata
Release files for printmoji 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| printmoji-1.0.0.tar.gz | 3.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| printmoji-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.0 kB
Release files / printmoji-1.0.0.tar.gz
| Download URL | printmoji-1.0.0.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
84ca7cce271f17854df84231d808870e0058b7fbe7c803c339f3077216b814b1
|
|
BLAKE2b-256 checksum How to use checksums |
08f249e64f2228ec0962214d3a7c93f0047c4ed1f0e02b145335461c8dcf8ec1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Release files / printmoji-1.0.0-py3-none-any.whl
| Download URL | printmoji-1.0.0-py3-none-any.whl |
|---|---|
| Size | 3.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5600824dfc5d30344e2ee078507e235b1cb82e1cc80af7e39b24d6c446b71d83
|
|
BLAKE2b-256 checksum How to use checksums |
20b3fea3b429ecca657b4c0cfe30fe80c47ae18e7c33d5009fbdcfc8aa70eb14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|