https://github.com/sthysel/knobs
Python knobs
https://github.com/sthysel/knobs
12-factor env environment environment-variables knobs python
Last synced: 5 months ago
JSON representation
Python knobs
- Host: GitHub
- URL: https://github.com/sthysel/knobs
- Owner: sthysel
- License: mit
- Created: 2017-05-04T17:58:23.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2021-09-29T01:16:30.000Z (over 4 years ago)
- Last Synced: 2025-09-22T09:58:19.015Z (5 months ago)
- Topics: 12-factor, env, environment, environment-variables, knobs, python
- Language: Python
- Size: 108 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
=============================================================
Knobs (Version 2.1.1 ) are used to tune environment variables
=============================================================
.. image:: https://badge.fury.io/py/knobs.svg
:target: https://badge.fury.io/py/knobs
.. image:: https://readthedocs.org/projects/knobs/badge/?version=latest
:target: http://knobs.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: https://github.com/sthysel/knobs/blob/master/docs/knob.jpg?raw=true
.. code:: python
>>> pirates = Knob('JOLLY_ROGER_PIRATES', 124, description='Yar')
>>> pirates.get()
124
>>> pirates.get_type()
>>>
Use ``knobs`` if you worship at the church of the `12 Factor App `_
A knob is a wrapper for an environment variable. It can:
* Read and write an environment variable
* Make sure it is of the expected type
* Validate a value is good.
``knobs`` will search for a nominated environmental file (default ``.env``) and load that
into the environment. A knob is type aware, configured from the environment and its value can be
persisted to ease the creation of configuration files.
Install
=======
Install from pypi
.. code::
$ pip install knobs
Install from source
.. code::
$ pip install .