Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yagiziskirik/charstripper
For replacing multiple characters in a text
https://github.com/yagiziskirik/charstripper
python python3 replace replace-text text text-replacement
Last synced: about 2 months ago
JSON representation
For replacing multiple characters in a text
- Host: GitHub
- URL: https://github.com/yagiziskirik/charstripper
- Owner: yagiziskirik
- License: mit
- Created: 2022-12-14T01:42:12.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-01-10T18:42:18.000Z (almost 2 years ago)
- Last Synced: 2024-10-07T09:48:42.264Z (3 months ago)
- Topics: python, python3, replace, replace-text, text, text-replacement
- Language: Python
- Homepage: https://pypi.org/project/CharStripper/
- Size: 34.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# CharStripper
![PyPI - Downloads](https://img.shields.io/pypi/dm/charstripper) ![PyPI - License](https://img.shields.io/pypi/l/charstripper) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/charstripper) ![PyPI](https://img.shields.io/pypi/v/charstripper) ![PyPI - Wheel](https://img.shields.io/pypi/wheel/charstripper) ![PyPI - Implementation](https://img.shields.io/pypi/implementation/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 CharStrippercs = 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.