# secsgem
Simple Python SECS/GEM implementation
This module is still work in progress. I'd love to get your input, your use case, whether you are experienced in SECS or not.
[![Test Coverage](https://api.codeclimate.com/v1/badges/223821436f063223b9da/test_coverage)](https://codeclimate.com/github/bparzella/secsgem/test_coverage)
[![Maintainability](https://api.codeclimate.com/v1/badges/223821436f063223b9da/maintainability)](https://codeclimate.com/github/bparzella/secsgem/maintainability)
[![Tests](https://github.com/bparzella/secsgem/actions/workflows/build.yaml/badge.svg)](https://github.com/bparzella/secsgem/actions/workflows/build.yaml)
[![Image](https://readthedocs.org/projects/secsgem/badge/)](http://secsgem.readthedocs.org/en/latest/)
## Installation
To install the latest official release (0.3.0, 2024-09-14, https://pypi.python.org/pypi/secsgem):
```bash
$ pip install secsgem
```
To install the current development code (might be instable):
```bash
$ pip install git+git://github.com/bparzella/secsgem
```
## Sample
```python
import logging
import code
import secsgem.common
import secsgem.gem
import secsgem.hsms
from communication_log_file_handler import CommunicationLogFileHandler
class SampleHost(secsgem.gem.GemHostHandler):
def __init__(self, settings: secsgem.common.Settings):
super().__init__(settings)
self.MDLN = "gemhost"
self.SOFTREV = "1.0.0"
commLogFileHandler = CommunicationLogFileHandler("log", "h")
commLogFileHandler.setFormatter(logging.Formatter("%(asctime)s: %(message)s"))
logging.getLogger("communication").addHandler(commLogFileHandler)
logging.getLogger("communication").propagate = False
logging.basicConfig(format='%(asctime)s %(name)s.%(funcName)s: %(message)s', level=logging.DEBUG)
settings = secsgem.hsms.HsmsSettings(
address="127.0.0.1",
port=5000,
connect_mode=secsgem.hsms.HsmsConnectMode.PASSIVE,
device_type=secsgem.common.DeviceType.HOST
)
h = SampleHost(settings)
h.enable()
code.interact("host object is available as variable 'h'", local=locals())
h.disable()
```
## Contribute
This project is still at its beginning. If you can offer suggestions, additional information or help please contact me.
Raw data
{
"_id": null,
"home_page": "https://github.com/bparzella/secsgem",
"name": "secsgem",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": "development, hsms, secs, gem",
"author": "Benjamin Parzella",
"author_email": "bparzella@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/d2/5e/640f53c54f79d540f75d511bd49a27035385d21418ef589d30bcdc21173d/secsgem-0.3.0.tar.gz",
"platform": null,
"description": "# secsgem\nSimple Python SECS/GEM implementation\n\nThis module is still work in progress. I'd love to get your input, your use case, whether you are experienced in SECS or not.\n\n[![Test Coverage](https://api.codeclimate.com/v1/badges/223821436f063223b9da/test_coverage)](https://codeclimate.com/github/bparzella/secsgem/test_coverage)\n[![Maintainability](https://api.codeclimate.com/v1/badges/223821436f063223b9da/maintainability)](https://codeclimate.com/github/bparzella/secsgem/maintainability)\n[![Tests](https://github.com/bparzella/secsgem/actions/workflows/build.yaml/badge.svg)](https://github.com/bparzella/secsgem/actions/workflows/build.yaml)\n[![Image](https://readthedocs.org/projects/secsgem/badge/)](http://secsgem.readthedocs.org/en/latest/)\n\n\n## Installation\nTo install the latest official release (0.3.0, 2024-09-14, https://pypi.python.org/pypi/secsgem):\n\n```bash\n$ pip install secsgem\n```\n\nTo install the current development code (might be instable):\n\n```bash\n$ pip install git+git://github.com/bparzella/secsgem\n```\n\n## Sample\n\n```python\nimport logging\nimport code\n\nimport secsgem.common\nimport secsgem.gem\nimport secsgem.hsms\n\nfrom communication_log_file_handler import CommunicationLogFileHandler\n\nclass SampleHost(secsgem.gem.GemHostHandler):\n def __init__(self, settings: secsgem.common.Settings):\n super().__init__(settings)\n\n self.MDLN = \"gemhost\"\n self.SOFTREV = \"1.0.0\"\n\ncommLogFileHandler = CommunicationLogFileHandler(\"log\", \"h\")\ncommLogFileHandler.setFormatter(logging.Formatter(\"%(asctime)s: %(message)s\"))\nlogging.getLogger(\"communication\").addHandler(commLogFileHandler)\nlogging.getLogger(\"communication\").propagate = False\n\nlogging.basicConfig(format='%(asctime)s %(name)s.%(funcName)s: %(message)s', level=logging.DEBUG)\n\nsettings = secsgem.hsms.HsmsSettings(\n address=\"127.0.0.1\",\n port=5000,\n connect_mode=secsgem.hsms.HsmsConnectMode.PASSIVE,\n device_type=secsgem.common.DeviceType.HOST\n)\n\nh = SampleHost(settings)\nh.enable()\n\ncode.interact(\"host object is available as variable 'h'\", local=locals())\n\nh.disable()\n```\n\n## Contribute\n\nThis project is still at its beginning. If you can offer suggestions, additional information or help please contact me.\n",
"bugtrack_url": null,
"license": "LGPL-2.1-or-later",
"summary": "Python SECS/GEM implementation",
"version": "0.3.0",
"project_urls": {
"Documentation": "https://secsgem.readthedocs.io/",
"Homepage": "https://github.com/bparzella/secsgem",
"Repository": "https://github.com/bparzella/secsgem"
},
"split_keywords": [
"development",
" hsms",
" secs",
" gem"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "08f55a2d32db683bb05db87ec251801d3177fa7f95f248d0de8064b358d124a0",
"md5": "a21676baafa78830fa06b5d4d9234e6a",
"sha256": "e1b89d5d47239de86d9da9d103736a7a86b57d28746f166dca88348f1776f960"
},
"downloads": -1,
"filename": "secsgem-0.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a21676baafa78830fa06b5d4d9234e6a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 398713,
"upload_time": "2024-09-14T17:52:28",
"upload_time_iso_8601": "2024-09-14T17:52:28.391447Z",
"url": "https://files.pythonhosted.org/packages/08/f5/5a2d32db683bb05db87ec251801d3177fa7f95f248d0de8064b358d124a0/secsgem-0.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d25e640f53c54f79d540f75d511bd49a27035385d21418ef589d30bcdc21173d",
"md5": "4a1e2bec2348e3aabb06840a7a4dbace",
"sha256": "9e21059dfb278799e254bab071c164e56ba624530e4900f4893e6787bbdab4f2"
},
"downloads": -1,
"filename": "secsgem-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "4a1e2bec2348e3aabb06840a7a4dbace",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 117519,
"upload_time": "2024-09-14T17:52:30",
"upload_time_iso_8601": "2024-09-14T17:52:30.174571Z",
"url": "https://files.pythonhosted.org/packages/d2/5e/640f53c54f79d540f75d511bd49a27035385d21418ef589d30bcdc21173d/secsgem-0.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-14 17:52:30",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "bparzella",
"github_project": "secsgem",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "secsgem"
}