Giter Site home page Giter Site logo

microparts / configuration-python Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 0.0 31 KB

Configuration module for microservices written on Python. Specially created for follow up corporate standards of application configuration.

License: MIT License

Python 100.00%
python python3 configuration yaml corporate standards microservices

configuration-python's Introduction

Python Microservice configuration module

CircleCI

THIS PACKAGE PERMANENTLY MOVED TO https://github.com/spacetab-io/configuration-python


Configuration module for microservices written on Python. Specially created for follow up corporate standards of application configuration.

Installation

pip3 install config_pkg

Usage

By default path to configuration directory and application stage loading from /configuration with defaults stage.

  1. Simple
from config_pkg import PKG

pkg = PKG()
pkg.load()

all_config = pkg.get_all()
foo_bar = pkg.get('foo.bar')
  1. If u would like override default values, you can pass 2 arguments to class constructor or set up use setters.
from config_pkg import PKG

pkg = PKG('/configuration', 'test')
pkg.load()

foo_bar = pkg.get('key') # full example on the top
  1. If the operating system has an env variables CONFIG_PATH and STAGE, then values for the package will be taken from there.
export CONFIG_PATH=/configuration
export STAGE=test
from config_pkg import PKG

pkg = PKG()
pkg.load() # loaded files from /configuration for prod stage.

foo_bar = pkg.get('key') # full example on the top
  1. If u want to see logs and see how load process working, pass you application logger to the following method:
from config_pkg import PKG

pkg = PKG(logger=logger) # loggining.Logger compatible logger
pkg.load() 

foo_bar = pkg.get('key') # full example on the top

That all.

Depends

  • Python 3.x
  • pip for install package

License

MIT

configuration-python's People

Contributors

roquie avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.