Name | sk-regex-maker JSON |
Version |
1.0.101
JSON |
| download |
home_page | |
Summary | A simple Variable Handling program |
upload_time | 2023-08-01 17:19:20 |
maintainer | |
docs_url | None |
author | gkibria |
requires_python | >=3.6 |
license | |
keywords |
python
report generator
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Variable Handler
This is a Python package that provides a `VariableHandler` class for extracting variable values from a string of variable declarations.
## Installation
To use the `VariableHandler` package, you need to install it first. You can install it using pip:
```shell
pip install sk_variable_handler
```
## Usage
To extract variable values from a string of variable declarations, follow these steps:
1. Import the `VariableHandler` class from the `variable_handler` module:
```python
from sk_variable_handler import VariableHandler
```
2. Create an instance of the `VariableHandler` class:
```python
variable_handler = VariableHandler()
```
3. Call the `get_values` method of the `VariableHandler` instance, passing the string of variable declarations as an argument. It returns a dictionary containing the variable names as keys and their corresponding values as values.
```python
declarations = "Your variable declarations"
values = variable_handler.get_values(declarations)
```
### Example
Here is an example that demonstrates the usage of the `VariableHandler`:
```python
from variable_handler import VariableHandler
variable_handler = VariableHandler()
declarations = "$x=1+2;$y=2+1;$var=12+223+(222+2)+sin(90);$var2=$x+$y;$xy=($var2+$x+$y);$yx=$xy+$var2"
expected_result = {'$x': '3.0', '$y': '3.0', '$var': '460.0', '$var2': '6.0', '$xy': '12.0', '$yx': '18.0'}
result = variable_handler.get_values(declarations)
assert result == expected_result
```
## Test Cases
The package includes a set of unit tests to verify the functionality of the `VariableHandler` class. The tests cover various scenarios and edge cases to ensure the correct extraction of variable values.
To run the tests, execute the script as a standalone Python program:
```shell
python <filename>.py
```
The output will indicate whether all the tests have passed or if there are any failures.
Please note that the tests are implemented using the `unittest` framework. Each test case is independent and tests a specific aspect of the `VariableHandler` functionality.
## Contributing
Contributions to the `VariableHandler` package are welcome! If you encounter any issues, have suggestions for improvements, or would like to add new features, please create a pull request or open an issue on the GitHub repository.
## License
The `VariableHandler` package is distributed under the [MIT License](https://opensource.org/licenses/MIT). See the [LICENSE](LICENSE) file for more information.
Raw data
{
"_id": null,
"home_page": "",
"name": "sk-regex-maker",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "python,report generator",
"author": "gkibria",
"author_email": "gkibria121@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/a9/01/bf63717b672b615472053675e88a1ac856187ee9e3fb55a928e475f36212/sk_regex_maker-1.0.101.tar.gz",
"platform": null,
"description": "# Variable Handler\r\n\r\nThis is a Python package that provides a `VariableHandler` class for extracting variable values from a string of variable declarations.\r\n\r\n## Installation\r\n\r\nTo use the `VariableHandler` package, you need to install it first. You can install it using pip:\r\n\r\n```shell\r\npip install sk_variable_handler\r\n```\r\n\r\n## Usage\r\n\r\nTo extract variable values from a string of variable declarations, follow these steps:\r\n\r\n1. Import the `VariableHandler` class from the `variable_handler` module:\r\n\r\n ```python\r\n from sk_variable_handler import VariableHandler\r\n ```\r\n\r\n2. Create an instance of the `VariableHandler` class:\r\n\r\n ```python\r\n variable_handler = VariableHandler()\r\n ```\r\n\r\n3. Call the `get_values` method of the `VariableHandler` instance, passing the string of variable declarations as an argument. It returns a dictionary containing the variable names as keys and their corresponding values as values.\r\n\r\n ```python\r\n declarations = \"Your variable declarations\"\r\n values = variable_handler.get_values(declarations)\r\n ```\r\n\r\n### Example\r\n\r\nHere is an example that demonstrates the usage of the `VariableHandler`:\r\n\r\n```python\r\nfrom variable_handler import VariableHandler\r\n\r\nvariable_handler = VariableHandler()\r\n\r\ndeclarations = \"$x=1+2;$y=2+1;$var=12+223+(222+2)+sin(90);$var2=$x+$y;$xy=($var2+$x+$y);$yx=$xy+$var2\"\r\nexpected_result = {'$x': '3.0', '$y': '3.0', '$var': '460.0', '$var2': '6.0', '$xy': '12.0', '$yx': '18.0'}\r\n\r\nresult = variable_handler.get_values(declarations)\r\nassert result == expected_result\r\n```\r\n\r\n## Test Cases\r\n\r\nThe package includes a set of unit tests to verify the functionality of the `VariableHandler` class. The tests cover various scenarios and edge cases to ensure the correct extraction of variable values.\r\n\r\nTo run the tests, execute the script as a standalone Python program:\r\n\r\n```shell\r\npython <filename>.py\r\n```\r\n\r\nThe output will indicate whether all the tests have passed or if there are any failures.\r\n\r\nPlease note that the tests are implemented using the `unittest` framework. Each test case is independent and tests a specific aspect of the `VariableHandler` functionality.\r\n\r\n## Contributing\r\n\r\nContributions to the `VariableHandler` package are welcome! If you encounter any issues, have suggestions for improvements, or would like to add new features, please create a pull request or open an issue on the GitHub repository.\r\n\r\n## License\r\n\r\nThe `VariableHandler` package is distributed under the [MIT License](https://opensource.org/licenses/MIT). See the [LICENSE](LICENSE) file for more information.\r\n",
"bugtrack_url": null,
"license": "",
"summary": "A simple Variable Handling program",
"version": "1.0.101",
"project_urls": null,
"split_keywords": [
"python",
"report generator"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "611bd1acab2d4c6ba7ee92f49f6c5a19c92a1ae398ec1c095ea447caedb5e2fe",
"md5": "61e0bd986a158feb4432feee49c8d5c8",
"sha256": "6fa694eb375742e158913b2b4dce552640e67bd9c33a22bdd2d1ad9be9adb6cb"
},
"downloads": -1,
"filename": "sk_regex_maker-1.0.101-py3-none-any.whl",
"has_sig": false,
"md5_digest": "61e0bd986a158feb4432feee49c8d5c8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 3874,
"upload_time": "2023-08-01T17:19:18",
"upload_time_iso_8601": "2023-08-01T17:19:18.365006Z",
"url": "https://files.pythonhosted.org/packages/61/1b/d1acab2d4c6ba7ee92f49f6c5a19c92a1ae398ec1c095ea447caedb5e2fe/sk_regex_maker-1.0.101-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a901bf63717b672b615472053675e88a1ac856187ee9e3fb55a928e475f36212",
"md5": "1ccb9ad604b475456015b9d1cca1ceb5",
"sha256": "0c70f98e3583459638e060c226a2f615599dec4c84def7965405398c93bbef58"
},
"downloads": -1,
"filename": "sk_regex_maker-1.0.101.tar.gz",
"has_sig": false,
"md5_digest": "1ccb9ad604b475456015b9d1cca1ceb5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 3669,
"upload_time": "2023-08-01T17:19:20",
"upload_time_iso_8601": "2023-08-01T17:19:20.712243Z",
"url": "https://files.pythonhosted.org/packages/a9/01/bf63717b672b615472053675e88a1ac856187ee9e3fb55a928e475f36212/sk_regex_maker-1.0.101.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-01 17:19:20",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "sk-regex-maker"
}