Reference

Command-line usage

Dress up’s command-line usage looks like:

❯ dressup [OPTIONS] [CHARACTERS]
-s , --strict-case

Do not fallback to different cases.

-r , --reverse

Reverse the output.

-t , --type TEXT

The Unicode type to convert to.

--version

Display the version and exit.

--help

Display a short usage message and exit.

--install-completion [bash|zsh|fish|powershell|pwsh]

Install completion for the specified shell.

--show-completion [bash|zsh|fish|powershell|pwsh]

Show completion for the specified shell, to copy it or customize the installation.

dressup.converter

Convert Unicode characters.

dressup.converter. convert ( characters : str , unicode_type : str , strict_case : bool = False , reverse : bool = False ) → str [source]

Convert characters to a Unicode character type.

Parameters
  • characters ( str ) – The characters to convert.

  • unicode_type ( str ) – The type of Unicode character types to convert to. Valid values are “circle”, “negative circle”, “monospace”, “math bold”, “math bold fraktur”, “math bold italic”, “math bold script”, “math double struck”, “math monospace”, “math sans”, “math sans bold”, “math sans bold italic”, “math sans italic”, “parenthesized”, “square”, “negative square”, “cute”, “math fraktur”, “rock dots”, “small caps”, “stroked”, “subscript”, “superscript”, “inverted”, and “reversed”.

  • strict_case ( bool ) – Whether to forbid a character from being converted to its lower or upper case counterpart if an exact mapping is not found. By default False.

  • reverse ( bool ) – Whether to reverse the returned characters. This can be useful when converting to unicode_type “inverted” or “reverse”. By default False.

Returns

The converted Unicode characters.

Return type

str

Raises

InvalidUnicodeTypeError – Raised if value inputted in unicode_type is invalid.

Examples

Convert the string “Hello” to negative circle characters.

>>> import dressup
>>> dressup.convert("Hello", unicode_type="negative circle")
'🅗🅔🅛🅛🅞'

Convert the string “Hello” to negative circle characters, but don’t convert lowercase to uppercase if a perfect match isn’t found.

>>> import dressup
>>> dressup.convert(
...     "Hello",
...     unicode_type="negative circle",
...     strict_case=True,
... )
'🅗ello'

Concvert the string “Hello” to reversed characters, but

>>> import dressup
>>> import dressup
>>> dressup.convert(
...     "Hello",
...     unicode_type="reversed",
...     reverse=True,
... )
'o⅃⅃ɘH'
dressup.converter. show_all ( characters : str , strict_case : bool = False , reverse : bool = False ) → Dict [ str , str ] [source]

Return all possible unicode conversions.

Parameters
  • characters ( str ) – The characters to convert.

  • strict_case ( bool ) – Whether to forbid a character from being converted to its lower or upper case counterpart if an exact mapping is not found. By default False.

  • reverse ( bool ) – Whether to reverse the returned characters. This can be useful when converting to unicode_type “inverted” or “reverse”. By default False.

Returns

A dictionary with the converted characters.

The dictionary keys are the names of character types and the values are the converted characters.

Return type

Dict(str, str)

Example

Show all possible conversions for the string “Hello”.

>>> import dressup
>>> dressup.show_all("Hello")
{'Circle': 'Ⓗⓔⓛⓛⓞ', 'Negative circle': '🅗🅔🅛🅛🅞',
'Monospace': 'Hello', 'Math bold': '𝐇𝐞𝐥𝐥𝐨',
'Math bold fraktur': '𝕳𝖊𝖑𝖑𝖔', 'Math bold italic': '𝑯𝒆𝒍𝒍𝒐',
'Math bold script': '𝓗𝓮𝓵𝓵𝓸', 'Math double struck': 'ℍ𝕖𝕝𝕝𝕠',
'Math monospace': '𝙷𝚎𝚕𝚕𝚘', 'Math sans': '𝖧𝖾𝗅𝗅𝗈', 'Math sans bold':
'𝗛𝗲𝗹𝗹𝗼', 'Math sans bold italic': '𝙃𝙚𝙡𝙡𝙤', 'Math sans italic':
'𝘏𝘦𝘭𝘭𝘰', 'Parenthesized': '⒣⒠⒧⒧⒪', 'Square': '🄷🄴🄻🄻🄾',
'Negative square': '🅷🅴🅻🅻🅾', 'Cute': 'Héĺĺő', 'Math fraktur':
'ℌ𝔢𝔩𝔩𝔬', 'Rock dots': 'Ḧëḷḷö', 'Small caps': 'ʜᴇʟʟᴏ', 'Stroked':
'Ħɇłłø', 'Subscript': 'ₕₑₗₗₒ', 'Superscript': 'ᴴᵉˡˡᵒ',
'Inverted': 'ɥǝןןo', 'Reversed': 'Hɘ⅃⅃o'}