Skip to main content

Library of xonsh subprocess specification modifiers.

Project description

Library of xonsh subprocess specification modifiers.

If you like the idea click ⭐ on the repo and tweet.

Installation

To install use pip:

xpip install xontrib-spec-mod
# or: xpip install -U git+https://github.com/anki-code/xontrib-spec-mod

Usage

xontrib load spec_mod

Transform output to object

$(@lines ls /)
# ['/bin', '/etc', '/home']

$(@json echo '{"a":1}')  # Try with `curl` ;)
# dict({"a":1})

$(@path which xonsh)
# Path('/path/to/xonsh')

$(@path which xonsh).parent
# Path('/path/to')


aliases['ydig'] = '@yaml dig +yaml'  # Update `dig` via `brew install bind` to have `+yaml`.
y = $(ydig google.com)
y[0]['type']
# 'MESSAGE'

Error handling

$RAISE_SUBPROC_ERROR = True
if ![@noerr ls nononofile]:  # Do not raise exception in case of error.
    echo file 

Development

# install pre-commit plugins and activate the commit hook
pre-commit install
pre-commit autoupdate

Credits

This package was created with xontrib template.

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

xontrib_spec_mod-0.0.1.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

xontrib_spec_mod-0.0.1-py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page