{
"info": {
"author": "Unknown",
"author_email": "husanhe@gmail.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: Unix",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6"
],
"description": ".. image:: https://readthedocs.org/projects/configirl/badge/?version=latest\n :target: https://configirl.readthedocs.io/index.html\n :alt: Documentation Status\n\n.. image:: https://travis-ci.org/MacHu-GWU/configirl-project.svg?branch=master\n :target: https://travis-ci.org/MacHu-GWU/configirl-project?branch=master\n\n.. image:: https://codecov.io/gh/MacHu-GWU/configirl-project/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/MacHu-GWU/configirl-project\n\n.. image:: https://img.shields.io/pypi/v/configirl.svg\n :target: https://pypi.python.org/pypi/configirl\n\n.. image:: https://img.shields.io/pypi/l/configirl.svg\n :target: https://pypi.python.org/pypi/configirl\n\n.. image:: https://img.shields.io/pypi/pyversions/configirl.svg\n :target: https://pypi.python.org/pypi/configirl\n\n.. image:: https://img.shields.io/badge/STAR_Me_on_GitHub!--None.svg?style=social\n :target: https://github.com/MacHu-GWU/configirl-project\n\n------\n\n\n.. image:: https://img.shields.io/badge/Link-Document-blue.svg\n :target: https://configirl.readthedocs.io/index.html\n\n.. image:: https://img.shields.io/badge/Link-API-blue.svg\n :target: https://configirl.readthedocs.io/py-modindex.html\n\n.. image:: https://img.shields.io/badge/Link-Source_Code-blue.svg\n :target: https://configirl.readthedocs.io/py-modindex.html\n\n.. image:: https://img.shields.io/badge/Link-Install-blue.svg\n :target: `install`_\n\n.. image:: https://img.shields.io/badge/Link-GitHub-blue.svg\n :target: https://github.com/MacHu-GWU/configirl-project\n\n.. image:: https://img.shields.io/badge/Link-Submit_Issue-blue.svg\n :target: https://github.com/MacHu-GWU/configirl-project/issues\n\n.. image:: https://img.shields.io/badge/Link-Request_Feature-blue.svg\n :target: https://github.com/MacHu-GWU/configirl-project/issues\n\n.. image:: https://img.shields.io/badge/Link-Download-blue.svg\n :target: https://pypi.org/pypi/configirl#files\n\n\nWelcome to ``configirl`` Documentation\n==============================================================================\n\n.. contents::\n :depth: 1\n :local:\n\n\nWhat is ``configirl``\n------------------------------------------------------------------------------\n\n``configirl`` is a **single script, pure python, no dependencies, python2.7, 3.4+ compatible, drop in ready** python library to help you **manage complex config value logic**. This devops solution applies to **ANY PROJECT, ANY PROGRAMMING LANGUAGE**.\n\n.. code-block:: python\n\n from configirl import ConfigClass, Constant, Deriable\n\n class Config(object):\n PROJECT_NAME = Constant()\n PROJECT_NAME_SLUG = Deriable()\n\n @PROJECT_NAME_SLUG.getter\n def get_project_name_slug(self):\n return self.PROJECT_NAME.get_value().replace(\"_\", \"-\")\n\n config = Config(PROJECT_NAME=\"my_project\")\n\n\nWhat problem does ``configirl`` solve\n------------------------------------------------------------------------------\n\n**Devops Engineer has to deal with lots of config and parameters everyday**. Some config value are just a constant value, like a integer and a string. Some config value can be derived from other config values, sometimes event requires the context.\n\nThere are lots of Devops tools available in the community, such as:\n\n- Shell Script for command line tool, automation\n- Jenkins groovy for CI/CD\n- Cloudformation for Infrastructure as Code\n- Terraform for Infrastructure as Code\n- ...\n\nThey all using different language and different syntax. The method of managing config value in different tools varies very much! If you have to manage a list of config values, and you are using multiple devops tools in the same project. Allow those tools talk to each other is NOT EASY at all. And the effort to manage config value in certain tools might be very difficult (like CloudFormation).\n\n``configirl`` **provides a solution to manage complex logic for config values in an elegant way. Since Python is easy to learn and it is full featured programming language, you got the perfect balance of simplicity and flexibility**. To integrate with any Devops tools, you just reference the value from the finalized config JSON file.\n\n\nQuick Start\n------------------------------------------------------------------------------\n\n1. Copy ``configirl.__init__.py`` to your Devops workspace directory, and rename it as ``configirl.py``. That is for ``drop in ready``.\n2. Create a ``config-raw.json`` file put the following content:\n\n.. code-block:: javascript\n\n {\n \"PROJECT_NAME\": \"my_project\",\n \"STAGE\": \"dev\"\n }\n\n3. Create a ``config.py`` file, put the following content. Since it is Python2.7, 3.4+ compatible, pure Python, no dependencies, it works everywhere.\n\n.. code-block:: python\n\n from configirl import ConfigClass, Constant, Derivable\n\n class Config(object):\n CONFIG_DIR = \"your-devops-workspace-dir\"\n\n PROJECT_NAME = Constant()\n PROJECT_NAME_SLUG = Derivable()\n\n @PROJECT_NAME_SLUG.getter\n def get_project_name_slug(self):\n return self.PROJECT_NAME.get_value().replace(\"_\", \"-\")\n\n @PROJECT_NAME_SLUG.validator\n def check_project_name_slug(self, value):\n if \"_\" in value:\n raise ValueError(\"you can't use `_` in slugifie name!\")\n\n STAGE = Constant()\n\n ENVIRONMENT_NAME = Derivable()\n\n @PROJECT_NAME_SLUG.getter\n def get_environment_name(self):\n return \"{}-{}\".format(\n self.PROJECT_NAME_SLUG.get_value(),\n self.STAGE.get_value(),\n )\n\n config = Config()\n config.update_from_raw_json_file()\n config.dump_shell_script_json_config_file()\n config.dump_cloudformation_json_config_file()\n\n # you can call more custom dump method here\n # depends on what other devops tools you are using\n\n4. Everytime you call ``python config.py`` then the ground truth config value in ``config-raw.json`` will be parsed. and two more ``config-final-for-shell-script.json``, ``config-final-for-cloudformation.json`` will be create. Then you can just reference value from thos ``xxx-final-xxx.json`` file.\n\n.. code-block:: javascript\n\n // content of config-final-for-shell-script.json\n {\n \"PROJECT_NAME\": \"my_project\",\n \"PROJECT_NAME_SLUG\": \"my-project\",\n \"STAGE\": \"dev\",\n \"ENVIRONMENT_NAME\": \"my-project-dev\"\n }\n\n.. code-block:: javascript\n\n // content of config-final-for-cloudformation.json\n {\n \"ProjectName\": \"my_project\",\n \"ProjectNameSlug\": \"my-project\",\n \"Stage\": \"dev\",\n \"EnvironmentName\": \"my-project-dev\"\n }\n\n\nAdditional Feature\n------------------------------------------------------------------------------\n\n1. you can custom your validator.\n\n.. code-block:: python\n\n from configirl import ConfigClass, Constant, Derivable\n\n class Config(object):\n PROJECT_NAME = Constant()\n PROJECT_NAME_SLUG = Derivable()\n\n @PROJECT_NAME_SLUG.getter\n def get_project_name_slug(self):\n return self.PROJECT_NAME.get_value().replace(\"_\", \"-\")\n\n @PROJECT_NAME_SLUG.validator\n def check_project_name_slug(self, value):\n if \"_\" in value:\n raise ValueError(\"you can't use `_` in slugifie name!\")\n\n2. you can inherit your Config Class.\n\n.. code-block:: python\n\n from configirl import ConfigClass, Constant, Derivable\n\n class Config1(object):\n PROJECT_NAME = Constant()\n\n class Config2(Config1):\n PROJECT_NAME_SLUG = Derivable()\n\n @PROJECT_NAME_SLUG.getter\n def get_project_name_slug(self):\n return self.PROJECT_NAME.get_value().replace(\"_\", \"-\")\n\n @PROJECT_NAME_SLUG.validator\n def check_project_name_slug(self, value):\n if \"_\" in value:\n raise ValueError(\"you can't use `_` in slugifie name!\")\n\n class Config(Config2):\n CONFIG_DIR = \"your-devops-workspace-dir\"\n\n config = Config()\n ... do what every you need\n\n\nUse Case - Java Web App Project with AWS, Serverless, Infrastructure as Code\n------------------------------------------------------------------------------\n\nIn this example, we are designing the devops solution for a complex Web App, the app logic is written in `JAVA Sprint `_, the application code is deployed to Amazon Web Service via `Cloudformation `_, lots of microservices are deployed to AWS Lambda and AWS ApiGateway with `Serverless framework `_, and use `CircleCI `_ to automate the test, build, deployment.\n\nSuppose your ``project name`` is ``MyWebApp``, and it has multiple deployment ``stage`` ``dev``, ``test``, ``prod``, in other word, it will be deployed to three ``Environment``. And the environment name ``MyWebApp-dev/test/prod`` will be used as a prefix name almost everywhere in your Java Code, Cloudformation Code, CICD Code. And you **DONT want to manage the config value** like ``PROJECT_NAME`` and ``STAGE`` everywhere in Java Code, Cloudformation Code, CICD Code.\n\nIf you don't want to create the devops scripts manually in the following instruction, you can just copy the entire ``devops-example`` directory from https://github.com/MacHu-GWU/configirl-project/tree/master/devops-example to your local machine.\n\n\n1. Centralize Your Config Definition\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe easiest way to use ``configirl`` is to copy the ``configirl.__init__.py`` file to your Devops workspace directory, and rename it as ``configirl.py``. It is ``drop in ready`` and no dependencies, it runs any Mac or Linux Machine.\n\nCreate a ``config.py`` file next to ``configirl.py`` it is the centralized place to manage your config logic, put the following code in ``config.py``, it defines two major constant variables ``PROJECT_NAME`` and ``STAGE``, and two derivable variables ``PROJECT_NAME_SLUG`` and ``ENVIRONMENT_NAME``:\n\n.. code-block:: python\n\n # -*- coding: utf-8 -*-\n # content of config.py\n\n import os\n from configirl import ConfigClass, Constant, Derivable\n\n\n class Config(ConfigClass):\n CONFIG_DIR = os.path.dirname(__file__)\n\n PROJECT_NAME = Constant() # example \"MyWebApp\"\n PROJECT_NAME_SLUG = Derivable()\n\n @PROJECT_NAME_SLUG.getter\n def get_PROJECT_NAME_SLUG(self):\n return self.PROJECT_NAME.get_value().replace(\"_\", \"-\")\n\n @PROJECT_NAME_SLUG.validator\n def check_PROJECT_NAME_SLUG(self, value):\n if \"_\" in value:\n raise ValueError(\"you can't use `_` in slugifie name!\")\n\n STAGE = Constant() # example \"dev\"\n\n ENVIRONMENT_NAME = Derivable()\n\n @ENVIRONMENT_NAME.getter\n def get_ENVIRONMENT_NAME(self):\n return \"{}-{}\".format(\n self.PROJECT_NAME_SLUG.get_value(),\n self.STAGE.get_value(),\n )\n\n APP_PUBLIC_URL = Derivable()\n @APP_PUBLIC_URL.getter\n\n\n2. Create the Config Data for Different Enviornment.\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nCreate three config files ``./01-config-dev.json``, ``./01-config-test.json``, ``./01-config-prod.json``, and put the following contect in corresponding files ``{\"STAGE\": \"dev\"}``, ``{\"STAGE\": \"test\"}``, ``{\"STAGE\": \"prod\"}``.\n\nCreate a config file ``./00-config-shared.json`` and put the following content ``{\"PROJECT_NAME\": \"MyWebApp\"}``.\n\n**For different deployment stages, they may share common config values, those information goes to** ``./00-config-shared.json`` file.\n\n**For environment dependent config values, they goes to different config files**.\n\n\n.. _install:\n\nInstall\n------------------------------------------------------------------------------\n\n``configirl`` is released on PyPI, so all you need is:\n\n.. code-block:: console\n\n $ pip install configirl\n\nTo upgrade to latest version:\n\n.. code-block:: console\n\n $ pip install --upgrade configirl\n\n",
"description_content_type": "",
"docs_url": null,
"download_url": "https://pypi.python.org/pypi/configirl/0.0.6#downloads",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/MacHu-GWU/",
"keywords": "",
"license": "MIT",
"maintainer": "",
"maintainer_email": "",
"name": "configirl",
"package_url": "https://pypi.org/project/configirl/",
"platform": "Windows",
"project_url": "https://pypi.org/project/configirl/",
"project_urls": {
"Download": "https://pypi.python.org/pypi/configirl/0.0.6#downloads",
"Homepage": "https://github.com/MacHu-GWU/"
},
"release_url": "https://pypi.org/project/configirl/0.0.6/",
"requires_dist": [
"sphinx (==1.8.1) ; extra == 'docs'",
"sphinx-rtd-theme ; extra == 'docs'",
"sphinx-jinja ; extra == 'docs'",
"sphinx-copybutton ; extra == 'docs'",
"docfly (>=0.0.17) ; extra == 'docs'",
"rstobj (>=0.0.5) ; extra == 'docs'",
"pygments ; extra == 'docs'",
"pytest (==3.2.3) ; extra == 'tests'",
"pytest-cov (==2.5.1) ; extra == 'tests'"
],
"requires_python": "",
"summary": "Centralized Config Management Tool.",
"version": "0.0.6"
},
"last_serial": 5805117,
"releases": {
"0.0.1": [
{
"comment_text": "",
"digests": {
"md5": "03153d95d348cfaa5c5c96f2526feedb",
"sha256": "d5f16d46e6c8a6c059c798b59eb86cd41cff4f4a9af5a7adfcd0dd275143a1ac"
},
"downloads": -1,
"filename": "configirl-0.0.1-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "03153d95d348cfaa5c5c96f2526feedb",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 47620,
"upload_time": "2019-07-04T04:54:25",
"url": "https://files.pythonhosted.org/packages/37/89/1efe5fd6eb03d82bc82496b83626add66a775b45cdc8b57a10e1237931fe/configirl-0.0.1-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "b22efb2b0056f004c54809073e563afb",
"sha256": "a9c85f56478eb1349e05e63fd2955e889cae43d7ded90523b897bbdee1e60f27"
},
"downloads": -1,
"filename": "configirl-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "b22efb2b0056f004c54809073e563afb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 30433,
"upload_time": "2019-07-04T04:54:28",
"url": "https://files.pythonhosted.org/packages/f6/cf/a81080e8730d0c3e047015b2970f2fec8977de94f114a3b87dc1a2beb116/configirl-0.0.1.tar.gz"
}
],
"0.0.2": [
{
"comment_text": "",
"digests": {
"md5": "cd8259361bfc8a8d8931b99f191ce39f",
"sha256": "06d41cb615b17d5e0e2b2df94593ff3311b554b9c9bf6d906f161a46b8f76fba"
},
"downloads": -1,
"filename": "configirl-0.0.2-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "cd8259361bfc8a8d8931b99f191ce39f",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 47787,
"upload_time": "2019-07-04T05:05:48",
"url": "https://files.pythonhosted.org/packages/0a/37/2ae908e38dc8fcc61fa10eb935c9d88a639dd38e7e364c6cdd6629f4115a/configirl-0.0.2-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "be252d5335d147cb092bd7c8e32da77f",
"sha256": "4489f9a22bc9407119c5a6b891b695421f139b25150c6c411a8829249def1d1c"
},
"downloads": -1,
"filename": "configirl-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "be252d5335d147cb092bd7c8e32da77f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 30862,
"upload_time": "2019-07-04T05:05:50",
"url": "https://files.pythonhosted.org/packages/2e/45/671ab7103b3fc3eadf9fdb8c1c22e14e62430c8d1008ffc7b3a80deb17ee/configirl-0.0.2.tar.gz"
}
],
"0.0.3": [
{
"comment_text": "",
"digests": {
"md5": "d66685e2a23ba5a62939be524a6aeb31",
"sha256": "5c639cb57dd8dbe20ddc411897592b4b9eaa5c22eb5bd261a1f00e3fa5eed68a"
},
"downloads": -1,
"filename": "configirl-0.0.3-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "d66685e2a23ba5a62939be524a6aeb31",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 48237,
"upload_time": "2019-07-06T16:20:07",
"url": "https://files.pythonhosted.org/packages/08/60/61cd207801c82e975c2848003808c0894337a3f89231d86d394889d6ee37/configirl-0.0.3-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "4cb07e616f695841b7d227ada6dad19d",
"sha256": "8793cc9141bfa0a64b76c876bbf629eb5d01f982113ed8db0d197f94c0d73c45"
},
"downloads": -1,
"filename": "configirl-0.0.3.tar.gz",
"has_sig": false,
"md5_digest": "4cb07e616f695841b7d227ada6dad19d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 31740,
"upload_time": "2019-07-06T16:20:08",
"url": "https://files.pythonhosted.org/packages/0d/ab/47e01b8da511ece096bc9dbb34fbc536446f98e5e64c8742380f4a3752ff/configirl-0.0.3.tar.gz"
}
],
"0.0.4": [
{
"comment_text": "",
"digests": {
"md5": "0e8dd2ea5230520039dad3788405bf3d",
"sha256": "ed87939e1b1ed562541dc0a4c5cc31b64bfab5a9d151f04d84b5b04edca8e238"
},
"downloads": -1,
"filename": "configirl-0.0.4-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "0e8dd2ea5230520039dad3788405bf3d",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 52257,
"upload_time": "2019-08-21T07:00:52",
"url": "https://files.pythonhosted.org/packages/c5/2e/dffd48b297bef41c751dcd2b3b080b403dd720fd4f11af8055807c66276d/configirl-0.0.4-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "d544884885ac3d104829677f2d4acb9a",
"sha256": "f871bd6bdd0ec26ede8f3afe3ba0c3cc545d07c1d820715a904572abaa2e47ee"
},
"downloads": -1,
"filename": "configirl-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "d544884885ac3d104829677f2d4acb9a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 36822,
"upload_time": "2019-08-21T07:00:54",
"url": "https://files.pythonhosted.org/packages/49/06/b35b13e12f8cea9a56d5ba267a6f09d6dae030ab3f0083750cd3ae060b05/configirl-0.0.4.tar.gz"
}
],
"0.0.6": [
{
"comment_text": "",
"digests": {
"md5": "cc4fe6a1097423069c259d45ec0aacb2",
"sha256": "524edc802f037bf0395450a6a8cc91c35f7a417bf250a83bea234d7cdde4a3e4"
},
"downloads": -1,
"filename": "configirl-0.0.6-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "cc4fe6a1097423069c259d45ec0aacb2",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 53560,
"upload_time": "2019-09-09T19:17:21",
"url": "https://files.pythonhosted.org/packages/a5/de/0f4f5028a6ceae38873d6858e6243f67701cf1afbb39c78cafd099360c78/configirl-0.0.6-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "ae182926c9f17cdc412b3ba75547ab27",
"sha256": "26a2f7a7a48e081cb5ce3dac9849641dab32679f65e51425142272e668f22d59"
},
"downloads": -1,
"filename": "configirl-0.0.6.tar.gz",
"has_sig": false,
"md5_digest": "ae182926c9f17cdc412b3ba75547ab27",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 38271,
"upload_time": "2019-09-09T19:17:23",
"url": "https://files.pythonhosted.org/packages/e3/21/f7e5eb83cfae32cc3dc289e8d85ff83cad17d2823de1c190041bf1bc710e/configirl-0.0.6.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "cc4fe6a1097423069c259d45ec0aacb2",
"sha256": "524edc802f037bf0395450a6a8cc91c35f7a417bf250a83bea234d7cdde4a3e4"
},
"downloads": -1,
"filename": "configirl-0.0.6-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "cc4fe6a1097423069c259d45ec0aacb2",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 53560,
"upload_time": "2019-09-09T19:17:21",
"url": "https://files.pythonhosted.org/packages/a5/de/0f4f5028a6ceae38873d6858e6243f67701cf1afbb39c78cafd099360c78/configirl-0.0.6-py2.py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "ae182926c9f17cdc412b3ba75547ab27",
"sha256": "26a2f7a7a48e081cb5ce3dac9849641dab32679f65e51425142272e668f22d59"
},
"downloads": -1,
"filename": "configirl-0.0.6.tar.gz",
"has_sig": false,
"md5_digest": "ae182926c9f17cdc412b3ba75547ab27",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 38271,
"upload_time": "2019-09-09T19:17:23",
"url": "https://files.pythonhosted.org/packages/e3/21/f7e5eb83cfae32cc3dc289e8d85ff83cad17d2823de1c190041bf1bc710e/configirl-0.0.6.tar.gz"
}
]
}