# aiSSEMBLE Universal Config Loader
aiSSEMBLE Universal Config Loader uses Krausening to provide features to read the configuration from property file and load the configuration to environment variables or to global variables. For the notebook user, it also providers a helper class to extract their notebooks global variables into the property file to set up the configuration for the first time.
## Getting Started
### Notebook User
For the notebook user, to have an easy start, config helper provides a feature to extract the `string` type or `int` type global variables into the configuration property file. The configuration file will be created if it doesn't exist.
#### Example of Extract variables to the property file
The Following example shows how a notebook user can extract the variables from a cell to the property file
```python
# a notebook cell
import os
# variables
test_var1="value_1"
test_var2="value_2"
test_var3="value_3"
test_var4=[1, 2, 3] # the list variable will not be extracted to property file
test_var5={"a":"b", "c":"d"} # the dict variable will not be extract to property file
os.environ['PROJECT_ID'] = "test-final"
os.environ['ISSUE_ID']="1"
# install the aissemble-universal-config-loader module
!pip install aissemble-universal-config-loader
# register the `aissemble_universal_config_loader.ipython.config_helper` ipython extension
%load_ext aissemble_universal_config_loader.ipython.config_helper
#extract the `int` type or `string` type global variables to the configuration file
%extract_vars_to_property_file
```
###### Output
After run above cell, expect the next steps printed in the cell output:
The next step contains:
1. The function to load property values as global variables
2. The configuration file location and what variables have been saved
```shell
****************************************************************************************
Next Steps:
****************************************************************************************
1: Required
----------------------------------------------------------------------------------------
To load property values as global variables, add the below code snippets to a new cell and run the cell:
"""
# import the ConfigLoader module
from aissemble_universal_config_loader.config_loader import ConfigLoader
# set configuration file directory, this is for bootstrapping the library
os.environ['KRAUSENING_BASE'] = '/path-to-project-directory/configurations/base'
# load property values as global variables
ConfigLoader().load_as_global()
"""
Note: Use `ConfigLoader().load_as_env()` to load property values as environment variable.
----------------------------------------------------------------------------------------
2: Optional
----------------------------------------------------------------------------------------
The variables have been extracted to /Users/csun/bah/tests/aissemble-lite-test/test-4306-3/backend/configurations/base/configuration.properties.
You can remove the following variables from your notebook and load them via the ConfigLoader:
['test_var1=value_1', 'test_var2=value_2', 'test_var3=value_3']
```
###### Property file
If there is no existing property file, by default, the `configuration.properties` will be generated at the *.ipynb file's sibling directory `configurations/base` with the below content
```properties
test_var1=value_1
test_var2=value_2
test_var3=value_3
```
### Python Project User
#### Installation
Add the `aissemble-universal-config-loader` package to your project
#### Load Property
To load the property, ensure the `configuration.properties` file is already generated. The loader uses Krausening to read properties from a properties file into either global variables or environment variables. The default Krausening base location is `configurations/base` and the default properties file is `configuration.properties`
#### Add `import` Statement
```python
from aissemble_universal_config_loader.config_loader import ConfigLoader
```
#### Set [Krausening_Base]() environment variable
Krausening is useful for defining different configurations per execution environment. For simple local usage, you can simply set `KRAUSENING_BASE` to the directory that contains your configuration file(s). For more detail: https://github.com/TechnologyBrewery/krausening/tree/dev/krausening#krausening-in-one-pint-learn-krausening-in-2-minutes
```python
os.environ['KRAUSENING_BASE']="path-to-property-directory"
```
#### Load Property to _Global Variables_
```python
ConfigLoader().load_as_global()
```
#### Load Property to _Environment Variables_
```python
ConfigLoader().load_as_env()
```
Raw data
{
"_id": null,
"home_page": "https://github.com/boozallen/aissemble-universal-config",
"name": "aissemble-universal-config-loader",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11.4",
"maintainer_email": null,
"keywords": null,
"author": "aiSSEMBLE Baseline Community",
"author_email": "aissemble@bah.com",
"download_url": "https://files.pythonhosted.org/packages/e5/1d/abee6a06b6c2e82d5b503e12d841213e1b1c47a42eb2651e275f22b3ebe4/aissemble_universal_config_loader-0.1.0.tar.gz",
"platform": null,
"description": "# aiSSEMBLE Universal Config Loader\naiSSEMBLE Universal Config Loader uses Krausening to provide features to read the configuration from property file and load the configuration to environment variables or to global variables. For the notebook user, it also providers a helper class to extract their notebooks global variables into the property file to set up the configuration for the first time.\n\n## Getting Started\n\n### Notebook User\nFor the notebook user, to have an easy start, config helper provides a feature to extract the `string` type or `int` type global variables into the configuration property file. The configuration file will be created if it doesn't exist.\n\n\n#### Example of Extract variables to the property file\n\nThe Following example shows how a notebook user can extract the variables from a cell to the property file\n```python\n# a notebook cell\nimport os\n\n# variables\ntest_var1=\"value_1\"\ntest_var2=\"value_2\"\ntest_var3=\"value_3\"\ntest_var4=[1, 2, 3] # the list variable will not be extracted to property file\ntest_var5={\"a\":\"b\", \"c\":\"d\"} # the dict variable will not be extract to property file\nos.environ['PROJECT_ID'] = \"test-final\"\nos.environ['ISSUE_ID']=\"1\"\n\n# install the aissemble-universal-config-loader module \n!pip install aissemble-universal-config-loader\n\n# register the `aissemble_universal_config_loader.ipython.config_helper` ipython extension\n%load_ext aissemble_universal_config_loader.ipython.config_helper\n\n#extract the `int` type or `string` type global variables to the configuration file\n%extract_vars_to_property_file\n\n```\n\n###### Output\nAfter run above cell, expect the next steps printed in the cell output:\n\nThe next step contains:\n1. The function to load property values as global variables\n2. The configuration file location and what variables have been saved\n```shell\n****************************************************************************************\n Next Steps:\n****************************************************************************************\n 1: Required\n----------------------------------------------------------------------------------------\n To load property values as global variables, add the below code snippets to a new cell and run the cell:\n\n\"\"\"\n# import the ConfigLoader module\nfrom aissemble_universal_config_loader.config_loader import ConfigLoader\n\n# set configuration file directory, this is for bootstrapping the library\nos.environ['KRAUSENING_BASE'] = '/path-to-project-directory/configurations/base'\n\n# load property values as global variables\nConfigLoader().load_as_global()\n\"\"\"\n\n Note: Use `ConfigLoader().load_as_env()` to load property values as environment variable.\n\n\n----------------------------------------------------------------------------------------\n 2: Optional\n----------------------------------------------------------------------------------------\n The variables have been extracted to /Users/csun/bah/tests/aissemble-lite-test/test-4306-3/backend/configurations/base/configuration.properties.\n You can remove the following variables from your notebook and load them via the ConfigLoader:\n ['test_var1=value_1', 'test_var2=value_2', 'test_var3=value_3']\n```\n\n###### Property file\nIf there is no existing property file, by default, the `configuration.properties` will be generated at the *.ipynb file's sibling directory `configurations/base` with the below content\n```properties\ntest_var1=value_1\ntest_var2=value_2\ntest_var3=value_3\n```\n\n### Python Project User\n#### Installation\nAdd the `aissemble-universal-config-loader` package to your project\n\n#### Load Property\nTo load the property, ensure the `configuration.properties` file is already generated. The loader uses Krausening to read properties from a properties file into either global variables or environment variables. The default Krausening base location is `configurations/base` and the default properties file is `configuration.properties`\n\n\n#### Add `import` Statement\n\n```python\nfrom aissemble_universal_config_loader.config_loader import ConfigLoader\n```\n\n#### Set [Krausening_Base]() environment variable\nKrausening is useful for defining different configurations per execution environment. For simple local usage, you can simply set `KRAUSENING_BASE` to the directory that contains your configuration file(s). For more detail: https://github.com/TechnologyBrewery/krausening/tree/dev/krausening#krausening-in-one-pint-learn-krausening-in-2-minutes\n```python\nos.environ['KRAUSENING_BASE']=\"path-to-property-directory\"\n```\n\n#### Load Property to _Global Variables_\n```python\n ConfigLoader().load_as_global()\n```\n#### Load Property to _Environment Variables_\n```python\n ConfigLoader().load_as_env()\n```",
"bugtrack_url": null,
"license": "Booz Allen Public License v1.0",
"summary": "aiSSEMBLE Universal Config Loader",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/boozallen/aissemble-universal-config"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d09fd85c59f5790f51bc820611391fee63e661504965b527383c7fe81c9ab6b1",
"md5": "99eeb2d514c9a588f0e1abb5611903ee",
"sha256": "32ae0b9fdad21c265da9458fe018c47c5611ab7ec16599dbf8156154ab5f8d9a"
},
"downloads": -1,
"filename": "aissemble_universal_config_loader-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "99eeb2d514c9a588f0e1abb5611903ee",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11.4",
"size": 10059,
"upload_time": "2025-07-30T16:39:47",
"upload_time_iso_8601": "2025-07-30T16:39:47.034458Z",
"url": "https://files.pythonhosted.org/packages/d0/9f/d85c59f5790f51bc820611391fee63e661504965b527383c7fe81c9ab6b1/aissemble_universal_config_loader-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e51dabee6a06b6c2e82d5b503e12d841213e1b1c47a42eb2651e275f22b3ebe4",
"md5": "f32fe1a44c470fad73c7b4c5dca28e1d",
"sha256": "bda0e69811a336d923784f3fe6db56e82a944b4c08b74f682f959ca5e0c9758b"
},
"downloads": -1,
"filename": "aissemble_universal_config_loader-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "f32fe1a44c470fad73c7b4c5dca28e1d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11.4",
"size": 7963,
"upload_time": "2025-07-30T16:39:48",
"upload_time_iso_8601": "2025-07-30T16:39:48.137267Z",
"url": "https://files.pythonhosted.org/packages/e5/1d/abee6a06b6c2e82d5b503e12d841213e1b1c47a42eb2651e275f22b3ebe4/aissemble_universal_config_loader-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-30 16:39:48",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "boozallen",
"github_project": "aissemble-universal-config",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "aissemble-universal-config-loader"
}