Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

A suite text tools for python

Project Description

A suite text tools for python


The lastest stable is py-text-1.2.tar.gz

python install

Getting Start

awk demo for py-text:

from text import awk
data = ['root:x:0:0:root:/root:/bin/bash',
resut = awk.awk(data, None, ':', [0,4,5])
print result

[['root', 'root', '/root'], ['daemon', 'daemon', '/usr/sbin'], ['bin', 'bin', '/bin']]

string_utils demo for py-text:

from text import string_util
print 'substring_before : ' + string_utils.substring_before('one world one dream', 'one dream').strip() + '\n'
print 'abbreviate : ' + string_utils.abbreviate('abcdef', 3, 3) + '\n'
print 'count_matches : ' + string_utils.count_matches('one world one dream', 'one') + '\n'

substring_before : one world
abbreviate : abc***
count_matches : 2

regex_utils demo for py-text:

from text import regex_util
print 'check_line : ' + regex_utils.check_line('.*(\d+.\d+.\d+.\d+)', 'MyIP is') + '\n'
print 'parse_line : ' + str(regex_utils.parse_line('name=(\S+), type=(\S+)', 'name=ASA5505, type=Firewall)) + '\n'

check_line : True
parse_line : ['ASA5505', 'Firewall']


Full documentation is hosted on [HERE](). Sources are available in the docs/ directory.


py-text is licensed under the Apache License, Version 2.0. See LICENSE for full license text

Release History

Release History

This version
History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
py-text-1.2.tar.gz (19.7 kB) Copy SHA256 Checksum SHA256 Source Sep 24, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting