sartorius


Namesartorius JSON
Version 0.5.0 PyPI version JSON
download
home_pagehttps://github.com/numat/sartorius/
SummaryPython driver for Sartorius and Minebea Intec scales.
upload_time2023-05-23 21:12:44
maintainer
docs_urlNone
authorPatrick Fuller
requires_python
licenseGPLv2
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            sartorius
=========

Asynchronous python ethernet interface and command-line tool for Sartorius and
Minebea Intec scales.

![](https://www.dataweigh.com/media/11870/signum1.jpg)

Compatibility
=============

This driver should work for any ethernet scale that uses the standardized communications
protocol of the Scale Manufacturers Association. However, it has only been tested
on the following models:

 * Minebea Intec Signum
 * Sartorius Entris
 * Sartorius Miras

Installation
============

```
pip install sartorius
```

Scale Setup
===========

For Minebea scale setup, navigate to `SETUP` - `UNICOM` - `DATAPROT` - `ETHER`.

  * Make sure `SRC.IP` is set to a valid LAN address
  * Ensure `MODE` - `SBI-SRV` - `6.1.1` is set (manual says this should be default but it is not)
  * All other defaults are good

This driver is intended to be stable to disconnects, so operators should be
able to unplug and reposition the device without affecting any long polling.

Command Line
============

```
$ sartorius scale-ip.local
{
    "mass": 0.0,
    "units": "kg",
    "stable": true,
    "info": {
        "model": "SIWADCP-1-",
        "serial": "37454321",
        "software": "00-37-09"
    }
}
```
If using a port other than the default of 49155 e.g. for a MODBUS gateway, use `--port`
or a colon between the IP address and port.
`sartorius 192.168.1.1 --port 10000` or `sartorius 192.168.1.1:12345`

You can tare and zero with `--zero` and remove the info field with `--no-info`.
See `sartorius --help` for more.

To use in shell scripts, parse the json output with something like
[jq](https://stedolan.github.io/jq/). For example,
`sartorius scale-ip.local | jq .mass` will return the mass.

Python
======

If you'd like to link this to more complex behavior, consider using a Python
script. This driver exclusively supports asynchronous Python ≥3.7.

```python
import asyncio
import sartorius

async def get():
    async with sartorius.Scale('scale-ip.local') as scale:
        await scale.zero()             # Zero and tare the scale
        print(await scale.get())       # Get mass, units, stability
        print(await scale.get_info())  # Get model, serial, software version

asyncio.run(get())
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/numat/sartorius/",
    "name": "sartorius",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Patrick Fuller",
    "author_email": "pat@numat-tech.com",
    "download_url": "https://files.pythonhosted.org/packages/7c/aa/cb917c342306fea27118aa25919e04066c614555131f9fd4611106f4e1e0/sartorius-0.5.0.tar.gz",
    "platform": null,
    "description": "sartorius\n=========\n\nAsynchronous python ethernet interface and command-line tool for Sartorius and\nMinebea Intec scales.\n\n![](https://www.dataweigh.com/media/11870/signum1.jpg)\n\nCompatibility\n=============\n\nThis driver should work for any ethernet scale that uses the standardized communications\nprotocol of the Scale Manufacturers Association. However, it has only been tested\non the following models:\n\n * Minebea Intec Signum\n * Sartorius Entris\n * Sartorius Miras\n\nInstallation\n============\n\n```\npip install sartorius\n```\n\nScale Setup\n===========\n\nFor Minebea scale setup, navigate to `SETUP` - `UNICOM` - `DATAPROT` - `ETHER`.\n\n  * Make sure `SRC.IP` is set to a valid LAN address\n  * Ensure `MODE` - `SBI-SRV` - `6.1.1` is set (manual says this should be default but it is not)\n  * All other defaults are good\n\nThis driver is intended to be stable to disconnects, so operators should be\nable to unplug and reposition the device without affecting any long polling.\n\nCommand Line\n============\n\n```\n$ sartorius scale-ip.local\n{\n    \"mass\": 0.0,\n    \"units\": \"kg\",\n    \"stable\": true,\n    \"info\": {\n        \"model\": \"SIWADCP-1-\",\n        \"serial\": \"37454321\",\n        \"software\": \"00-37-09\"\n    }\n}\n```\nIf using a port other than the default of 49155 e.g. for a MODBUS gateway, use `--port`\nor a colon between the IP address and port.\n`sartorius 192.168.1.1 --port 10000` or `sartorius 192.168.1.1:12345`\n\nYou can tare and zero with `--zero` and remove the info field with `--no-info`.\nSee `sartorius --help` for more.\n\nTo use in shell scripts, parse the json output with something like\n[jq](https://stedolan.github.io/jq/). For example,\n`sartorius scale-ip.local | jq .mass` will return the mass.\n\nPython\n======\n\nIf you'd like to link this to more complex behavior, consider using a Python\nscript. This driver exclusively supports asynchronous Python \u22653.7.\n\n```python\nimport asyncio\nimport sartorius\n\nasync def get():\n    async with sartorius.Scale('scale-ip.local') as scale:\n        await scale.zero()             # Zero and tare the scale\n        print(await scale.get())       # Get mass, units, stability\n        print(await scale.get_info())  # Get model, serial, software version\n\nasyncio.run(get())\n```\n",
    "bugtrack_url": null,
    "license": "GPLv2",
    "summary": "Python driver for Sartorius and Minebea Intec scales.",
    "version": "0.5.0",
    "project_urls": {
        "Homepage": "https://github.com/numat/sartorius/"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9ae7c9f20a1e4cf7d3f67d8949f564baf5fdc0c4fdb76164777c658c6dfc6b44",
                "md5": "eda09b18e73b820ad618a1890e579096",
                "sha256": "f70bcd79793dd507042eda913e102e4332a0c72d654d12f59c4b07a585c067ec"
            },
            "downloads": -1,
            "filename": "sartorius-0.5.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "eda09b18e73b820ad618a1890e579096",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 15160,
            "upload_time": "2023-05-23T21:12:42",
            "upload_time_iso_8601": "2023-05-23T21:12:42.789126Z",
            "url": "https://files.pythonhosted.org/packages/9a/e7/c9f20a1e4cf7d3f67d8949f564baf5fdc0c4fdb76164777c658c6dfc6b44/sartorius-0.5.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7caacb917c342306fea27118aa25919e04066c614555131f9fd4611106f4e1e0",
                "md5": "3ccad62873f0c3ba65d322bd9ccd4266",
                "sha256": "33d3cb3d5fa1746b8fe0a35bb33be3aa3de0704087c4d6f981eda3cf181c4cd5"
            },
            "downloads": -1,
            "filename": "sartorius-0.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "3ccad62873f0c3ba65d322bd9ccd4266",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 14055,
            "upload_time": "2023-05-23T21:12:44",
            "upload_time_iso_8601": "2023-05-23T21:12:44.740135Z",
            "url": "https://files.pythonhosted.org/packages/7c/aa/cb917c342306fea27118aa25919e04066c614555131f9fd4611106f4e1e0/sartorius-0.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-23 21:12:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "numat",
    "github_project": "sartorius",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "sartorius"
}
        
Elapsed time: 0.06909s