Skip to main content

A package that helps cut up text for creative writers

Reason this release was yanked:

Fixing small error with importing textwrap that helps this package run

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.

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.3.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.3-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: TextCutUps-0.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 abded5ec97ad9e10c8818ce547a69ae7a04c6d52830ce8baee090843a2a14805
MD5 233949174982663cd035fa1c89c4c58f
BLAKE2b-256 56de9b4ccf5ad0a6022a832f6650d09dc2b05ec9491de8b6a4878ee1c66a57a1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: TextCutUps-0.0.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9b0c86520a8f3f710f9cf6bda50b00f52838206ee4d301ffe3f55c038250e759
MD5 ee3fe4071cffdafd6c18462651b0c3c1
BLAKE2b-256 e3156b6ddefeebbf657635abf8a416fc8bb44e583c4b9b03b7e244a2575e0b42

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