Skip to main content

No project description provided

Project description

gnar

Shred the gnar in Python by using (half) pipes!

Various shell builtins are implemented, allowing for piping commands together.

gnar.Pipeable can be implemented on an arbitrary class; this class only requires you to implement Pipeable.run that takes a single parameter.

Examples

"/some/dir" | ls | cat | sed(r"this", r"that")

The above example replaces all occurrences of this with that for all files in /some/dir. Since ls() returns a list, cat() and sed() operate on each file in the list.

Notice that both ls and cat can be used with out parenthesis; this is due to their constructors not requiring any parameters. Functions like sed, and others that require constructor parameters, must be called with parenthesis.

>>> "one:two:three:four" | cut([2,3], ":")
['two', 'three']

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

gnar-0.1.2.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

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

gnar-0.1.2-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file gnar-0.1.2.tar.gz.

File metadata

  • Download URL: gnar-0.1.2.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.7

File hashes

Hashes for gnar-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ef309f72fb0fe0a3bdbb5cd6a51259fb42317644ab75895ccee50a4d8947aa74
MD5 95dd0c89f7d0d4a8aeb5960437f7c339
BLAKE2b-256 a0ba8e4ef10160dc431f313252f006f35b05e843e63371ec80df02f671cb9cc1

See more details on using hashes here.

File details

Details for the file gnar-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: gnar-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.7

File hashes

Hashes for gnar-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 89c0d1b3b0abc40216444d59462aae160e9fda94c279f46e949a31e2d9c580eb
MD5 d049c72b03dc3bbdd94582828ca8d441
BLAKE2b-256 388443ccac15e241b41228fa25f3e536c78870fb4ec91b524802113304975617

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