🐉 pythoned
PYTHON EDitor: a command to edit lines using Python expressions
For Pythonistas always forgetting the syntax of
sed/awk/grep/tr
install
pip install pythoned
(it sets up pythoned in your PATH)
edit mode
You provide a Python str expression, manipulating the line stored in the _ variable (an str):
# get last char of each line
echo -e 'f00\nbar\nf00bar' | pythoned '_[-1]'
output:
0
r
r
filter mode
If the provided expression is a bool instead of an str, then the lines will be filtered according to it:
# keep only lines containing 2 consecutive zeros
echo -e 'f00\nbar\nf00bar' | pythoned '"00" in _'
output:
f00
f00bar
flatten mode
If the provided expression is an Iterable, then its elements will be flattened as separate output lines:
# flatten the chars
echo -e 'f00\nbar\nf00bar' | pythoned 'list(_)'
output:
f
0
0
b
a
r
f
0
0
b
a
r
generator mode
If the _ variable is not used and the expression is an Iterable, then its elements will be separate output lines:
iterables:
# generate ints
pythoned 'range(5)'
output:
0
1
2
3
4
modules
Modules are auto-imported, example with re and json:
# replace digits by Xs in the "bar" field
echo -e '{"bar": "f00"}\n{"bar": "foo"}' | pythoned 're.sub(r"\d", "X", json.loads(_)["bar"])'
output:
fXX
foo
Metadata
Release files for pythoned 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pythoned-0.0.5.tar.gz | 3.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pythoned-0.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.2 kB
Release files / pythoned-0.0.5.tar.gz
| Download URL | pythoned-0.0.5.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a21e8831bbe38d751d0655ac39f62d4b2aaae58ccaebe0a5e6b8d76fbee072b3
|
|
BLAKE2b-256 checksum How to use checksums |
d44bb7874253a13405047d1d7e6b42b3f99c2368617cffb0a2cbd80188da996a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Release files / pythoned-0.0.5-py3-none-any.whl
| Download URL | pythoned-0.0.5-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7e0f723f10809d9bf3854be35ade86988803bcb009a6324e03c84bfda4cf15ea
|
|
BLAKE2b-256 checksum How to use checksums |
32cce2e9dfe0f560434f073c8f7252c35c303898e09f0b780ee75a3ed0a5949a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Security for pythoned 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.