Text Management Python scripts - Top 4 Download

Text Management Python script downloads

Safe Eval

This script evaluates constant expressions, including list, dict and tuple using the abstract syntax tree created by compiler.parse. Since compiler does the work, handling arbitratily nested structures is transparent, the implemenation is very straightforward. ...
Python

Changing the indentation of a multi line string

When working with text, it may be necessary to change the indentation level of a block. This code will take a multiline string and add or remove leading spaces to each line so that the indentation level of the block matches some absolute number of spaces. ...
Python

Yet Another Python Templating Utility YAPTU

"Templating" (copying an input file to output, on the fly inserting Python expressions and statements) is a frequent need, and YAPTU is a small but complete Python module for that; expressions and statements are identified by arbitrary user-chosen regular-rexpressions. ...
Python

Retrieving a line at random from a file

This procedure reads through a file of unknown size once, returning a random line from the file. ...
Python

Split String into n size pieces

This script takes a string and returns a list containing the n-sized pieces of the string. ...
Python

Fill paragraph

This module contains a function that formats paragraphs of text to have a certain linewidth, optionally stretching lines to that width by filling word gaps with spaces. In other words, it does left-justified/word-wrapped and block formatted paragraphs. ...
Python

Doctester for your documentation

The doctester extracts code from stdin and tests it using the doctest module in the standard library. It can be invoked from the command line, but it is best called from you editor of choice. ...
Python

Marshal unicode strings with PyXML

If you want to serialize Python objects to XML then PyXML is a good choice. Except in the case when unicode strings come into play. In this case generic.Marshaller().dump() throws an ugly AttributeError: Marshaller instance has no attribute 'm_unicode' .This script extends both PyXML Marshaller and Unmarshaller to support the de-/serialization ...
Python

Blender Script

This script allows you to run a very simple templating-system. ...
Python

Checking whether a string contains a set of chars

This script contains a function to check on the occurence of a set of characters. ...
Python

LaTeX codec

This script is a codec for converting unicodes to LaTeX markup and vice versa. ...
Python

Good enough templating

This script allows you to try a small, powerful templating language using template strings embedded in standard Python syntax. Templates are valid Python source, compiled directly to bytecode. Variable substitution is performed using 'string.Template'. ...
Python

Accessing Substrings

This script is useful when you want to access portions of a string. For example, you've read a fixed-width record and want to extract the fields. ...
Python

Indent text like email clients

Indent text like email clients script helps you to manage the text identation. ...
Python

Record Jar Parser

This script presents you a method to parse a file like object containing data in the record jar format. ...
Python

Build section numbers for a table of contents

This script shows a way to generate section numbers for a nested document structure. It can be used within a recursive algorithm to build a table of contents. ...
Python

Regular expression point of failure

This script debugs non-matching regular expressions by finding out the maximum parts of the pattern and the text that do match. ...
Python

Expanding and Compressing Tabs

This script is useful when you want to convert tabs in a string to the appropriate number of spaces, or vice versa. ...
Python

Reversing a String by Words or Characters

Reversing a String by Words or Characters script allows you to reverse the characters or words of a string. ...
Python

Missing string functions

Missing string functions script introduces some functions to help you manage international text. ...
Python