STReam EDitor
stred processes its intput using a Python regular expression, and
produces output according to an (optional) replacement string and
command-line flags.
It can be used as a replacement for traditional UNIX tools such as
grep and sed, offering more advanced functionality.
Features
- Filter a stream using a regular expression
- Perform search and replace on a stream using a regular expression
- Use the jinja templating language to specify replacement strings
Installation
pipx install stred
Usage: stream filtering
Only print matching lines:
stred -g REGEXP
Do case-insensitive matching:
stred -g -i REGEXP
Only print matches, one per line:
stred -g -o REGEXP
Usage: replacement
Replace the string FOO with BAR:
stred FOO BAR
Use positional groups in the replacement (the two are equivalent):
stred -o "http://([^/]+)/([^ ]*)" "\0:\1"
stred -o "http://([^/]+)/([^ ]*)" "\g<0>:\g<1>"
Use named groups in the replacement:
stred -o "http://(?P<host>[^/]+)/(?P<path>[^ ]*)" "\g<host>:\g<path>"
Same thing using jinja templates:
stred -o "http://(?P<host>[^/]+)/(?P<path>[^ ]*)" "{{ host }}:{{ path }}"
Metadata
Release files for stred 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| stred-0.1.0.tar.gz | 3.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| stred-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.8 kB
Release files / stred-0.1.0.tar.gz
| Download URL | stred-0.1.0.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f2ab66e0abe1e9694313b7901c2867813d6b637e9277fce06c30be8bca3734c
|
|
BLAKE2b-256 checksum How to use checksums |
64689ea007bcaac95c4d30b6d89143ad7fec909a9339a48a91be62b677b24246
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.11
|
Release files / stred-0.1.0-py3-none-any.whl
| Download URL | stred-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e1ebeb463a0c166f9d9b88b8eebe67d2c769851b263b8b3b81cf39c683d07c6a
|
|
BLAKE2b-256 checksum How to use checksums |
cce48c9cfdb2202262d3ed4a7c241ce299441f7b2e1bdfd3c7ab7d14274e1eb0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.11
|