# `load_xl` - A Python Configuration Parser Library
load_xl is a simple and easy to use library for parsing environment variable and configuration files in `Python`. It provides a convenient way to load environment variables from .envi files and parse unique syntax configuration files.
Installation
The package can be installed using pip.
```bash
pip install load-xl
```
## Usage
Here's how to use load_xl in your Python code:
```python
import load_xl
# Load environment variables from .envi file
load_xl.load_envi_file('.envi')
# Read configuration file
config = load_xl.read_config_file('.configx')
```
+ The `load_envi_file` function takes a file path to a .envi file and loads the defined environment variables to the environment.
+ The `read_config_file` function takes a file path to a unique syntax configuration file and returns a dictionary of all the keys and values defined in the file.
.envi file format
The .envi file should contain one environment variable per line in the following format:
```bash
# Key and Value
KEY=VALUE
```
Lines starting with a # symbol will be ignored as comments.
Unique syntax configuration file format
The unique syntax configuration file should follow the following rules:
+ Lines starting with a - symbol are treated as environment variables and split on the : sign.
+ Lines starting with & or % are ignored as comments.
+ Only values that start with $ are taken into consideration.
### Example
```bash
# This is a comment line, ignored by the parser
& This is a comment line &, ignored by the parser
% This is a comment line %, ignored by the parser
# Keys and Values
$ key1: value1 # This line follows the correct syntax for key-value pair
$ key2: value2
- key3: value3 # This line follows the correct syntax for environment variable
```
## Error and Exception handling
The library provides a comprehensive error and exception handling mechanism to ensure the stability and reliability of your code.
# Change Log
==============
0.1.0 (06/02/2023)
-------------------
- initial release
0.1.1 (06/02/2023)
-------------------
- Fixed README.md
0.2.0 (07/02/2023)
-------------------
- Fixed Some Bugs
- Now you can load any `.ini`, `.yaml` and `.json` file directely
- Check `tests` folder for example usage
## Contributing
If you want to contribute to load_xl, please reach out to the maintainers. We welcome contributions, bug reports, and feedback.
## License
load_xl is released under the MIT License.
Raw data
{
"_id": null,
"home_page": "https://github.com/sc4rfurry",
"name": "load-xl",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "env,env_loader,config,config_parser,parser",
"author": "sc4rfurry",
"author_email": "akalucifr@protonmail.ch",
"download_url": "https://files.pythonhosted.org/packages/3c/6c/8093850b8f729606aeba29307104be28342354d13d6438877796b470cb29/load_xl-0.2.0.tar.gz",
"platform": null,
"description": "# `load_xl` - A Python Configuration Parser Library\n\nload_xl is a simple and easy to use library for parsing environment variable and configuration files in `Python`. It provides a convenient way to load environment variables from .envi files and parse unique syntax configuration files.\nInstallation\n\nThe package can be installed using pip.\n```bash\npip install load-xl\n```\n\n## Usage\n\nHere's how to use load_xl in your Python code:\n\n```python\n\nimport load_xl\n# Load environment variables from .envi file\nload_xl.load_envi_file('.envi')\n\n# Read configuration file\nconfig = load_xl.read_config_file('.configx')\n```\n\n+ The `load_envi_file` function takes a file path to a .envi file and loads the defined environment variables to the environment.\n\n+ The `read_config_file` function takes a file path to a unique syntax configuration file and returns a dictionary of all the keys and values defined in the file.\n.envi file format\n\nThe .envi file should contain one environment variable per line in the following format:\n\n```bash\n# Key and Value\nKEY=VALUE\n```\n\nLines starting with a # symbol will be ignored as comments.\nUnique syntax configuration file format\n\nThe unique syntax configuration file should follow the following rules:\n\n+ Lines starting with a - symbol are treated as environment variables and split on the : sign.\n+ Lines starting with & or % are ignored as comments.\n+ Only values that start with $ are taken into consideration.\n\n### Example\n```bash\n# This is a comment line, ignored by the parser\n& This is a comment line &, ignored by the parser\n% This is a comment line %, ignored by the parser\n\n\n# Keys and Values\n$ key1: value1 # This line follows the correct syntax for key-value pair\n$ key2: value2\n- key3: value3 # This line follows the correct syntax for environment variable\n```\n\n## Error and Exception handling\n\nThe library provides a comprehensive error and exception handling mechanism to ensure the stability and reliability of your code.\n\n\n# Change Log\n==============\n\n0.1.0 (06/02/2023)\n-------------------\n- initial release\n\n0.1.1 (06/02/2023)\n-------------------\n- Fixed README.md\n\n0.2.0 (07/02/2023)\n-------------------\n- Fixed Some Bugs\n- Now you can load any `.ini`, `.yaml` and `.json` file directely\n- Check `tests` folder for example usage\n\n## Contributing\n\nIf you want to contribute to load_xl, please reach out to the maintainers. We welcome contributions, bug reports, and feedback.\n\n## License\nload_xl is released under the MIT License.\n\n",
"bugtrack_url": null,
"license": "",
"summary": "A library for parsing .envi files and configuration files. Also includes functions for parsing .ini, .yaml, and .json files.",
"version": "0.2.0",
"split_keywords": [
"env",
"env_loader",
"config",
"config_parser",
"parser"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "93b806125aac25fe05a93b1900e2d8e88bca5f584ca6e2639cce972c13dace26",
"md5": "1470a3e69a281a22e1e3031b4df2b84f",
"sha256": "c1cddf79ccd67e6d280d92da30da6315b0050d434fa1bd1ee83e02ff1c3097aa"
},
"downloads": -1,
"filename": "load_xl-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1470a3e69a281a22e1e3031b4df2b84f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 3355,
"upload_time": "2023-02-06T23:50:09",
"upload_time_iso_8601": "2023-02-06T23:50:09.605073Z",
"url": "https://files.pythonhosted.org/packages/93/b8/06125aac25fe05a93b1900e2d8e88bca5f584ca6e2639cce972c13dace26/load_xl-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3c6c8093850b8f729606aeba29307104be28342354d13d6438877796b470cb29",
"md5": "afb4e3d26f0199a3bd3f611ff26e8b3c",
"sha256": "84e4cab8a86373ad6bd727f9f7420e1966fa340dbe605e614c26978a3b405a0b"
},
"downloads": -1,
"filename": "load_xl-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "afb4e3d26f0199a3bd3f611ff26e8b3c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3350,
"upload_time": "2023-02-06T23:50:11",
"upload_time_iso_8601": "2023-02-06T23:50:11.523505Z",
"url": "https://files.pythonhosted.org/packages/3c/6c/8093850b8f729606aeba29307104be28342354d13d6438877796b470cb29/load_xl-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-02-06 23:50:11",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "load-xl"
}