Skip to main content

Python tool for converting all plain English letters in text into various fancy-styled text and back

Project description

Text FanciPy

Text FanciPy is a Python tool for converting plain English letters (A-Za-z) in a text to their Unicode counterparts in various “fancy” styles, and vice versa. It’s perfect for adding a unique, stylistic touch to your text messages, documents, or any other content, where text styling can be applied.

However, note that any “fancy-styled” text is not proper Unicode text, so it’s not searchable, and it’s not guaranteed to be displayed correctly on all devices. It’s best used for decorative purposes only.

Features

  • Converts the plain English letters in your text to various fancy styles (which are still plain Unicode text).
  • Converts fancy-styled text back to correct text.
  • Can be used via a command line interface (CLI) or imported as a Python package.

Text FanciPy supports several “fancy styles” for text conversion:

style name
bdit 𝑩𝒐𝒍𝒅 𝑰𝒕𝒂𝒍𝒊𝒄
bold 𝐁𝐨𝐥𝐝
bscr 𝓑𝓸𝓵𝓭 𝓢𝓬𝓻𝓲𝓹𝓽
dbst 𝔻𝕠𝕦𝕓𝕝𝕖-𝕤𝕥𝕣𝕦𝕔𝕜
dflt Default
ital 𝐼𝑡𝑎𝑙𝑖𝑐
mono 𝙼𝚘𝚗𝚘𝚜𝚙𝚊𝚌𝚎
sans 𝖲𝖺𝗇𝗌-𝗌𝖾𝗋𝗂𝖿
snbd 𝗦𝗮𝗻𝘀-𝘀𝗲𝗿𝗶𝗳 𝗕𝗼𝗹𝗱
snbi 𝙎𝙖𝙣𝙨-𝙨𝙚𝙧𝙞𝙛 𝘽𝙤𝙡𝙙 𝙄𝙩𝙖𝙡𝙞𝙘
snit 𝘚𝘢𝘯𝘴-𝘴𝘦𝘳𝘪𝘧 𝘐𝘵𝘢𝘭𝘪𝘤

Installation

To install Text FanciPy, run:

python3 -m pip install --upgrade text-fancipy

For the current development version:

python3 -m pip install --upgrade git+https://github.com/twardoch/text_fancipy

Command-line usage

After installation, fancipy can be used directly from the command line.

With text specified as an argument

Convert text to a fancy style:

fancipy <style> -t "Your text"

For example, to convert to Bold style:

$ fancipy bold -t "Hello World"
𝐇𝐞𝐥𝐥𝐨 𝐖𝐨𝐫𝐥𝐝

Convert text back from a fancy style to plain text:

fancipy undo -t "𝐇𝐞𝐥𝐥𝐨 𝐖𝐨𝐫𝐥𝐝"

With piping

$ echo "Hello World" | fancipy bold | fancipy undo
Hello World

With files

You can also specify input and output files:

fancipy <style> -f input.txt -o output.txt

Python usage

You can use Text FanciPy as a library in your Python scripts.

from text_fancipy.fancipy import fancipy, unfancipy_all

# Convert to fancy text
fancy_text = fancipy("Your Text", "bold")

# Convert back to plain text
plain_text = unfancipy_all(fancy_text)

Changes

  • v1.0.3: Minor fixes
  • v1.0.0: Initial release

License

  • Text FanciPy written by Adam Twardoch, with assistance from GPT-4
  • Copyright (c) 2023 Adam Twardoch
  • Licensed under the Apache-2.0 license

Contact

Open an issue and describe your problem or suggestion.

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

text_fancipy-1.0.3.tar.gz (14.4 kB view hashes)

Uploaded Source

Built Distribution

text_fancipy-1.0.3-py3-none-any.whl (10.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