witter


Namewitter JSON
Version 0.0.8 PyPI version JSON
download
home_pageNone
SummaryWitter - generate random text in the style of the document you provide.
upload_time2024-08-28 03:05:18
maintainerJason Ross (big-jr)
docs_urlNone
authorJason Ross (big-jr)
requires_python<4.0,>=3.9
licenseApache-2.0
keywords text generator ml statistics random
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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:

```bash
witter --help
```

or from the command line using:

```bash
python -m witter --help
```

Both of these examples will display the command line options.

A simple example to get you started is:

* download a large text file - perhaps [The Complete Works of Shakespeare from Project Gutenberg](https://www.gutenberg.org/ebooks/100)
* pass the contents of the file to `witter`

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

```bash
witter filepath.txt
```

or, if you want to use piping in Linux:

```bash
cat filepath.txt | witter
```

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

```bash
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:

```bash
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:

```bash
witter --help
```

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

```text
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](https://static.pepy.tech/badge/witter)](https://pepy.tech/project/witter)
[![Downloads](https://static.pepy.tech/badge/witter/week)](https://pepy.tech/project/witter/week)
[![Downloads](https://static.pepy.tech/badge/witter/month)](https://pepy.tech/project/witter/month)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "witter",
    "maintainer": "Jason Ross (big-jr)",
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": "jason@softwarepragmatism.com",
    "keywords": "text, generator, ml, statistics, random",
    "author": "Jason Ross (big-jr)",
    "author_email": "jason@softwarepragmatism.com",
    "download_url": "https://files.pythonhosted.org/packages/89/f3/ff78529eedbc097f3f84559ceba39d05eb44cbd28b76a44e945a57fe52f2/witter-0.0.8.tar.gz",
    "platform": null,
    "description": "# Witter\n\n## What's Witter?\n\nWitter 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.\n\nOnce it has analyzed the source text, it generates a number of random sample pieces of text based on it.\n\nBecause 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.\n\nIt'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.\n\n## How Do I Use Witter?\n\nRun `witter` from within a virtual environment using the syntax:\n\n```bash\nwitter --help\n```\n\nor from the command line using:\n\n```bash\npython -m witter --help\n```\n\nBoth of these examples will display the command line options.\n\nA simple example to get you started is:\n\n* download a large text file - perhaps [The Complete Works of Shakespeare from Project Gutenberg](https://www.gutenberg.org/ebooks/100)\n* pass the contents of the file to `witter`\n\nIn Windows or Linux, in a Python virtual environment, the following command will produce samples:\n\n```bash\nwitter filepath.txt\n```\n\nor, if you want to use piping in Linux:\n\n```bash\ncat filepath.txt | witter\n```\n\nSo, if you want to generate text from The Complete Works of William Shakespeare, and why wouldn't you?\n\n```bash\nwget https://www.gutenberg.org/cache/epub/100/pg100.txt\ncat pg100.txt | witter\n```\n\nor if A Christmas Carol by Charles Dickens is more your thing:\n\n```bash\nwget https://www.gutenberg.org/ebooks/24022.txt.utf-8\ncat 24022.txt.utf-8 | witter\n```\n\nYou'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.\n\nIf you'd like a list of the available options, you can type:\n\n```bash\nwitter --help\n```\n\nfrom within your virtual environment. The output will be something like:\n\n```text\nusage: witter [-h] [-c CHAIN_LENGTH] [-t TEXT_LENGTH] [-s SAMPLE_COUNT] [-e {ascii,utf-8}] [-f {text,json}] [-v] [FILE]\n\nGenerate texts based on an input text.\n\npositional arguments:\n  FILE                  The file to use as a source of text for for witter, or - for stdin. (default: -)\n\noptions:\n  -h, --help            show this help message and exit\n  -c CHAIN_LENGTH, --chain-length CHAIN_LENGTH\n                        The number of characters used to chain together and forecast the next character. (default: 10)\n  -t TEXT_LENGTH, --text-length TEXT_LENGTH\n                        The length of text sample to generate, in characters. Note: may be approximate. (default: 200)\n  -s SAMPLE_COUNT, --sample-count SAMPLE_COUNT\n                        The number of samples to generate (default: 1)\n  -e {ascii,utf-8}, --encoding {ascii,utf-8}\n                        The text encoding to use when reading the input. (default: utf-8)\n  -f {text,json}, --format {text,json}\n                        The format for the output. (default: text)\n  -v, --verbosity       Increase the verbosity of the output (default: 0)\n\nFor more details, refer to https://www.softwarepragmatism.com/\n```\n\n## Download Statistics\n[![Downloads](https://static.pepy.tech/badge/witter)](https://pepy.tech/project/witter)\n[![Downloads](https://static.pepy.tech/badge/witter/week)](https://pepy.tech/project/witter/week)\n[![Downloads](https://static.pepy.tech/badge/witter/month)](https://pepy.tech/project/witter/month)\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Witter - generate random text in the style of the document you provide.",
    "version": "0.0.8",
    "project_urls": null,
    "split_keywords": [
        "text",
        " generator",
        " ml",
        " statistics",
        " random"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6f49595181b7cddf64c02a51b676ab7f95283598477b28a2382d9af5ce538960",
                "md5": "17584ffd64aa63c45090331bf88e8a18",
                "sha256": "6d03b97cce36e406c03748bbb50ff5c784e25d083896a685fc219ec97a5478fa"
            },
            "downloads": -1,
            "filename": "witter-0.0.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "17584ffd64aa63c45090331bf88e8a18",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 6052,
            "upload_time": "2024-08-28T03:05:16",
            "upload_time_iso_8601": "2024-08-28T03:05:16.623838Z",
            "url": "https://files.pythonhosted.org/packages/6f/49/595181b7cddf64c02a51b676ab7f95283598477b28a2382d9af5ce538960/witter-0.0.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "89f3ff78529eedbc097f3f84559ceba39d05eb44cbd28b76a44e945a57fe52f2",
                "md5": "f8c8b3c016e277f57ad609aa0457f1a0",
                "sha256": "c3b45b5671d149b37c7fe3c373bd5a8940bdf759a2db36d2099fd84b18eed540"
            },
            "downloads": -1,
            "filename": "witter-0.0.8.tar.gz",
            "has_sig": false,
            "md5_digest": "f8c8b3c016e277f57ad609aa0457f1a0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 5064,
            "upload_time": "2024-08-28T03:05:18",
            "upload_time_iso_8601": "2024-08-28T03:05:18.197721Z",
            "url": "https://files.pythonhosted.org/packages/89/f3/ff78529eedbc097f3f84559ceba39d05eb44cbd28b76a44e945a57fe52f2/witter-0.0.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-28 03:05:18",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "witter"
}
        
Elapsed time: 0.36766s