Skip to main content

A package that helps cut up text for creative writers

Project description

#HELLO AND WELCOME TO THE READ.ME for TextCutUps

This package lets you create 'cut ups' with text in the style of William Burroughs. I had always wanted to make a package that does this, so thought I'd have a try. this can let you arrange text in new ways where you may get surprising new connections between lines etc.

To work this package also imports textwrap module from python

INSTALLING

do a pip install textcutups

then:

from Textcutpackage import textcuts

THE PACKAGE CONTENTS

The package lets you do this through a few ways. Depending on the way you choose you may need to import textwrap from python or install nltk and import it's sent_tokenize.

Okay so here are the ways you can cut up text:

  • Cutting a page into 4 sections by sentence (you will first need to install nltk package and import sent_tokenize). This method will take each sentence and use this to create the sections.
  • Cutting a page into 4 sections by line (you will need to import textwrap from python to get this working). This method takes each line and cuts it, in order to make the sections
  • Creating a fold from two texts (you will need to also import textwrap to get this working). This method puts a cut down the middle of a page. You can then combine the two texts.

You can also play with the parameters for each function. However for each one you will need to have stored your text as 'texts'. Or enter the text as a 'string'

- linecutup() is the function that cuts up by lines

Here you will have the parameters

  • texts : this is where you store your text in a previous variable, this will go first
  • line : this lets you detrmine the length of the line read in. The default is 80 characters long
  • cut : this let's you say where you want the cut to be made. 0.2 will be 20% of the way through the line 0.5 will be 50% of the way throguh the line 0.8 will be 80% of the way through the line and so on. The default is 0.5 which makes a cut 50% through the line
  • order : this will let you choose which order to rearrange the text in. Currently these are preset orders, so you pick either 1,2, 3 or 4. By Default it is set to 1. There is more information on orders toward the bottom of the page.

EXAMPLE: linecutup(texts,line = 80,cut = 0.5,order = 1)

foldtext() has a similar approach

However for this function you will have two texts. e.g.

foldtext (text1, text2, line, cut, order = 1)

The parameters are again the same

Here you will have the parameters

  • text1 : this is where you store your first text

  • text2 : this is where you store your first text

  • line : this lets you detrmine the length of the line read in. Default is 80 characters

  • cut : this let's you say where you want the cut to be made. 0.2 will be 20% of the way through the line 0.5 will be 50% of the way throguh the line 0.8 will be 80% of the way through the line and so on. The default is 0.5 which makes a cut 50% through the line

  • order : this will let you choose which order to rearrange the text in. Currently these are preset orders, so you pick either 1,2, 3 or 4. By default it is set to 1.

  • cutsent() is the version that uses sentences (you will need to install nltk package to do this and use its sent_tokenize). This version also has less parameters than the other options currently.

##A little note on orders.##

  • Here the page is essentially split into 4 sections and named A1,A2,B1 B2. If we were looking at the page this would be splitting it into

  • A1 A2

  • B1 B2

Once the page has been cut into these sections you can then rearrange them. E.g

if we start with the below sections

  • A1 A2
  • B1 B2

it could be rearranged to:

  • B2 A2
  • B1 A1

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

TextCutUps-0.0.4.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

TextCutUps-0.0.4-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file TextCutUps-0.0.4.tar.gz.

File metadata

  • Download URL: TextCutUps-0.0.4.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.22.0 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.32.1 importlib-metadata/4.11.2 keyring/18.0.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.3

File hashes

Hashes for TextCutUps-0.0.4.tar.gz
Algorithm Hash digest
SHA256 bac0751e8685fb373d7a569c5c271207a2004a497b642880e39ca39a05b67428
MD5 bee29e42428546fc9a1a01fb69775032
BLAKE2b-256 82d5551306e98bf145b9822d251c68a12ec4232f43e3e117969d613f6b0af2f7

See more details on using hashes here.

File details

Details for the file TextCutUps-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: TextCutUps-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.22.0 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.32.1 importlib-metadata/4.11.2 keyring/18.0.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.3

File hashes

Hashes for TextCutUps-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 86a4753fa3cea2885348d012d9bddd4868106ca37b3602d8662dd188eb3bce6b
MD5 e330cff7c081ececf872687b98acc0e8
BLAKE2b-256 376d0c9c579a4d8458388faebf65723ca4f667ece17577b1b06ec2e3e92cdfeb

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