Skip to main content

Allows the easy implementation of uwuifying words for applications like Discord bots and websites

Project description

uwuipy

uwuipy is an advanced uwuifier for Python, designed to transform regular text into a playful and expressive "uwu" style. This whimsical modification of text is often used in online communities for humorous or emotive communication.

Whether you're looking to add a fun twist to a chat application or simply want to explore text manipulation in a lighthearted manner, uwuipy offers an easy-to-use interface with customizable options to create unique text transformations.

The library provides control over various aspects of the uwuification process, including stuttering, facial expressions, actions, and exclamations. Whether you want subtle changes or dramatic transformations, uwuipy allows you to find the perfect balance through adjustable parameters.

Key Features:

  • Ease of Use: Quickly integrate uwuipy into your projects with a simple API.
  • Customizable: Tailor the uwuification process to your needs with adjustable parameters.
  • CLI Support: Use the tool directly from the command line or integrate it into Python applications.
  • Entertainment: A unique way to engage users with lively and animated text transformations.
  • Robust Input Handling: uwuify_segmented provides advanced handling of various text segments, allowing the application to choose which parts of the text to uwuify while leaving others unchanged.

Requirements

  • Python 3.10 or higher

Install

To install just use PyPI pip install uwuipy

Usage

As a library

Integrate uwuipy into your Python application to transform ordinary text into playful uwu-styled expressions. Here's a basic example of how to use it:

from uwuipy import Uwuipy

uwu = Uwuipy()
print(uwu.uwuify(input()))

Constructor parameters

The Uwuipy constructor allows fine-tuning of the uwuification process through the following parameters:

  • seed: An integer seed for the random number generator. Defaults to current time if - not provided.
  • stutterchance: Probability of stuttering a word (0 to 1.0), default 0.1.
  • facechance: Probability of adding a face (0 to 1.0), default 0.05.
  • actionchance: Probability of adding an action (0 to 1.0), default 0.075.
  • exclamationchance: Probability of adding exclamations (0 to 1.0), default 1.
  • nsfw_actions: Enables more "explicit" actions if set to true; default is false.
  • power: The uwuification "level" — higher levels lead to more text transformations being done (1 is core uwu, 2 is nyaification, 3 and 4 are just extra). Using a higher level includes the lower levels.

Customized Example:

Adjust the parameters to create a customized uwuification process:

from uwuipy import Uwuipy

uwu = Uwuipy(None, 0.3, 0.3, 0.3, 1, False, 4)
print(uwu.uwuify(input()))

This can produce output like:

The quick bwown (ᵘʷᵘ) ***glomps*** f-f-fox jyumps uvw the ***screeches*** w-w-w-wazy ***blushes*** dog
The (ᵘﻌᵘ) quick bwown ***smirks smugly*** fox \>w\< ***screeches*** jyumps uvw t-t-t-the (uwu) wazy owo dog ~(˘▾˘~)
The q-q-q-quick ***nuzzles your necky wecky*** b-b-bwown f-f-fox ( ᵘ ꒳ ᵘ ✼) j-j-jyumps (U ﹏ U) u-uvw ***whispers to self*** the owo w-w-w-wazy Uwu d-d-d-dog ***huggles tightly***

Segmented Uwuification:

For more advanced use cases, uwuipy provides the uwuify_segmented() method. This function intelligently processes text segments, allowing for selective uwuification while preserving certain parts of the text. Here's how to use it:

from uwuipy import Uwuipy

uwu = Uwuipy(1, 0.3, 0.3, 0.3, 1)
text = "Hello @everyone! Check out https://example.com and http://test.io/page?arg=1 yeah! Also, say hi to <@123456789012345678> and <@!987654321098765432>, they’re in <#112233445566778899> with role <@&998877665544332211>."

print(uwu.uwuify_segmented(text))

Output:

[('Hello', 'H-Hewwo', False), (' ', ' ', False), ... ('https://example.com', 'https://example.com', False), ... (None, 'to', False), (None, ' ', False), ('<@123456789012345678>', '<@123456789012345678>', True), ... ('<@!987654321098765432>', '<@!987654321098765432>', True), ... (None, ' ', False), ('<#112233445566778899>', '<#112233445566778899>', True), (' ', ' ', False), ('with', 'with', False), (' ', ' ', False), ('role', '***huggles', False), (' ', ' ', False), ('', 'tightly***', False), (None, ' ', False), (None, 'wowe', False), (None, ' ', False), ('<@&998877665544332211>', '<@&998877665544332211>', True), ('.', '.', False)]

The usecase for this is for checking if a user is trying to bypass uwuification by using mentions, URLs, or emojis. The third element in each tuple indicates whether the application should double check if the segment is a legit role, emoji, mention, or URL. And if not it can take the uwuified version instead.

uwuify_segmented has some optional parameters in which you can disable this reporting for some things like URLs or mentions/channel/role IDs and emojis. If set to false then the elements will never be uwuified and always marked as not needing verification.

  • verify_urls: If True, URL-like tokens are marked as special and require caller verification. If False, URLs are left untouched and not marked as special. Defaults to False.
  • verify_men_chan_role: If True, Discord mentions (<@123>), channels (<#123>), and roles (<@&123>) are marked as special tokens. If False, they are preserved automatically. Defaults to True.
  • verify_emojis: If True, both custom Discord emojis (<:name:id>, <a:name:id>) and plain-text emoji syntax (:name:) are marked as special tokens. If False, they are left untouched and not marked as special. Defaults to True.

If something extra is inserted like an action or face, it will mark the original as '' or None in the first element of the tuple.

Time-Based Seeding:

Utilize time-based seeding for unique transformations:

from datetime import datetime
from uwuipy import Uwuipy

message = "Hello this is a message posted in 2017."
seed = datetime(2017, 11, 28, 23, 55, 59, 342380).timestamp()
uwu = Uwuipy(seed)
print(uwu.uwuify(message))  # Hewwo ***blushes*** t-t-t-this is a ***cries*** message posted ***screeches*** in 2017.

This method only uses the uwuify() function, accepting a string and returning an uwuified string based on the constructor parameters.

Directly in the terminal

CLI

Use uwuipy directly from the command line for quick uwuification:

python3 -m uwuipy The quick brown fox jumps over the lazy dog

Output:

The q-q-quick bwown fox jyumps uvw the wazy dog

REPL

REPL Mode:

python3 -m uwuipy 
>>> The quick brown fox jumps over the lazy dog
The quick bwown fox jyumps uvw the wazy dog

Help

Command Line Help:

python3 -m uwuipy --help

Contributing and Licence

Feel free contribute to the GitHub repo of the project.

Licenced under MIT

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

uwuipy-1.0.0.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uwuipy-1.0.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file uwuipy-1.0.0.tar.gz.

File metadata

  • Download URL: uwuipy-1.0.0.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for uwuipy-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d14125753883734a8aebb03355aa3a7614a239ac4b706d2ff38c3751231a81d7
MD5 fe4622c83ced74fcd409f14ce0f698b7
BLAKE2b-256 e30f42182b17a8a25b53a19b59e9e264f94d83aaeed68698ecc783f1f82c4ecd

See more details on using hashes here.

File details

Details for the file uwuipy-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: uwuipy-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for uwuipy-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f0240b19ae19259f6254bc35a2e9efaf6baa56bb09ff9174eb5affc4c80ab06
MD5 c22d032a5db5d96b8adf1d10b1564fd9
BLAKE2b-256 c8f34b3328c1d28288f521a9243d2ef2ce7caa4fdfa18f7ca44e4521616a6b13

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page