For replacing multiple characters in a text
Project description
CharStripper
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
Release history Release notifications | RSS feed
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.1.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for CharStripper-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ec8ca3471218b8a937fe213294f72f741097157ccb56d530f7bc5c9f32ee422 |
|
MD5 | a1eff6f46c728de5c8de90d2d63df2b4 |
|
BLAKE2b-256 | 5ea0f665a57e434a852480d495da0474bdce7ea25ec13818842aef665b0600d4 |