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.2.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for CharStripper-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f339079f7916701cd8c9f99a2713b603b23b8d93c76d9824248c9a02b55813a |
|
MD5 | 195564fa6fd1ca2461a817950ef40526 |
|
BLAKE2b-256 | 86b94dd00ef8ff395125e25843a84cc4977d4011dfa92c8b9bb0362afc106b21 |