Skip to main content

Write a temporary file and pass it to a program

Project description

shell-piper

Shell-piper is a commandline program made to write to a temporary file with your editor and pass that file's contents to an external program through various methods.

Installation

The recommended way to install shell-piper is through pipx (pipx install shell-piper). Arch users can also install shell-piper from the AUR.

You can also clone this repository and build shell-piper manually:

git clone 'https://github.com/Mrfiregem/shell-piper.git'
cd shell-piper
flit install

Quickstart

Stdin Mode

Copy and paste text into your editor and modify it with awk:

shellpiper -- awk -F $'\t' '{ print $2 }'

Argument Mode

Convert pasted html into markdown with pandoc:

shellpiper --type argument -- pandoc '{piper:file}' --from html -o converted.md

The argument {piper:file} will be expanded by shell-piper to the full path of the temporary file. If this argument is not present, the file path will be appended as the last argument.

Expand Mode

Pass a list of urls to download with youtube-dl, with each line as an argument:

shellpiper -t x youtube-dl

Usage

usage: shellpiper [-h] [-v] [-V] [-t TYPE] [-k] program [args ...]

Write a temporary file and pass it to a program

positional arguments:
  program               The program to pass your file to
  args                  Arguments to pass to the program

options:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  -V, --verbose         Show debug messages
  -t TYPE, --type TYPE  How the file will be given to the program
  -k, --keep-empty      Don't remove empty lines when using '--type expand'

Use '--' to prevent command flags to the right of it being parsed by piper.

The '--type' flag can take values 'stdin' (default), 'argument', or 'expand',
or the letters 's', 'a', or 'x', respectively. This determines how the file is
passed to your program by shellpiper.

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

shell-piper-0.7.2.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

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

shell_piper-0.7.2-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file shell-piper-0.7.2.tar.gz.

File metadata

  • Download URL: shell-piper-0.7.2.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.2

File hashes

Hashes for shell-piper-0.7.2.tar.gz
Algorithm Hash digest
SHA256 aeb0d9ed8ff055b3c4bd9ab8906b4c00bf92ba243628f3bbf67b2f9cf2da9eb9
MD5 eaf07b6a37807c8936d8555215750e74
BLAKE2b-256 838cfc7779e5a675304bcdc8322820839c88a89ce9fae44cd0acae5429213725

See more details on using hashes here.

File details

Details for the file shell_piper-0.7.2-py3-none-any.whl.

File metadata

  • Download URL: shell_piper-0.7.2-py3-none-any.whl
  • Upload date:
  • Size: 17.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.2

File hashes

Hashes for shell_piper-0.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d408dc0bafc6e2158d4fc4f8d41f9c1420fea9aafe80c6d203e255b0bcaab2a8
MD5 15ebe4cd2430913e47bf8a6d7aa2875f
BLAKE2b-256 9b42b071f725418593aca42763f99b2ec0daae0fbb814a290c01bae3cf9ff683

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