Skip to main content

PYTHON EDitor: cli to edit lines via Python expressions

Project description

Actions Status Actions Status

🐉 pythoned

PYTHON EDitor: CLI tool to edit lines using Python expressions

For Pythonistas tired of forgetting the syntax/options of sed/awk/grep/tr

install

pip install pythoned

(it sets up pythoned in your PATH)

edit

You provide a Python str expression, manipulating the line stored in the _: str variable:

# get last char of each line
echo -e 'f00\nbar\nf00bar' | pythoned '_[-1]'

output:

0
r
r

filter

If the provided expression is a bool instead of an str, then the lines will be filtered according to it:

# keep only lines whose length equals 3
echo -e 'f00\nbar\nf00bar' | pythoned '"00" in _'

output:

f00
f00bar

modules

Modules are auto-imported, example with re:

# replace digits by Xs
echo -e 'f00\nbar\nf00bar' | pythoned 're.sub(r"\d", "X", _)'

output:

fXX
bar
fXXbar

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pythoned-0.0.3.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pythoned-0.0.3-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file pythoned-0.0.3.tar.gz.

File metadata

  • Download URL: pythoned-0.0.3.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for pythoned-0.0.3.tar.gz
Algorithm Hash digest
SHA256 5bf7c0a61d94e7daeebd62d685ed1a3fa9fbff5312b284be274584a2d57b6a26
MD5 8945e855875de291442198ebd56f184e
BLAKE2b-256 960623ab1e311ac0f7c6778e8c2f0550a759071955b5ebe243bc47cdc9b758e6

See more details on using hashes here.

File details

Details for the file pythoned-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: pythoned-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for pythoned-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 73b8f8a1e664ea9711b8f61be5666f9131e04ad7937eb404f473bbba9583bc11
MD5 966ce08677684085c91ed230b966a072
BLAKE2b-256 ce67fc6453241ab9663803f45803f088d7d0e0e2d47148321098a898e68c65b9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page