python-rconfig


Namepython-rconfig JSON
Version 20.2.5 PyPI version JSON
download
home_pagehttps://github.com/x-amer-ngmx/python-rconfig
SummaryHelps bring configuration, stored remotely on a ``Consul`` server, to your application
upload_time2024-03-04 06:37:07
maintainer
docs_urlNone
authorArtem Angelchev
requires_python>=3.6,<4
licenseMIT
keywords configurations settings consul env python environment-variables configuration-managment
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            rconfig
=======

  .. image:: https://travis-ci.org/ArtemAngelchev/python-rconfig.svg?branch=master
      :target: https://travis-ci.org/ArtemAngelchev/python-rconfig

  .. image:: https://coveralls.io/repos/github/ArtemAngelchev/python-rconfig/badge.svg?branch=master
      :target: https://coveralls.io/github/ArtemAngelchev/python-rconfig?branch=master

  .. image:: https://badge.fury.io/py/python-rconfig.svg
      :target: https://badge.fury.io/py/python-rconfig

  .. image:: http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat


  ``rconfig`` helps bring configuration, stored remotely on a ``Consul``
  server, to  your application.


Installation
------------

  Install the latest version with:

  ::

    pip3 install -U python-rconfig


  For command-line support, use the CLI option during installation:

  ::

    pip3 install -U "python-rconfig[cli]"


  For command-line and yaml support:

  ::

    pip3 install -U "python-rconfig[cli,yaml]"


Usage
-----

  First off all ``rconfig`` expects that you have the following key structure
  on the consul server:

  ::

    <root-key>
        |____<common-config-key>
        |          |
        |          |___<some-env-key>
        |          |           |_____<key-value>
        |          |           |_____<key-value>
        |          |
        |          |___<another-env-key>
        |                      |_____<key-value>
        |                      |_____<key-value>
        |____<app-config-key>
                   |
                   |___<some-env-key>
                   |           |_____<key-value>
                   |           |_____<key-value>
                   |
                   |___<another-env-key>
                               |_____<key-value>
                               |_____<key-value>


  Here root key stands for the name of the project when some have multiple
  applications that grouped under some kind of common purpose (often when talk
  about microservices).
  Under common configuration key, you should store configurations that common
  to all your applications in the project, in this case, it's much easier to
  change the config in one place than go to multiple.


Command-line Interface
----------------------

  CLI offers you an ability to load config from ``Consul`` (within a few ways)
  without a need of changing application code.

  ::

    Usage: rconfig [OPTIONS] COMMAND [ARGS]...

    Options:
      -h, --host TEXT     Host of a consul server  [required]
      -a, --access TEXT   Access key for a consul server  [required]
      -p, --port INTEGER  Port of consul server  [default: 8500]
      -k, --key TEXT      Consul key  [required]
      --help              Show this message and exit.

    Commands:
      export  Print out bash command export for all found config
      list    Show all config for given keys


  Let's look at few examples.

  ::

    <your-awesome-app>
        |____<prod>
               |___<LOG_LEVEL -> "WARNING">
               |___<LOG_FILE_HANDLER -> 1>


  To load ``prod`` config of ``you-awesome-app``, issue:

  ::

    $ rconfig -h localhost -a access-key -k 'your-awesome-app/prod' list

    {'LOG_LEVEL': 'WARNING',
     'LOG_FILE_HANDLER': 1}


  To export config to different formats, use:

  Bash:
  ::

    $ rconfig -h localhost -a access-key -k 'your-awesome-app/prod' export -f bash

    export LOG_LEVEL='WARNING'
    export LOG_FILE_HANDLER='1'

  ::

    $ rconfig -h localhost -a access-key -k 'your-awesome-app/prod' export -f bash:inline

    export LOG_LEVEL='WARNING' LOG_FILE_HANDLER='1'

  Yaml:
  ::

    $ rconfig -h localhost -a access-key -k 'your-awesome-app/prod' export -f yaml

    LOG_LEVEL: WARNING
    LOG_FILE_HANDLER: 1

  Json:
  ::

    $ rconfig -h localhost -a access-key -k 'your-awesome-app/prod' export -f json

    {"LOG_LEVEL": "WARNING", "LOG_FILE_HANDLER": 1}

  ::

    $ rconfig -h localhost -a access-key -k 'your-awesome-app/prod' export -f json:pretty

    {
        "LOG_LEVEL": "WARNING",
        "LOG_FILE_HANDLER": 1
    }

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/x-amer-ngmx/python-rconfig",
    "name": "python-rconfig",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6,<4",
    "maintainer_email": "",
    "keywords": "configurations,settings,consul,env,python,environment-variables,configuration-managment",
    "author": "Artem Angelchev",
    "author_email": "artangelchev@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/86/eb/50e933ca67124bdc25608eb7ea91957b0edb4cb0c90e027d0d9a05586b70/python_rconfig-20.2.5.tar.gz",
    "platform": null,
    "description": "rconfig\n=======\n\n  .. image:: https://travis-ci.org/ArtemAngelchev/python-rconfig.svg?branch=master\n      :target: https://travis-ci.org/ArtemAngelchev/python-rconfig\n\n  .. image:: https://coveralls.io/repos/github/ArtemAngelchev/python-rconfig/badge.svg?branch=master\n      :target: https://coveralls.io/github/ArtemAngelchev/python-rconfig?branch=master\n\n  .. image:: https://badge.fury.io/py/python-rconfig.svg\n      :target: https://badge.fury.io/py/python-rconfig\n\n  .. image:: http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat\n\n\n  ``rconfig`` helps bring configuration, stored remotely on a ``Consul``\n  server, to  your application.\n\n\nInstallation\n------------\n\n  Install the latest version with:\n\n  ::\n\n    pip3 install -U python-rconfig\n\n\n  For command-line support, use the CLI option during installation:\n\n  ::\n\n    pip3 install -U \"python-rconfig[cli]\"\n\n\n  For command-line and yaml support:\n\n  ::\n\n    pip3 install -U \"python-rconfig[cli,yaml]\"\n\n\nUsage\n-----\n\n  First off all ``rconfig`` expects that you have the following key structure\n  on the consul server:\n\n  ::\n\n    <root-key>\n        |____<common-config-key>\n        |          |\n        |          |___<some-env-key>\n        |          |           |_____<key-value>\n        |          |           |_____<key-value>\n        |          |\n        |          |___<another-env-key>\n        |                      |_____<key-value>\n        |                      |_____<key-value>\n        |____<app-config-key>\n                   |\n                   |___<some-env-key>\n                   |           |_____<key-value>\n                   |           |_____<key-value>\n                   |\n                   |___<another-env-key>\n                               |_____<key-value>\n                               |_____<key-value>\n\n\n  Here root key stands for the name of the project when some have multiple\n  applications that grouped under some kind of common purpose (often when talk\n  about microservices).\n  Under common configuration key, you should store configurations that common\n  to all your applications in the project, in this case, it's much easier to\n  change the config in one place than go to multiple.\n\n\nCommand-line Interface\n----------------------\n\n  CLI offers you an ability to load config from ``Consul`` (within a few ways)\n  without a need of changing application code.\n\n  ::\n\n    Usage: rconfig [OPTIONS] COMMAND [ARGS]...\n\n    Options:\n      -h, --host TEXT     Host of a consul server  [required]\n      -a, --access TEXT   Access key for a consul server  [required]\n      -p, --port INTEGER  Port of consul server  [default: 8500]\n      -k, --key TEXT      Consul key  [required]\n      --help              Show this message and exit.\n\n    Commands:\n      export  Print out bash command export for all found config\n      list    Show all config for given keys\n\n\n  Let's look at few examples.\n\n  ::\n\n    <your-awesome-app>\n        |____<prod>\n               |___<LOG_LEVEL -> \"WARNING\">\n               |___<LOG_FILE_HANDLER -> 1>\n\n\n  To load ``prod`` config of ``you-awesome-app``, issue:\n\n  ::\n\n    $ rconfig -h localhost -a access-key -k 'your-awesome-app/prod' list\n\n    {'LOG_LEVEL': 'WARNING',\n     'LOG_FILE_HANDLER': 1}\n\n\n  To export config to different formats, use:\n\n  Bash:\n  ::\n\n    $ rconfig -h localhost -a access-key -k 'your-awesome-app/prod' export -f bash\n\n    export LOG_LEVEL='WARNING'\n    export LOG_FILE_HANDLER='1'\n\n  ::\n\n    $ rconfig -h localhost -a access-key -k 'your-awesome-app/prod' export -f bash:inline\n\n    export LOG_LEVEL='WARNING' LOG_FILE_HANDLER='1'\n\n  Yaml:\n  ::\n\n    $ rconfig -h localhost -a access-key -k 'your-awesome-app/prod' export -f yaml\n\n    LOG_LEVEL: WARNING\n    LOG_FILE_HANDLER: 1\n\n  Json:\n  ::\n\n    $ rconfig -h localhost -a access-key -k 'your-awesome-app/prod' export -f json\n\n    {\"LOG_LEVEL\": \"WARNING\", \"LOG_FILE_HANDLER\": 1}\n\n  ::\n\n    $ rconfig -h localhost -a access-key -k 'your-awesome-app/prod' export -f json:pretty\n\n    {\n        \"LOG_LEVEL\": \"WARNING\",\n        \"LOG_FILE_HANDLER\": 1\n    }\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Helps bring configuration, stored remotely on a ``Consul`` server, to  your application",
    "version": "20.2.5",
    "project_urls": {
        "Homepage": "https://github.com/x-amer-ngmx/python-rconfig",
        "Repository": "https://github.com/x-amer-ngmx/python-rconfig"
    },
    "split_keywords": [
        "configurations",
        "settings",
        "consul",
        "env",
        "python",
        "environment-variables",
        "configuration-managment"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "92192dac39e920c7b4b0f682d89693fff275cd8234d15792c8f812365ac13946",
                "md5": "121172918307626ecd9ab7c9a9bb7070",
                "sha256": "211bd8c1b1fbe66e46714fe7eefa62ac714852c364eaa11582a409d3ce0a93a5"
            },
            "downloads": -1,
            "filename": "python_rconfig-20.2.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "121172918307626ecd9ab7c9a9bb7070",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6,<4",
            "size": 6405,
            "upload_time": "2024-03-04T06:37:05",
            "upload_time_iso_8601": "2024-03-04T06:37:05.299537Z",
            "url": "https://files.pythonhosted.org/packages/92/19/2dac39e920c7b4b0f682d89693fff275cd8234d15792c8f812365ac13946/python_rconfig-20.2.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "86eb50e933ca67124bdc25608eb7ea91957b0edb4cb0c90e027d0d9a05586b70",
                "md5": "0fe82897855b7a5620999d36dd1f83c3",
                "sha256": "4bd566d66d1acf1d4af8077021d190524751d7938194641bd179648d0198c531"
            },
            "downloads": -1,
            "filename": "python_rconfig-20.2.5.tar.gz",
            "has_sig": false,
            "md5_digest": "0fe82897855b7a5620999d36dd1f83c3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6,<4",
            "size": 5306,
            "upload_time": "2024-03-04T06:37:07",
            "upload_time_iso_8601": "2024-03-04T06:37:07.223903Z",
            "url": "https://files.pythonhosted.org/packages/86/eb/50e933ca67124bdc25608eb7ea91957b0edb4cb0c90e027d0d9a05586b70/python_rconfig-20.2.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-04 06:37:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "x-amer-ngmx",
    "github_project": "python-rconfig",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "tox": true,
    "lcname": "python-rconfig"
}
        
Elapsed time: 0.19441s