Skip to main content

Printing with emojis

Project description

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
    +++
---

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

printmoji-1.0.0.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

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

printmoji-1.0.0-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file printmoji-1.0.0.tar.gz.

File metadata

  • Download URL: printmoji-1.0.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for printmoji-1.0.0.tar.gz
Algorithm Hash digest
SHA256 84ca7cce271f17854df84231d808870e0058b7fbe7c803c339f3077216b814b1
MD5 16e0a552c42533280afaed0bad37f12d
BLAKE2b-256 08f249e64f2228ec0962214d3a7c93f0047c4ed1f0e02b145335461c8dcf8ec1

See more details on using hashes here.

File details

Details for the file printmoji-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: printmoji-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for printmoji-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5600824dfc5d30344e2ee078507e235b1cb82e1cc80af7e39b24d6c446b71d83
MD5 b0f64d52d1851c5a619f04d849b16e35
BLAKE2b-256 20b3fea3b429ecca657b4c0cfe30fe80c47ae18e7c33d5009fbdcfc8aa70eb14

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