# Printer WS Client
A package for easy implementations of SimplyPrint printers.
## Usage
```python
from printer_ws_client import *
class MyClient(Client):
def __init__(self):
self.info.ui = "My Ui"
self.info.ui_version = "0.0.1"
self.info.api = "My Api"
self.info.api_version = "4.2.0"
self.local_path = "path_to_local_files"
# define a callback
async def on_connect(self, event: ConnectEvent):
print(f"Connected, got name: {event.name}")
# define another callback
async def on_start_print(self, _: StartPrintEvent):
# start the print somehow
start_print(self.selected_file)
my_client = MyClient()
# start the client
# this runs the background thread and starts even processing
my_client.start()
# run some loop
while True:
sleep(1)
# get data from printer
my_client.tool_temperatures = poll_tool_temperatures()
my_client.bed_temperature = poll_bed_temperature()
```
Raw data
{
"_id": null,
"home_page": "https://simplyprint.io",
"name": "simplyprint-ws-client",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10,<4.0",
"maintainer_email": "",
"keywords": "simplyprint,websocket,client",
"author": "SimplyPrint",
"author_email": "contact@simplyprint.io",
"download_url": "https://files.pythonhosted.org/packages/4d/02/370c9e97da0c28fd5c44d0bbea8f3910f73f41a09b3590a3edefe3976f39/simplyprint_ws_client-0.0.6.tar.gz",
"platform": null,
"description": "# Printer WS Client\n\nA package for easy implementations of SimplyPrint printers.\n\n## Usage\n\n```python\nfrom printer_ws_client import *\n\nclass MyClient(Client):\n def __init__(self):\n self.info.ui = \"My Ui\"\n self.info.ui_version = \"0.0.1\"\n\n self.info.api = \"My Api\"\n self.info.api_version = \"4.2.0\"\n\n self.local_path = \"path_to_local_files\"\n\n # define a callback\n async def on_connect(self, event: ConnectEvent):\n print(f\"Connected, got name: {event.name}\")\n\n # define another callback\n async def on_start_print(self, _: StartPrintEvent):\n # start the print somehow\n start_print(self.selected_file)\n\nmy_client = MyClient()\n\n# start the client\n# this runs the background thread and starts even processing\nmy_client.start()\n\n# run some loop\nwhile True:\n sleep(1)\n # get data from printer\n my_client.tool_temperatures = poll_tool_temperatures()\n my_client.bed_temperature = poll_bed_temperature()\n```\n\n",
"bugtrack_url": null,
"license": "AGPL-3.0-or-later",
"summary": "SimplyPrint Websocket Client",
"version": "0.0.6",
"project_urls": {
"Bug Tracker": "https://github.com/SimplyPrint/printer-ws-client/issues",
"Homepage": "https://simplyprint.io",
"Repository": "https://github.com/SimplyPrint/printer-ws-client"
},
"split_keywords": [
"simplyprint",
"websocket",
"client"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "dc7132f5fda8dd4a76ee897204fbb32eb15c30bfd57a9dbc4d0d9e9789db2ac2",
"md5": "71cfd2eb79e05d1bc09067ddfc102d4e",
"sha256": "e152e18510d5fd18218c8715a40906956638c9e7b99a900213f02cad00a18d0b"
},
"downloads": -1,
"filename": "simplyprint_ws_client-0.0.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "71cfd2eb79e05d1bc09067ddfc102d4e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10,<4.0",
"size": 32034,
"upload_time": "2023-04-01T23:26:22",
"upload_time_iso_8601": "2023-04-01T23:26:22.200471Z",
"url": "https://files.pythonhosted.org/packages/dc/71/32f5fda8dd4a76ee897204fbb32eb15c30bfd57a9dbc4d0d9e9789db2ac2/simplyprint_ws_client-0.0.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4d02370c9e97da0c28fd5c44d0bbea8f3910f73f41a09b3590a3edefe3976f39",
"md5": "811e87df9e7d7ea99b9683a4dc95c17d",
"sha256": "ea82490aa2a8cbcadb1ba85fc7d553f8d54e5762d434f82f6f82173024319eb7"
},
"downloads": -1,
"filename": "simplyprint_ws_client-0.0.6.tar.gz",
"has_sig": false,
"md5_digest": "811e87df9e7d7ea99b9683a4dc95c17d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10,<4.0",
"size": 28896,
"upload_time": "2023-04-01T23:26:24",
"upload_time_iso_8601": "2023-04-01T23:26:24.099520Z",
"url": "https://files.pythonhosted.org/packages/4d/02/370c9e97da0c28fd5c44d0bbea8f3910f73f41a09b3590a3edefe3976f39/simplyprint_ws_client-0.0.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-01 23:26:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "SimplyPrint",
"github_project": "printer-ws-client",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "simplyprint-ws-client"
}