Skip to content

A Python port of @zuzak's JavaScript OWO

License

Notifications You must be signed in to change notification settings

haxelcaribou/OwO

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OwO

Yet another owoifier. This specific one is a port of @zuzak's JavaScript OWO into Python, because we needed this to be in even more languages.

Install

  1. Run the command pip install text-to-owo to install the package on your system.
  2. Add import owo to the beginning of your script.

Usage

Constants

owo.PREFIXES

Tuple containing default prefixes


owo.SUFFIXES

Tuple containing default suffixes


owo.SUBSTITUTIONS

Dict containing default substitutions

Functions

owo.add_prefix(input_string, prefixes=owo.PREFIXES)

Appends a random prefix to the beginning of the string. Custom prefixes are optional and must be passed as either a list or tuple of strings.


owo.add_suffix(input_string, suffixes=owo.SUFFIXES)

Appends a random suffix to the end of the string. Custom suffixes are optional and must be passed as either a list or tuple of strings.


owo.add_affixes(input_string, prefixes=owo.PREFIXES, suffixes=owo.SUFFIXES)

Appends a random prefix and suffix to the beginning and end of the string. Custom prefixes and suffixes are optional and must be passed as either a list or tuple of strings.


owo.substitute(input_string, substitutions=owo.SUBSTITUTIONS)

Turns the text into owo speak without adding any prefixes or suffixes. Custom substitutions are optional and must be passed as dictionary in the form {"key":"replacement"}.


owo.owo(input_string, prefixes=owo.PREFIXES, suffixes=owo.SUFFIXES, substitutions=owo.SUBSTITUTIONS)

Both substitutes and adds prefixes and suffixes. Optional prefixes, suffixes, and substitutions are the same as in other methods.


For all optional arguments the given iterable/dict will replace the default values, not add to them.

All functions take a single string as input and output a string.

Example

import owo

print(owo.owo("I have no mouth and I must scream"))
# HIIII! I haz nu mouth and I must scweam XDDD

print(owo.substitute("I have no mouth and I must scream"))
# I haz nu mouth and I must scweam