https://github.com/donno2048/pyp3
pyp3 upload to pypi
https://github.com/donno2048/pyp3
cli python python-package text-manipulation
Last synced: over 1 year ago
JSON representation
pyp3 upload to pypi
- Host: GitHub
- URL: https://github.com/donno2048/pyp3
- Owner: donno2048
- License: bsd-2-clause
- Created: 2021-08-06T13:12:01.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-01-15T15:49:43.000Z (over 2 years ago)
- Last Synced: 2025-01-06T16:48:23.034Z (over 1 year ago)
- Topics: cli, python, python-package, text-manipulation
- Language: Python
- Homepage:
- Size: 43 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pyp3
A minified [pyp](https://code.google.com/archive/p/pyp/) compatible with python3
Pyp is a linux command line text manipulation tool similar to awk or sed, but which uses standard python string and list methods as well as custom functions evolved to generate fast results in an intense production environment.
## Installation
### From PyPI
```sh
pip3 install pyp3
```
### From GitHub
```sh
pip3 install git+https://github.com/donno2048/pyp3
```
## Usage
Because pyp employs it's own internal piping syntax ("|") similar to unix pipes, complex operations can be proceduralized by feeding the output of one python command to the input of the next.
This greatly simplifies the generation and troubleshooting of multistep operations without the use of temporary variables or nested parentheses. The variable "p" represents each line as a string, while "pp" is entire input as python list
### Use it directly
```sh
ls | pyp3 "p[0] | pp.sort()" #gives sorted list of first letters of every line
```
## Use it as a python module
```sh
ls | python3 -m pyp3 "p.replace('.', ',')" #replaces . with ,
```