Skip to main content

markovify user-provided text and output the results to a text file.

Project description

mkv-this

mkv-this is a little script that uses the markovify python module to output a bunch of bot sentences based on a bank of text that you feed it. the results are saved to a text file of your choosing. if you run it again on the same output file, the new results are appended after the old ones.

it was written by a total novice, so you probably shouldn’t download it. i only learned about argparser yesterday, and pypi.org today, no matter what day it is.

install with pip:

you can install it with pip, the python package manager.

python3 -m pip install mkv-this

you need python3, and markovify is a dependency, but it should install with mkv-this.

options:

the script implements a few of the basic markovify options, so you can:

  • specify a maximum sentence length
  • specify how many sentences to output
  • specify state size, i.e. the number of preceeding words to be used in calculating the probability of the next word.
  • specify an additional file to use for text input. for the moment you can add only one.

run mkv-this -h to see how to use these options.

for best results:

feed mkv-this large-ish amounts of well punctuated text. it works best if you bulk replace/remove as much mess as possible (URLs, metadata, stars, bullets, etc.), unless you want mashed versions of those things in your output.

if your input text doesn’t use full-stops to mark the ends of sentences, try putting each 'sentence' on a newline, so the parser doesn't read your entire file as one big sentence and output nothing.

you’ll want to edit the output too. it is very much supposed to be a kind of raw material for human editing, rather than print-ready bosh, although many bots are happily publishing such output directly.

for further tips on basic output, see https://github.com/jsvine/markovify#basic-usage.

markovify multiple (3+) files

i have not yet implemented running mkv-this on more than two files at a time. if you would like to run it on a stack of files, you can easily concatenate them in bash:

  • put all your text files in a directory
  • cd into that directory
  • run cat * > outputfile.txt
  • run mkv-this on your newly created file: mkv-this outputfile.txt

good as gold.

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

mkv-this-0.1.11.tar.gz (4.2 kB view details)

Uploaded Source

Built Distributions

mkv_this-0.1.11-py3.7.egg (16.3 kB view details)

Uploaded Source

mkv_this-0.1.11-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file mkv-this-0.1.11.tar.gz.

File metadata

  • Download URL: mkv-this-0.1.11.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

File hashes

Hashes for mkv-this-0.1.11.tar.gz
Algorithm Hash digest
SHA256 9b61fd6efa055576431dbf9d7403ddf14d8ae96a750c83f27510c7c88ee131d5
MD5 c06b7b35a5d0b2480db6641b16772310
BLAKE2b-256 be347c7d1fb66f8d1190a0d7d4b6107cfd50dc972522cdbc3d369c02429bd399

See more details on using hashes here.

File details

Details for the file mkv_this-0.1.11-py3.7.egg.

File metadata

  • Download URL: mkv_this-0.1.11-py3.7.egg
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

File hashes

Hashes for mkv_this-0.1.11-py3.7.egg
Algorithm Hash digest
SHA256 e278b5ddb8ec57ee0bbcae13423d60f9e5801fdd477269d006b4f2332370cf00
MD5 069eb5f8ea0e746fc1bad14c7a52adf6
BLAKE2b-256 d78a4c52335b4acf26a9f5daa3c6dfc20e80ae88b1ac06b5314eb1b458a6b69e

See more details on using hashes here.

File details

Details for the file mkv_this-0.1.11-py3-none-any.whl.

File metadata

  • Download URL: mkv_this-0.1.11-py3-none-any.whl
  • Upload date:
  • Size: 20.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

File hashes

Hashes for mkv_this-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 55f5937c926093102521c80b35f344aebe974a05555af3ccd14acde74fefb30b
MD5 b67239eb449ea4f4f566f4836994a50f
BLAKE2b-256 e443b3b261071d30f0f26e21ad53f2fc40ca6a9b0481f4ff3ae9cdec332ef532

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