practical python one-liners
Project description
This module tries to improve Python’s usefulness as a tool for writing shell one-liners.
# show line numbers python -m oneliner -ne '"%5d: %s" % (NR, _)' < input.txt # convert unix timestamp to something more human readable date +%s | pyl -j ' => ' -line '_, datetime.datetime.fromtimestamp(int(_))' # 1355256353 => 2012-12-11 22:05:53 # triple space a file pyl -ne 'line + "\n"*2' < input.txt # double space only non-blank lines: pyl -ne '_ if re.match("^$", _) else _+"\n"' input.txt
- Documentation:
- http://python-oneliner.readthedocs.org/en/latest/
- Development:
- https://github.com/gvalkov/python-oneliner
- Package:
- http://pypi.python.org/pypi/oneliner
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size oneliner-0.2.1-py2.py3-none-any.whl (7.2 kB) | File type Wheel | Python version 3.4 | Upload date | Hashes View |
Filename, size oneliner-0.2.1.tar.gz (5.4 kB) | File type Source | Python version None | Upload date | Hashes View |
Close
Hashes for oneliner-0.2.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 938c7cb330244ddd3688e6b51a373af4d9bc8ab8bfc59ebd56e163d26b31bd99 |
|
MD5 | 5f891699800d725d34a848d912bb4b61 |
|
BLAKE2-256 | 77d54f1077376a0cfd96e5691c7c52315c5cda9dd51b7080308ea39f56a01a6c |