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.0.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for CharStripper-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f128c8780b312c6277f828ee9ab5dd546639c7132dac8fc265e141b5d1536863 |
|
MD5 | 3ebbeedb847f63aa4ef64de5540f535d |
|
BLAKE2b-256 | f274524ca4c41e3e4141f88cfc7702629db088c33510e1e8a83968b038551ea3 |