Skip to main content

Sopel plugin to generate "Spongemock" text (based on *that* SpongeBob meme)

Project description

sopel-spongemock

Sopel plugin to generate "Spongemock" text (based on that SpongeBob meme)

Requirements

Basic usage: Only Sopel itself.

With configurable output: Additionally requires the spongemock PyPI package.

More robust Unicode detection: Additionally requires the unicodedata2 PyPI package.

Installation

Basic

pip install sopel-spongemock

Configurable

pip install sopel-spongemock[lib]

Robust

pip install sopel-spongemock[ud2]

Note: It is possible to install both lib and ud2 extras at once, but doing so serves no purpose; the spongemock package does not make use of unicodedata or unicodedata2.

Configuration

If installed with the lib extra, use the following template in Sopel's configuration file to set options for spongemock's output:

[spongemock]
diversity_bias = 0.6
always_start_lower = False

The diversity_bias option controls the chance of switching cases for each letter in the output. 0.0 represents a perfectly random, 50/50 chance. Higher values increase the likelihood of switching as more consecutive letters are output with the same case. At 1.0, it's guaranteed that the case will switch for every letter.

Values outside the range of [0.0, 1.0] will cause errors.

Feel free to experiment with intermediate values to find what "looks right" for your own interpretation of the mocking-text meme.

The always_start_lower option will output text.swapcase() if the first letter of the output is capitalized. (While the built-in mocker always starts with lowercase, the external library sets case of the first letter randomly.)

Note: Options in this configuration section have no effect if the plugin is installed without the lib extra.

Usage

.spongemock <nick>|<text>

or

.smock <nick>|<text>

If a single word is passed, the command will first check if that nick has said anything in the channel recently, and will mock their last message if so.

Any input that does not match a known user's nick will be mocked directly.

Examples

<dgw> .smock Free speech!
<Sopel> fREe SpEEcH
<dgw> I'm something of a Pythonista myself
<ziro> .smock dgw
<Sopel> i'M soMeThiNg oF a pYtHOnIsTA mySElf

1.1.3

Changed:

  • Take advantage of Sopel 8 features if available (#10)
  • Prune old nick's line after nick-change (#11)

1.1.2

Fixed:

  • Output canonical nick instead of copying .smock <nick>'s input (#8 by @dgw)
  • .smock <nick> didn't casemap correctly (#9 by @dgw)

1.1.1

Fixed:

  • TypeError when attempting to .smock by nick (#7 by @SnoopJ)
  • Documentation of optional support for unicodedata2 library

Changed:

  • Replaced deprecated module decorators with their plugin counterparts (future-proofing this plugin for Sopel 8, Sopel 9, and beyond)

1.1.0

Added:

  • Support for using spongemock external library
  • Support for unicodedata2 when present
  • Plugin configuration options (effective only when external library is in use)

Changed:

  • Built-in mocking function is now smarter about only trying to change the case of characters when it's possible to do so
  • Minimum supported Sopel version raised from 7.0 to 7.1

1.0.0

First official release, converted from single .py file to package.

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

sopel-spongemock-1.1.3.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

sopel_spongemock-1.1.3-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file sopel-spongemock-1.1.3.tar.gz.

File metadata

  • Download URL: sopel-spongemock-1.1.3.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for sopel-spongemock-1.1.3.tar.gz
Algorithm Hash digest
SHA256 1f7c27377a94c144102606effa1386233cf204e342f1b997ec957738a56e5c6a
MD5 c024e882125439bbc040fe161f6d6bd9
BLAKE2b-256 8fad94ce7b83e6a766e37fe956bfe7fb5340f4d15fde9ee588c91ea4eb3f17f3

See more details on using hashes here.

File details

Details for the file sopel_spongemock-1.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for sopel_spongemock-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a6ed35d4bb7513bb05c65e14569c8a472738740dda6015a60c528de638cf1208
MD5 f932a4070e4976ea5f0627151949393d
BLAKE2b-256 e19947e0cdbb2d75de9d5cefd16ae6d23b2a3d2bb383addf9f3c69eade5f0a5b

See more details on using hashes here.

Supported by

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