Added the OwO library

pull/2/head
sgoudham 5 years ago
parent 10d1772ed6
commit 713c4e28ca

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 DerpyChap
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

@ -0,0 +1,58 @@
Metadata-Version: 2.1
Name: owotext
Version: 1.0.2
Summary: A Python library for converting text strings into OwO
Home-page: https://github.com/DerpyChap/owotext
Author: DerpyChap
Author-email: holla@derpychap.co.uk
License: MIT
Platform: UNKNOWN
Description-Content-Type: text/markdown
# owotext
A Python library for converting text strings into OwO, inspired by [Douglas Gardner's work](https://github.com/zuzak/owo/).
## Installing
```
pip install owotext
```
## Usage
You can use owotext in your Python projects like so:
```py
# OwO Impowt da wibwawy ÙωÙ
from owotext import OwO
# Huohhhh. Setup da convewtew ʕʘ‿ʘʔ
uwu = OwO()
# HIIII! Convewt a stwing into OwO speak Huoh.
print(uwu.whatsthis('In the beginning the Universe was created. '
'This had made many people very angry and has '
'been widely regarded as a bad move.'))
```
Example output:
```
Huohhhh. In da beginning da Univewse was cweated. This had made many peopwe vewy angwy and haz been widewy wegawded as a bad move. Huoh.
```
You can also call owotext from the command line by using the `owo` command:
```
owo You know something? I really hate people! They're selfish, ignorant, loud obnoxious pricks, with basically no redeeming qualities whatsoever. I mean really, look at all they've achieved! Genocide, global warming, reality TV, and just a never ending parade of failures and fuck ups! They are, without question, a complete write-off of a species
```
Example output:
```
Huohhhh. You knuw something? I weawwy hate peopwe! Theywe sewfish, ignuwant, woud obnuxious pwicks, with basicawwy nu wedeeming quawities whatsoevew. I mean weawwy, wook at aww theyve achieved! Genucide gwobaw wawming weawity TV and just a nevew ending pawade of faiwuwes and fuck ups! They awe without question a compwete wwite-off of a species ( '◟ ')
```
## Customization
`OwO()` accepts custom lists of prefixes, suffixes and substitutions.
```py
OwO(prefixes, suffixes, substitutions)
```
Things should be fairly self explanatory here; `prefixes` and `sufffixes` should be `List` objects and `substitutions` should be a `Dict`.
## Requirements
- Python 3
- A lack of self worth

@ -0,0 +1,12 @@
../../Scripts/owo.exe,sha256=7Iegpj7ccd5b8eMUmAJP7bXnFnf1zKg1H4xNygMniC8,106362
owotext-1.0.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
owotext-1.0.2.dist-info/LICENSE,sha256=gyE9VQ6VNdPWhh7werSoct9rIfQ45e8ieK-w8rhiyOI,1066
owotext-1.0.2.dist-info/METADATA,sha256=njZLhyeLL0f82zBqp9E0m5VSO8grVyu8uYO6VsQ5GJQ,2196
owotext-1.0.2.dist-info/RECORD,,
owotext-1.0.2.dist-info/WHEEL,sha256=g4nMs7d-Xl9-xC9XovUrsDHGXt-FT0E17Yqo92DEfvY,92
owotext-1.0.2.dist-info/entry_points.txt,sha256=Zn46oIdbLcr6saabpT1rEeVMaWN-LbDjH_SrOY6gWYw,42
owotext-1.0.2.dist-info/top_level.txt,sha256=alWrwwX0Fai4oH1nMtHw53Cyy1XK9aTqdKtjItWcpl0,8
owotext/__init__.py,sha256=CsD2Xn8aQOacr-06QpsPYD7VHSZ2dxkhVq1cpwck4w8,550
owotext/__pycache__/__init__.cpython-36.pyc,,
owotext/__pycache__/owo.cpython-36.pyc,,
owotext/owo.py,sha256=_zsF9U4sPG42IyosahT6f59yEhIWBKJZuryqlD_S7bs,1671

@ -0,0 +1,5 @@
Wheel-Version: 1.0
Generator: bdist_wheel (0.34.2)
Root-Is-Purelib: true
Tag: py3-none-any

@ -0,0 +1,3 @@
[console_scripts]
owo = owotext.owo:main

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
"""
owotext
~~~~~~~~~~~~~~~~~~~
A Python library for converting text strings into OwO
:copyright: (c) 2020 DerpyChap
:license: MIT, see LICENSE for more details.
"""
__title__ = 'owotext'
__author__ = 'DerpyChap'
__license__ = 'ISC'
__copyright__ = 'Copyright 2020 DerpyChap'
__version__ = '1.0.2'
from collections import namedtuple
from .owo import OwO
VersionInfo = namedtuple('VersionInfo', 'major minor micro releaselevel serial')
version_info = VersionInfo(
major=1, minor=0, micro=1, releaselevel='final', serial=0)

@ -0,0 +1,91 @@
import random
import argparse
import sys
prefixes = [
'<3 ',
'0w0 ',
'H-hewwo?? ',
'HIIII! ',
'Haiiii! ',
'Huohhhh. ',
'OWO ',
'OwO ',
'UwU '
]
suffixes = [
' :3',
' UwU',
' ÙωÙ',
' ʕʘ‿ʘʔ',
' ʕ•̫͡•ʔ',
' >_>',
' ^_^',
'..',
' Huoh.',
' ^-^',
' ;_;',
' ;-;',
' xD',
' x3',
' :D',
' :P',
' ;3',
' XDDD',
', fwendo',
' ㅇㅅㅇ',
' (人◕ω◕)',
'',
' Sigh.',
' x3',
' ._.',
' ( \'\')',
' (• o •)',
' (;ω;)',
' (◠‿◠✿)',
' >_<'
]
substitutions = {
'r': 'w',
'l': 'w',
'R': 'W',
'L': 'W',
'no': 'nu',
'has': 'haz',
'have': 'haz',
'you': 'uu',
'the ': 'da ',
'The ': 'Da '
}
class OwO:
def __init__(self, prefixes=prefixes, suffixes=suffixes, substitutions=substitutions):
self.prefixes = prefixes
self.suffixes = suffixes
self.substitutions = substitutions
def whatsthis(self, text: str):
for key, value in self.substitutions.items():
text = text.replace(key, value)
return random.choice(self.prefixes) + text + random.choice(suffixes)
def main(args=None):
parser = argparse.ArgumentParser(
description='A Python library for converting text strings into OwO',
epilog='https://github.com/DerpyChap/owotext')
parser.add_argument('text', type=str, nargs='*', help='The text to OwO', default=["Please give me some text to OwO"])
args = parser.parse_args()
text = ' '.join(args.text)
if not sys.stdin.isatty():
text = sys.stdin.read().rstrip()
o = OwO()
print(o.whatsthis(text))
if __name__ == '__main__':
main()

Binary file not shown.
Loading…
Cancel
Save