Skip to main content

For replacing multiple characters in a text

Project description

CharStripper

PyPI - Downloads PyPI - License PyPI - Python Version PyPI PyPI - Wheel PyPI - Implementation

This program replaces multiple characters in a text and also optionally lowers it.

Installation

pip install CharStripper

Usage

You can import this script and use it like this:

from CharStripper.core import CharStripper

cs = CharStripper({'o': 'e', 'r': 't', ' ': ''}, True)
cs.strip('Bo aR L  OS')  # returns 'beatles'

CharStripper class takes one mandatory and one optional input.

  • charsDict Gets a dictionary which replaces the dictionary keys with the dictionary values.
  • isLowercase Is a boolean which returns the value lowercased.

After defining the class, you can call cs.strip('YOUR_TEXT_HERE') for every repetition.

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

CharStripper-0.1.2.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

CharStripper-0.1.2-py3-none-any.whl (3.4 kB view hashes)

Uploaded Python 3

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