https://github.com/zdodson21/replace-text
A Python package that replaces text in a file or directory with new text supplied by the user
https://github.com/zdodson21/replace-text
package pypi-package python
Last synced: 19 days ago
JSON representation
A Python package that replaces text in a file or directory with new text supplied by the user
- Host: GitHub
- URL: https://github.com/zdodson21/replace-text
- Owner: zdodson21
- License: gpl-3.0
- Created: 2025-02-23T20:20:24.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-24T16:40:21.000Z (over 1 year ago)
- Last Synced: 2025-12-21T22:56:50.211Z (6 months ago)
- Topics: package, pypi-package, python
- Language: Python
- Homepage: https://pypi.org/project/replace-text/
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# replace-text
## Links
[PyPI Package Page](https://pypi.org/project/replace-text/)
[GitHub Repo](https://github.com/zdodson21/replace-text?tab=GPL-3.0-1-ov-file)
## Usage
Run `replace-text -h` or `replace-text --help` will display the help menu
```
usage: replace-text [-d] [-h] [-o] [-r] [-v] [target]
positional arguments:
target The target file or directory of files
options:
-d, --developer enables developer console output
-h, --help show this help message and exit
-o , --original-text
the text to be replaced
-r , --replacement-text
the new text to replace the old
-v, --version displays the version number
```
## Contributing
### Local Development
For local development, this project requires the `setuptools` and `wheel` packages.
You can install these tools using `pip` with the following script:
`pip install setuptools wheel`
### Build Script
A build shell script is included which executes this command:
```shell
python3 setup.py sdist bdist_wheel;
```
### Install Locally
An install shell script is included which executes this command:
```shell
pip install dist/replace_text-0.0.1-py3-none-any.whl --force-reinstall;
```
### Testing
The `tests/` directory includes one directory and two test files to test replacing text in a whole directory (`tests/`) or in a single file (`test-file.txt`). You can also run the following test scripts included in the files of this project:
#### Test Directory
```shell
replace-text tests -o test -r new;
```
#### Test File
```shell
replace-text tests/test-file.txt -o test -r new;
```
## Submit Issues / Feature Requests
* [GitHub Issues](https://github.com/zdodson21/replace-text/issues)