heishamon-rules-minify


Nameheishamon-rules-minify JSON
Version 0.0.4 PyPI version JSON
download
home_pageNone
SummaryA Python CLI to minify Heishamon rules
upload_time2024-11-28 21:10:51
maintainerKlaas Hoekstra
docs_urlNone
authorKlaas Hoekstra
requires_python>=3.7
licenseMIT License Copyright (c) 2024 Klaas Hoekstra Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords package setuptools
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # HeishaMon Rules Minify
> A Python CLI to minify Heishamon rules

[HeishaMon](https://github.com/Egyras/HeishaMon) is a project to read out a Panasonic air-water heat pump using an ESP8266 board. The HeishaMon firmware also supports the use of rules, to control the heatpump from within the HeishaMon itself. Since the ruleset must be stored within HeishaMon, its size must be limited. Therefore, it is best to use short function and variable names in order to maximize the number of rules that can be stored. Moreover, the rules library does not support comments in a ruleset, making it hard to read and maintain a ruleset, but also making it hard to share the ruleset with other. 

This project aims to overcome these issues by making it possible write a ruleset with comments and descriptive function and variables names, and then minifying it. This way it is still possible to maximize the number of rules on the HeishaMon.

_Note: The minifier should work for both the rule library used in version 3.2.3 and [this updated rule libaray version](https://github.com/IgorYbema/HeishaMon/pull/121). In the rule library from version 3.2.3, the elseif statement cannot be used_

## Installation

```sh
python3 -m pip install heishamon_rules_minify
```

## Usage example

Start by creating a ruleset that adheres to the HeishaMon rules syntax, but can use the following extras:

- Single line comments starting with `--` or block comments between `--[[` and `]]`.
- Custom function and variable names will be minified to only keep the first letter (which will be capitalised) and capital letters, so for example `#WaterTemperature` will become `#WT`, `#allowDHW` will become `#ADHW`.

When the ruleset is finished, minify it using the following command:

```sh
heishamon-rules-minify [input_file] [output_file]
```

This will shorten all custom function and variable names and remove all unneeded spaces and newlines.

### Extra options
There are a couple of extra options to pass with the minifier:
* `--print` or `-p` to also print the output on the command line.
* `--comments_only` or `-c` to only remove the comments from the input file but do no further minifying.

## Release History

* [0.0.1](https://github.com/klaashoekstra94/heishamon_rules_minify/releases/tag/v0.0.1)
    * Initial version
* [0.0.2](https://github.com/klaashoekstra94/heishamon_rules_minify/releases/tag/v0.0.2)
    * Fix incorrect spacing for double operators, minor bugfixes
* [0.0.3](https://github.com/klaashoekstra94/heishamon_rules_minify/releases/tag/v0.0.3)
    * Add option to only remove comments
* [0.0.4](https://github.com/klaashoekstra94/heishamon_rules_minify/releases/tag/v0.0.4)
    * Fix extra space being added after the minus sign of negative values

## Contributing

1. Fork it (<https://github.com/yourname/yourproject/fork>)
2. Create your feature branch (`git checkout -b feature/fooBar`)
3. Commit your changes (`git commit -am 'Add some fooBar'`)
4. Push to the branch (`git push origin feature/fooBar`)
5. Create a new Pull Request

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "heishamon-rules-minify",
    "maintainer": "Klaas Hoekstra",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "klaas.hoekstra94@gmail.com",
    "keywords": "package, setuptools",
    "author": "Klaas Hoekstra",
    "author_email": "klaas.hoekstra94@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/2f/e0/4bd29eb94015ee21ed62d2aa74f003dd253605873bb1053fc2e89f7028c4/heishamon_rules_minify-0.0.4.tar.gz",
    "platform": null,
    "description": "# HeishaMon Rules Minify\n> A Python CLI to minify Heishamon rules\n\n[HeishaMon](https://github.com/Egyras/HeishaMon) is a project to read out a Panasonic air-water heat pump using an ESP8266 board. The HeishaMon firmware also supports the use of rules, to control the heatpump from within the HeishaMon itself. Since the ruleset must be stored within HeishaMon, its size must be limited. Therefore, it is best to use short function and variable names in order to maximize the number of rules that can be stored. Moreover, the rules library does not support comments in a ruleset, making it hard to read and maintain a ruleset, but also making it hard to share the ruleset with other. \n\nThis project aims to overcome these issues by making it possible write a ruleset with comments and descriptive function and variables names, and then minifying it. This way it is still possible to maximize the number of rules on the HeishaMon.\n\n_Note: The minifier should work for both the rule library used in version 3.2.3 and [this updated rule libaray version](https://github.com/IgorYbema/HeishaMon/pull/121). In the rule library from version 3.2.3, the elseif statement cannot be used_\n\n## Installation\n\n```sh\npython3 -m pip install heishamon_rules_minify\n```\n\n## Usage example\n\nStart by creating a ruleset that adheres to the HeishaMon rules syntax, but can use the following extras:\n\n- Single line comments starting with `--` or block comments between `--[[` and `]]`.\n- Custom function and variable names will be minified to only keep the first letter (which will be capitalised) and capital letters, so for example `#WaterTemperature` will become `#WT`, `#allowDHW` will become `#ADHW`.\n\nWhen the ruleset is finished, minify it using the following command:\n\n```sh\nheishamon-rules-minify [input_file] [output_file]\n```\n\nThis will shorten all custom function and variable names and remove all unneeded spaces and newlines.\n\n### Extra options\nThere are a couple of extra options to pass with the minifier:\n* `--print` or `-p` to also print the output on the command line.\n* `--comments_only` or `-c` to only remove the comments from the input file but do no further minifying.\n\n## Release History\n\n* [0.0.1](https://github.com/klaashoekstra94/heishamon_rules_minify/releases/tag/v0.0.1)\n    * Initial version\n* [0.0.2](https://github.com/klaashoekstra94/heishamon_rules_minify/releases/tag/v0.0.2)\n    * Fix incorrect spacing for double operators, minor bugfixes\n* [0.0.3](https://github.com/klaashoekstra94/heishamon_rules_minify/releases/tag/v0.0.3)\n    * Add option to only remove comments\n* [0.0.4](https://github.com/klaashoekstra94/heishamon_rules_minify/releases/tag/v0.0.4)\n    * Fix extra space being added after the minus sign of negative values\n\n## Contributing\n\n1. Fork it (<https://github.com/yourname/yourproject/fork>)\n2. Create your feature branch (`git checkout -b feature/fooBar`)\n3. Commit your changes (`git commit -am 'Add some fooBar'`)\n4. Push to the branch (`git push origin feature/fooBar`)\n5. Create a new Pull Request\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Klaas Hoekstra  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "A Python CLI to minify Heishamon rules",
    "version": "0.0.4",
    "project_urls": {
        "Homepage": "https://github.com/klaashoekstra94/heishamon-rules-minify",
        "documentation": "https://github.com/denkiwakame/heishamon-rules-minify",
        "repository": "https://github.com/denkiwakame/heishamon-rules-minify"
    },
    "split_keywords": [
        "package",
        " setuptools"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4c96e9656f90e62dc193b20cb38a0fe6022e7043ab1baa1c7128cae76e86f920",
                "md5": "edf1a88f02d04d4c9dc4f1cccbc584d6",
                "sha256": "3c77ca39d2a7dcdae1296995c866c696e296dc68e756f5fdae33ec87b027e24a"
            },
            "downloads": -1,
            "filename": "heishamon_rules_minify-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "edf1a88f02d04d4c9dc4f1cccbc584d6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 7378,
            "upload_time": "2024-11-28T21:10:49",
            "upload_time_iso_8601": "2024-11-28T21:10:49.450703Z",
            "url": "https://files.pythonhosted.org/packages/4c/96/e9656f90e62dc193b20cb38a0fe6022e7043ab1baa1c7128cae76e86f920/heishamon_rules_minify-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2fe04bd29eb94015ee21ed62d2aa74f003dd253605873bb1053fc2e89f7028c4",
                "md5": "8859b3cb62e5c62ac08293bf6035d858",
                "sha256": "95c6029940220ac621d1ea03943589c8fc3c7ca0e6186c1c99c14827345c39dc"
            },
            "downloads": -1,
            "filename": "heishamon_rules_minify-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "8859b3cb62e5c62ac08293bf6035d858",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 10857,
            "upload_time": "2024-11-28T21:10:51",
            "upload_time_iso_8601": "2024-11-28T21:10:51.282565Z",
            "url": "https://files.pythonhosted.org/packages/2f/e0/4bd29eb94015ee21ed62d2aa74f003dd253605873bb1053fc2e89f7028c4/heishamon_rules_minify-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-28 21:10:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "klaashoekstra94",
    "github_project": "heishamon-rules-minify",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "heishamon-rules-minify"
}
        
Elapsed time: 0.46728s