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.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for bin_wrapper-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 baf9b1ffefb7a29d2b789d9c6ad2e7e82f9157af4ac17a871078bc0c7d2e88b6
MD5 ecaaba6b86d7e1d839003d1bad3907e4
BLAKE2b-256 19677502818dbce6c0660cb3f9fb746610dd49bddbdb5c34b14b07a423a47e67

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