python-rconfig


Namepython-rconfig JSON
Version 20.2.7 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-09-30 12:43:33
maintainerNone
docs_urlNone
authorArtem Angelchev
requires_python<4,>=3.6
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": null,
    "docs_url": null,
    "requires_python": "<4,>=3.6",
    "maintainer_email": null,
    "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/95/27/cafde97ea0a68e33d9d6103814de1edf0f761ccd32fb9da26c79b54824c5/python_rconfig-20.2.7.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\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Helps bring configuration, stored remotely on a ``Consul`` server, to  your application",
    "version": "20.2.7",
    "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": "ffd9a5fd8064e9bb932fcc4744aa5092c43f7228b3545f7ee6c91740dca3230e",
                "md5": "37bc390a87467a8f84aff0fbd757f76c",
                "sha256": "8111fe37ab636de8423deb3b4456ba72536f57846076d4de72ae1af707ff966c"
            },
            "downloads": -1,
            "filename": "python_rconfig-20.2.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "37bc390a87467a8f84aff0fbd757f76c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.6",
            "size": 6420,
            "upload_time": "2024-09-30T12:43:31",
            "upload_time_iso_8601": "2024-09-30T12:43:31.429570Z",
            "url": "https://files.pythonhosted.org/packages/ff/d9/a5fd8064e9bb932fcc4744aa5092c43f7228b3545f7ee6c91740dca3230e/python_rconfig-20.2.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9527cafde97ea0a68e33d9d6103814de1edf0f761ccd32fb9da26c79b54824c5",
                "md5": "8a3f954a7ba75cb90f156d26cf7f1917",
                "sha256": "38df2a250c04b5b92062047185f9807b27ef7d726bcac6863375f6802d567dfe"
            },
            "downloads": -1,
            "filename": "python_rconfig-20.2.7.tar.gz",
            "has_sig": false,
            "md5_digest": "8a3f954a7ba75cb90f156d26cf7f1917",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.6",
            "size": 5397,
            "upload_time": "2024-09-30T12:43:33",
            "upload_time_iso_8601": "2024-09-30T12:43:33.183778Z",
            "url": "https://files.pythonhosted.org/packages/95/27/cafde97ea0a68e33d9d6103814de1edf0f761ccd32fb9da26c79b54824c5/python_rconfig-20.2.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-30 12:43:33",
    "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.56553s