Skip to main content

Breaks apart input stream into blocks and pipes each block into newly spawned processes

Project description

Blockpype

Breaks apart input stream into blocks and pipes each block into newly spawned processes

Installing

pip install git+https://github.com/kfzteile24/blockpype.git

Testing

Clone the repository and run visual tests that display each started PID and their output:

  • test/by-byte.sh - should break apart in the middle of the 2-byte character
  • test/by-char.sh - should break apart in the middle of some numbers
  • test/by-line.sh - should break apart nicely line by line

Usage

cat content.txt | blockpype -l 10 other-program --arg-for-program --another-arg "argument value"

It will cut content.txt into blocks of 10 lines, and for each block, a process will be started using the command:

other-program --arg-for-program --another-arg "argument value"

and the contents of the block will be served to stdin

What's it for?

Whenever you want to break apart a large stream when the other-program consumer stores it into memory until EOF, and you don't have enough memory for it.

Similar to split --filter "other-program --arg-for-program --another-arg \"argument value\"" except less clunky, other-program gets launched from current pwd with the current user, and with the current environment variables.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

blockpype-1.0.0a1-py3.7.egg (4.7 kB view details)

Uploaded Egg

File details

Details for the file blockpype-1.0.0a1-py3.7.egg.

File metadata

  • Download URL: blockpype-1.0.0a1-py3.7.egg
  • Upload date:
  • Size: 4.7 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for blockpype-1.0.0a1-py3.7.egg
Algorithm Hash digest
SHA256 88cf958d60cf3db6aba9d58f7f2679d901fcc3b71bb139890ebf5fbd489db842
MD5 60a9cd0489a2875d3e3aaa757fde281d
BLAKE2b-256 57ccc79a9682dc1bf29f68613d5300bf5778ae60fe15e140949a55d8052d044e

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