Perform regex-replacement on stdin and output result to stdout.
Go to file
2023-03-20 19:54:46 +01:00
archlinux add python-setuptools 2022-06-23 23:28:31 +02:00
src v0.1.0 2023-03-16 18:17:45 +01:00
test docs: update tests/examples 2023-03-20 19:54:46 +01:00
.gitignore add PKGBUILD 2022-06-23 15:19:17 +02:00
LICENSE init 2022-06-23 14:50:49 +02:00
Makefile init 2022-06-23 14:50:49 +02:00
pyproject.toml init 2022-06-23 14:50:49 +02:00
README.md v0.1.0 2023-03-16 18:17:45 +01:00
setup.cfg v0.1.0 2023-03-16 18:17:45 +01:00

py-regex-replace

Perform regex-replacement on stdin and output result to stdout.

Usage

usage: py-regex-replace [-h] --pattern PATTERN --repl REPL [--count COUNT]

options:
  -h, --help            show this help message and exit
  --pattern PATTERN, -p PATTERN
                        regex search pattern
  --repl REPL, -r REPL  replacement
  --count COUNT, -c COUNT
                        expected count of pattern in string. -1 allows any
                        count
usage: py-replace [-h] --text TEXT --repl REPL [--count COUNT]

options:
  -h, --help            show this help message and exit
  --text TEXT, -t TEXT  text to replace
  --repl REPL, -r REPL  replacement
  --count COUNT, -c COUNT
                        expected count of text in string. -1 allows any
                        count

Examples

Some small example scripts can be found in ./test. They can be run from inside the test directory:

cd test
./test.sh

Installation

make install

Uploading to TestPyPI

More detailed instructions can be found at https://packaging.python.org/tutorials/packaging-projects/

  1. Set up a venv
  2. Increase/Adjust [metadata][version] in setup.cfg
  3. Install the build and twine modules to your venv.
  4. Next generate a distribution archive:
python3 -m build
  1. Upload the distribution packages with twine. For the username, use __token__. For the password, use a test.pypi.org API token:
python3 -m twine upload --repository testpypi dist/*
  1. Congratulations! You can view the uploaded module under: