Skip to main content

awpie

logo

Using Python as awk alternative.

Installation

$ pip install awpie

Usage

Upper case all inputs:

$ printf 'apple\norange\n' | awpie 'print(line.upper())'
APPLE
ORANGE

Change orange to banana:

$ printf 'apple\norange\n' | awpie 'print(line) if line != "orange" else print("banana")'
apple
banana

Local variables

Name Description
line Current line.
fields Result of line.split(sep). sep can be specified in arguments.
data An empty dict, can be used to store custom values.
stdout sys.stdout.
stderr sys.stderr.
filename Name of the file currently being read.
fileno File descriptor for the current file.
lineno Cumulative line number of the line that has just been read.
filelineno Line number in the current file.
isfirstline Whether the line just read is the first line of its file or not.
isstdin Whether the last line was read from sys.stdin or not.
nextfile Close current file so that next iteration will be read from next file.
close Close the sequence.

Metadata

Release files for awpie 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for awpie 0.4.0
File Size Uploaded
awpie-0.4.0.tar.gz 2.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for awpie 0.4.0
File Interpreter ABI Platform
awpie-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.3 kB

Release files / awpie-0.4.0.tar.gz

Download URL awpie-0.4.0.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ea8f8cfbe966754b9a7bd83e8a6629568a94302e343d78d41d349ce07602184e
BLAKE2b-256 checksum
How to use checksums
4857ed072fe1f4a1d5ce4ee0459cf21e2fa4ef801678376d35ea7322a45e5c70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release files / awpie-0.4.0-py3-none-any.whl

Download URL awpie-0.4.0-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6cf1c0dba1fff671b9d2d73a0cb4a53380cd745bb62682d04f0d50e54ded2d2d
BLAKE2b-256 checksum
How to use checksums
3b35d52233cee7a0442b7cf8379b6d10f9df234f7cd6e4d87475c2262c17a8bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page