Skip to main content

Python viper

Project description

Python Viper

This project was inspired by spf13/viper.

Installation

pip install py-viper

Usage

Using viper.bind_flags in fire

import fire
import viper


@viper.bind_flags(flags=[
    viper.Flag(name='name', value='foo', usage='Indicate name'),
])
def hello():
    return "Hello %s!" % viper.get('name')


if __name__ == '__main__':
    fire.Fire(hello)

Reading config by viper

viper.set_config_path(_absolute_path('test.yml'))
viper.read_config()
self.assertEqual('foo', viper.get('hello.name'))

TODO

  • Read remote config

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

py-viper-0.1.0.dev1.tar.gz (3.2 kB view hashes)

Uploaded Source

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