Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ryuichiueda/opy
onelinerers' Python, which works like AWK
https://github.com/ryuichiueda/opy
Last synced: 2 days ago
JSON representation
onelinerers' Python, which works like AWK
- Host: GitHub
- URL: https://github.com/ryuichiueda/opy
- Owner: ryuichiueda
- License: mit
- Created: 2019-08-29T03:47:18.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-07-03T00:47:06.000Z (over 3 years ago)
- Last Synced: 2024-08-02T16:47:08.765Z (3 months ago)
- Language: Python
- Homepage: https://snapcraft.io/opy
- Size: 172 KB
- Stars: 45
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- my-awesome-starred - ryuichiueda/opy - onelinerers' Python, which works like AWK (Python)
- awesome-for-oneliner - opy - A Python wrapper which works like AWK (AWK-like Tools / Open USP Tsukubai)
README
# opy: onelinerers' Python
a Python wrapper that works like AWK or rb command
## example of use
```
$ seq 3 | opy '[math.sin(F1)]'
0.8414709848078965
0.9092974268256817
0.1411200080598672
```* See [EXAMPLES.md](./EXAMPLES.md)
## install
### the simplest way
You can install `opy` with
```
$ chmod +x opy
$ sudo cp opy /usr/local/bin/ # Please check PATH.
```since `opy` is an independent script file.
### make
The `opy` file and its manual are copied to `/usr/local/bin/` and `/usr/local/share/man/man1/` respectively with the following command.
```
$ sudo make install
```### homebrew
The version remains old because I don't have a Mac PC anymore...
```
$ brew tap ryuichiueda/oneliner-python
$ brew install oneliner-python
```## options
See [EXAMPLES.md](./EXAMPLES.md)
* `-b`: buffer the standard output
* `-c`: read each line as CSV data
* `-C`: output data with a CSV format
* `-s`: treat numbers from input data as strings
* `-i `: separators change input field separators
* `-I `: separators change input field separators with a regular expression
* `-m `: modules import modules
* `-o `: separators change output field separators
* `-v =`: define a variable from a string on the shell
* `-t `: tree mode (read a json/yaml/xml/csv/xslx file entirely and set the data to an object "T".)
* `--help`: show help