Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
7b1d166f45 | |||
11f48f6ffc | |||
6b50670fef |
24
README.md
24
README.md
@ -1,3 +1,25 @@
|
||||
# term-owo
|
||||
|
||||
owoify text from the terminal
|
||||
owoify text from the terminal
|
||||
|
||||
# installation
|
||||
|
||||
### install from source
|
||||
|
||||
download the latest release [here](https://git.alfieking.dev/acetheking987/term-owo/releases) or clone the repository and run `pip install .` in downloaded folder
|
||||
|
||||
### install from repo
|
||||
|
||||
run `pip install --index-url https://git.alfieking.dev/api/packages/acetheking987/pypi/simple/ cmdline-owo` in terminal
|
||||
|
||||
# usage
|
||||
|
||||
from terminal run `owo` to owoify text
|
||||
|
||||
use the `-p` flag to use a pipe as input
|
||||
|
||||
### examples
|
||||
|
||||
`owo "hello world"` -> `hewwo wowwd`
|
||||
|
||||
`echo "hello world" | owo -p` -> `hewwo wowwd`
|
||||
|
16
owo/owo.py
16
owo/owo.py
@ -1,7 +1,21 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from pyowo import owo
|
||||
import argparse, sys
|
||||
from re import compile, sub
|
||||
|
||||
replacements = [
|
||||
(compile(r"(?:r|l)"), "w"),
|
||||
(compile(r"(?:R|L)"), "W"),
|
||||
(compile(r"n([aeiou])"), "ny\\1"),
|
||||
(compile(r"N([aeiou])"), "Ny\\1"),
|
||||
(compile(r"N([AEIOU])"), "NY\\1"),
|
||||
(compile(r"ove"), "uv"),
|
||||
]
|
||||
|
||||
def owo(text: str) -> str:
|
||||
for r in replacements:
|
||||
text = sub(r[0], r[1], text)
|
||||
return text
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser("owo")
|
||||
|
Loading…
Reference in New Issue
Block a user