Skip to main content

Witter

What's Witter?

Witter accepts text input, splits it into sections, or "chains", and then works out which character is most likely to follow that "chain" whenever it appears in the source text.

Once it has analyzed the source text, it generates a number of random sample pieces of text based on it.

Because of the way it uses the source text, the text that it produces will be "in the style" of the original text. It may, or may not, make sense.

It's worth noting that this isn't Machine Learning (ML), or any kind of Artificial Intelligence (AI). It's statistics, with some Monte Carlo methods thrown in.

How Do I Use Witter?

Run witter from within a virtual environment using the syntax:

witter --help

or from the command line using:

python -m witter --help

Both of these examples will display the command line options.

A simple example to get you started is:

In Windows or Linux, in a Python virtual environment, the following command will produce samples:

witter filepath.txt

or, if you want to use piping in Linux:

cat filepath.txt | witter

So, if you want to generate text from The Complete Works of William Shakespeare, and why wouldn't you?

wget https://www.gutenberg.org/cache/epub/100/pg100.txt
cat pg100.txt | witter

or if A Christmas Carol by Charles Dickens is more your thing:

wget https://www.gutenberg.org/ebooks/24022.txt.utf-8
cat 24022.txt.utf-8 | witter

You've probably noticed the utf-8 extension on one of the text files. This is a way that Project Gutenberg uses to denote UTF-8-encoded text files. witter can handle UTF-8 with no problems.

If you'd like a list of the available options, you can type:

witter --help

from within your virtual environment. The output will be something like:

usage: witter [-h] [-c CHAIN_LENGTH] [-t TEXT_LENGTH] [-s SAMPLE_COUNT] [-e {ascii,utf-8}] [-f {text,json}] [-v] [FILE]

Generate texts based on an input text.

positional arguments:
  FILE                  The file to use as a source of text for for witter, or - for stdin. (default: -)

options:
  -h, --help            show this help message and exit
  -c CHAIN_LENGTH, --chain-length CHAIN_LENGTH
                        The number of characters used to chain together and forecast the next character. (default: 10)
  -t TEXT_LENGTH, --text-length TEXT_LENGTH
                        The length of text sample to generate, in characters. Note: may be approximate. (default: 200)
  -s SAMPLE_COUNT, --sample-count SAMPLE_COUNT
                        The number of samples to generate (default: 1)
  -e {ascii,utf-8}, --encoding {ascii,utf-8}
                        The text encoding to use when reading the input. (default: utf-8)
  -f {text,json}, --format {text,json}
                        The format for the output. (default: text)
  -v, --verbosity       Increase the verbosity of the output (default: 0)

For more details, refer to https://www.softwarepragmatism.com/

Download Statistics

Downloads Downloads Downloads

Metadata

Release files for witter 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for witter 0.0.8
File Size Uploaded Provenance Actions
witter-0.0.8.tar.gz 5.1 kB Without provenance Details for witter-0.0.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for witter 0.0.8
File Interpreter ABI Platform Actions
witter-0.0.8-py3-none-any.whl Python 3 none any Details for witter-0.0.8-py3-none-any.whl

Total release size: 11.1 kB

Release files / witter-0.0.8.tar.gz

Download URL witter-0.0.8.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c3b45b5671d149b37c7fe3c373bd5a8940bdf759a2db36d2099fd84b18eed540
BLAKE2b-256 checksum
How to use checksums
89f3ff78529eedbc097f3f84559ceba39d05eb44cbd28b76a44e945a57fe52f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.3 Linux/6.8.0-41-generic

Release files / witter-0.0.8-py3-none-any.whl

Download URL witter-0.0.8-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d03b97cce36e406c03748bbb50ff5c784e25d083896a685fc219ec97a5478fa
BLAKE2b-256 checksum
How to use checksums
6f49595181b7cddf64c02a51b676ab7f95283598477b28a2382d9af5ce538960
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.3 Linux/6.8.0-41-generic

Security for witter 0.0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page