{"id":16426287,"url":"https://github.com/drkostas/yaml-config-wrapper","last_synced_at":"2025-06-25T13:38:04.351Z","repository":{"id":44751851,"uuid":"436818097","full_name":"drkostas/yaml-config-wrapper","owner":"drkostas","description":"A YAML configuration wrapper.","archived":false,"fork":false,"pushed_at":"2022-01-30T01:42:19.000Z","size":102,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-21T09:17:45.972Z","etag":null,"topics":["config-management","configuration","configuration-management","yaml","yaml-configuration","yml","yml-configuration"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/yaml-config-wrapper/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drkostas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-10T01:54:15.000Z","updated_at":"2024-11-18T21:58:49.000Z","dependencies_parsed_at":"2022-08-22T10:20:15.724Z","dependency_job_id":null,"html_url":"https://github.com/drkostas/yaml-config-wrapper","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":"fastai/pypi_template","purl":"pkg:github/drkostas/yaml-config-wrapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drkostas%2Fyaml-config-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drkostas%2Fyaml-config-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drkostas%2Fyaml-config-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drkostas%2Fyaml-config-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drkostas","download_url":"https://codeload.github.com/drkostas/yaml-config-wrapper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drkostas%2Fyaml-config-wrapper/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261883830,"owners_count":23224569,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["config-management","configuration","configuration-management","yaml","yaml-configuration","yml","yml-configuration"],"created_at":"2024-10-11T08:08:21.420Z","updated_at":"2025-06-25T13:38:04.327Z","avatar_url":"https://github.com/drkostas.png","language":"Python","funding_links":["https://www.buymeacoffee.com/drkostas"],"categories":[],"sub_categories":[],"readme":"# YAML Config Wrapper\n[![Downloads](https://static.pepy.tech/personalized-badge/yaml-config-wrapper?period=total\u0026units=international_system\u0026left_color=grey\u0026right_color=red\u0026left_text=Downloads)](https://pepy.tech/project/yaml-config-wrapper)\n[![GitHub license](https://img.shields.io/badge/license-Apache-blue.svg)](https://github.com/drkostas/yaml-config-wrapper/blob/master/LICENSE)\n[![CircleCI](https://circleci.com/gh/drkostas/yaml-config-wrapper/tree/master.svg?style=svg)](https://circleci.com/gh/drkostas/yaml-config-wrapper/tree/master)\n\n## About \u003ca name = \"about\"\u003e\u003c/a\u003e\n\nA YAML configuration\nwrapper. [PYPI Package](https://pypi.org/project/yaml-config-wrapper/)\n\n## Table of Contents\n\n+ [Using the library](#using)\n    + [Installing and using the library](#install_use)\n    + [Creating a config file](#configuration)\n    + [Set the required environment variables](#env_variables)\n+ [Manually install the library](#manual_install)\n    + [Prerequisites](#prerequisites)\n    + [Install the requirements](#installing_req)\n    + [Run the Unit Tests](#unit_tests)\n+ [Continuous Integration](#ci)\n+ [Update PyPI package](#pypi)\n+ [License](#license)\n\n## Using the library \u003ca name = \"using\"\u003e\u003c/a\u003e\n\n### Installing and using the library \u003ca name = \"install_use\"\u003e\u003c/a\u003e\n\nFirst, you need to install the library either using pip:\n\n```shell\n$ pip install yaml_config_wrapper\n```\n\nThen, import it and use it like so:\n\n```python\nfrom yaml_config_wrapper import Configuration\n\n# The `config_schema_path` argument is optional\nconf = Configuration(config_src='confs/template_conf.yml',\n                     config_schema_path='yml_schemas/default_schema.json')\n```\n\n### Creating a config file \u003ca name = \"configuration\"\u003e\u003c/a\u003e\n\nThere are two already example yml configs\nunder [confs](https://github.com/drkostas/yaml-config-wrapper/tree/master/confs). An example structure\nis the following:\n\n```yaml\ntag: production\ncloudstore:\n  config:\n    api_key: !ENV ${DROPBOX_API_KEY}\n  type: dropbox\ndatastore:\n  config:\n    hostname: !ENV ${MYSQL_HOST}\n    username: !ENV ${MYSQL_USERNAME}\n    password: !ENV ${MYSQL_PASSWORD}\n    db_name: !ENV ${MYSQL_DB_NAME}\n    port: 3306\n  type: mysql\nemail_app:\n  config:\n    email_address: !ENV ${EMAIL_ADDRESS}\n    api_key: !ENV ${GMAIL_API_KEY}\n  type: gmail\n```\n\nThe `!ENV` flag indicates that you are passing an environmental value to this attribute. You can change\nthe values/environmental var names as you wish.\n\nThere is also the option to create a validation schema the enforces a specific yaml structure. The\ndefault dummy version is\nthe [default_schema.json](https://github.com/drkostas/yaml-config-wrapper/blob/master/yaml_config_wrapper/default_schema.json)\nfile.\n\n### Set the required environment variables \u003ca name = \"env_variables\"\u003e\u003c/a\u003e\n\nIn order to use the `!ENV` flag in you config, you need to set the corresponding environment variables\nlike so:\n\n```shell\n$ export DROPBOX_API_KEY=123\n$ export MYSQL_HOST=foo.rds.amazonaws.com\n$ export MYSQL_USERNAME=user\n$ export MYSQL_PASSWORD=pass\n$ export MYSQL_DB_NAME=Test_schema\n$ export EMAIL_ADDRESS=Gmail Bot \u003cfoobar@gmail.com\u003e\n$ export GMAIL_API_KEY=123\n```\n\nThe best way to do that, is to create a .env\nfile ([example](https://github.com/drkostas/yaml-config-wrapper/blob/master/env_example)),\nand source it before running the code.\n\n## Manually install the library \u003ca name = \"manual_install\"\u003e\u003c/a\u003e\n\nThese instructions will get you a copy of the project up and running on your local machine for\ndevelopment and testing purposes.\n\n### Prerequisites \u003ca name = \"prerequisites\"\u003e\u003c/a\u003e\n\nYou need to have a machine with\n[anaconda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html) installed and\nany Bash based shell (e.g. zsh) installed.\n\n```ShellSession\n\n$ conda -V\nconda 4.10.1\n\n$ echo $SHELL\n/usr/bin/zsh\n\n```\n\n### Install the requirements \u003ca name = \"installing_req\"\u003e\u003c/a\u003e\n\nAll the installation steps are being handled by\nthe [Makefile](https://github.com/drkostas/yaml-config-wrapper/blob/master/Makefile).\n\nFirst, modify the python version (`min_python`) and everything else you need in\nthe [settings.ini](https://github.com/drkostas/yaml-config-wrapper/blob/master/settings.ini).\n\nThen, execute the following commands:\n\n```ShellSession\n$ make create_env\n$ conda activate yaml_config_wrapper\n$ make dist\n```\n\nNow you are ready to use and modify the library.\n\n### Run the Unit Tests \u003ca name = \"unit_tests\"\u003e\u003c/a\u003e\n\nIf you want to run the unit tests, execute the following command:\n\n```ShellSession\n$ make tests\n```\n\n## Continuous Integration \u003ca name = \"ci\"\u003e\u003c/a\u003e\n\nFor the continuous integration, the \u003cb\u003eCircleCI\u003c/b\u003e service is being used. For more information you can\ncheck the [setup guide](https://circleci.com/docs/2.0/language-python/).\n\nAgain, you should set\nthe [above-mentioned environmental variables](#env_variables) ([reference](https://circleci.com/docs/2.0/env-vars/#setting-an-environment-variable-in-a-context))\nand for any modifications, edit\nthe [circleci config](https://github.com/drkostas/yaml-config-wrapper/blob/master/.circleci/config.yml)\n.\n\n## Update PyPI package \u003ca name = \"pypi\"\u003e\u003c/a\u003e\n\nThis is mainly for future reference for the developers of this project. First,\ncreate a file called `~/.pypirc` with your pypi login details, as follows:\n\n```\n[pypi]\nusername = your_pypi_username\npassword = your_pypi_password\n```\n\nThen, modify the python version (`min_python`), project status (`status`), release version (`version`) \nand everything else you need in\nthe [settings.ini](https://github.com/drkostas/yaml-config-wrapper/blob/master/settings.ini).\n\nFinally, execute the following commands:\n\n```ShellSession\n$ make create_env\n$ conda activate yaml_config_wrapper\n$ make release\n```\n\nFor a dev release, change the `testing_version` and instead of `make release`, run `make release_test`.\n\n## License \u003ca name = \"license\"\u003e\u003c/a\u003e\n\nThis project is licensed under the Apache License - see\nthe [LICENSE](https://github.com/drkostas/yaml-config-wrapper/blob/master/LICENSE) file for\ndetails.\n\n\u003ca href=\"https://www.buymeacoffee.com/drkostas\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/default-orange.png\" alt=\"Buy Me A Coffee\" height=\"41\" width=\"174\"\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrkostas%2Fyaml-config-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrkostas%2Fyaml-config-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrkostas%2Fyaml-config-wrapper/lists"}