Skip to main content

Binary file wrapper

Project description

py-wrappers

Python wrapper for binary files

Usage

import wrapper

class Helm(wrapper.ExecWrapper):
    """
    helm binary wrapper

    helm = Helm(o='json')
    resp = helm.ls() => `helm ls -o=json`
    resp.raise_for_status()
    print(resp.json)

    helm = Helm()
    helm.repo.add.bitnami('https://charts.bitnami.com/bitnami')

    helm = Helm()
    resp = helm.upgrade.redis('bitnami/redis', install=None, o='json')
    # helm upgrade redis bitnami/redis --install -o json
    # or same
    resp = helm('upgrade', 'redis', 'bitnami/redis', '--install', o='json')
    # helm upgrade redis bitnami/redis --install -o json
    # or
    resp = helm.upgrade.redis('bitnami/redis', i=None, o='json')
    # helm upgrade redis bitnami/redis -i -o json
    """

    def __init__(self, **kwargs):
        super().__init__('helm', **kwargs)

    def __getattr__(self, item):
        h = Helm(**self._parent_kwargs)
        h._parent_attrs = self._parent_attrs.copy()
        h._parent_attrs.append(item.replace('_', '-', -1))

        return h

    def _pre(self, args, parent_kwargs, kwargs):
        ns_short = parent_kwargs.pop('n', None)
        parent_kwargs.setdefault('namespace', ns_short)

        out_short = parent_kwargs.pop('o', None)
        out = parent_kwargs.pop('output', out_short)

        out_short = kwargs.pop('o', out)
        kwargs.setdefault('output', out_short)

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

bin_wrapper-1.0.4-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file bin_wrapper-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: bin_wrapper-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for bin_wrapper-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 82ac34d1d93fbd6adcb74f4740d770b6feaff4c373f84c06cca2f12e5fa36557
MD5 58ae70f873d55e62eb413fa713454e0e
BLAKE2b-256 d964891436b46891808bed19f95fff308fac963206b2b0997bde5ae8787d845e

See more details on using hashes here.

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