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.
charsDictGets a dictionary which replaces the dictionary keys with the dictionary values.isLowercaseIs 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file CharStripper-0.1.2.tar.gz.
File metadata
- Download URL: CharStripper-0.1.2.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42123909833151f8ce532f481d55f055e8cc1c6f7142207fdff0a26b02eb2ea9
|
|
| MD5 |
800fd87b1a7c194b8242a8afc0acd488
|
|
| BLAKE2b-256 |
c81ad5a2000612b1243aa805cdc0fcf363efe19bf8c06e0bede5e595082eb8b0
|
File details
Details for the file CharStripper-0.1.2-py3-none-any.whl.
File metadata
- Download URL: CharStripper-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f339079f7916701cd8c9f99a2713b603b23b8d93c76d9824248c9a02b55813a
|
|
| MD5 |
195564fa6fd1ca2461a817950ef40526
|
|
| BLAKE2b-256 |
86b94dd00ef8ff395125e25843a84cc4977d4011dfa92c8b9bb0362afc106b21
|