Skip to main content

Interface for the lmw sip protocol

Project description

lmwsip

Introduction

lmwsip is a python library for the lmw sip protocol.

Package

The lmwsip package contains the class LmwSip to connect to the LMW meetnet using de SIP protocol. The library contains documentation how to use it.

Installing

Just install the package with 'pip':

pip install lmwsip

Examples

Username password

All examples contain "USER", "PASS". These values should be replaced by real credentials. Otherwise the connection fails.

Use send (low level)

from lmwsip import LmwSip

sip = LmwSip(ssl=True, host="sip-lmw.rws.nl", port=443)
sip.send("LI user,pass\r")
print("< [%s]" % (sip.recv().strip('\r')))
sip.send("TI LMW\r")
print("< [%s]" % (sip.recv().strip('\r')))
sip.send("LO\r")
print("< [%s]" % (sip.recv().strip('\r')))

Use value

from lmwsip import LmwSip
sip = LmwSip("USER", "PASS")
print(sip.ti())
print(sip.value("WN", "HOEK", "H10"))
sip.logout()

Use timeseries

from lmwsip import LmwSip
from datetime import datetime, timedelta
from pprint import pprint

end   = datetime.now()
start = end - timedelta(hours=1)

sip = LmwSip("USER", "PASS")
pprint(sip.timeSerie("WN", "HOEK", "H10", start, end).ts)

lmwsip.run

$ python -m lmwsip.run /tmp/hoek-h10.sip 
> [LI USER,PASS]
< [! ]
> [TI LMW]
< [! 08-SEP-20 12:03:27]
> [WN LMW,HOEK,H10,-01:00,08-09-2020,11:50,DATA]
< [! -17/50;-21/50;-24/50;-26/50;-27/50;-28/50;-28/50]
> [LO]
< [! ]

Unit tests

The code containts a python unittest.

This code runs a dummy sip server and runs a number of test against the dummy server.

Git pre commit hook

There is a pre-commit `githooks/pre-commit' with two functions:

  • Updating the __version__ in the module from setup.py
  • Running the unit test code.
  • Running a syntaxt test.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lmwsip-0.9.10.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lmwsip-0.9.10-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file lmwsip-0.9.10.tar.gz.

File metadata

  • Download URL: lmwsip-0.9.10.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for lmwsip-0.9.10.tar.gz
Algorithm Hash digest
SHA256 371c3ef5af1e1911178dec79a941d9e2061c27a85c4ed7314701a5e5f979e75f
MD5 5c28510715d0471bb6179a60fe9e5625
BLAKE2b-256 6fca93e5b6ee3b268480e22238af157f9507225fef106e1df6d99e5f668417b2

See more details on using hashes here.

File details

Details for the file lmwsip-0.9.10-py3-none-any.whl.

File metadata

  • Download URL: lmwsip-0.9.10-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for lmwsip-0.9.10-py3-none-any.whl
Algorithm Hash digest
SHA256 0178ba8ff434cb4610bc86e4e4687a740bd464d410f297213608095738ed466f
MD5 056c04fe48e32f202bedd0c9acbc5500
BLAKE2b-256 9521820e4a3409fdc6fcc4effe5d8a66f2f4168ad32a54055a2d532dc10f4b52

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page