Skip to main content

WS-Discovery implementation for python

Project description

WS-Discovery in Python

This is WS-Discovery implementation for Python 2 & 3. It allows to both discover services and publish discoverable services.

Authors and maintaining

Original version created by L.A. Fernando. Code was then forked and maintained by Andrei Kopats. Python3 port done by Pieter Jordaan. Packaging, major refactoring & command-line client by Petri Savolainen. Python2 support fixes by Michael Leinartas.

Usage

A simple discover command-line client is provided for discovering WS-Discovery compliant devices and systems. Run discover --help for usage instructions.

Here's an example of how to use the package in your Python code. The following code first publishes a service and then discovers it:

    from wsdiscovery import WSDiscovery, QName, Scope

    wsd = WSDiscovery()
    wsd.start()

    ttype = QName("abc", "def")

    ttype1 = QName("namespace", "myTestService")

    # Note: some devices scope services using onvif:// scheme, not http://
    scope1 = Scope("http://myscope")
    ttype2 = QName("namespace", "myOtherTestService_type1")
    scope2 = Scope("http://other_scope")

    xAddr = "localhost:8080/abc"
    wsd.publishService(types=[ttype], scopes=[scope2], xAddrs=[xAddr])

    #ret = wsd.searchServices(scopes=[scope1], timeout=10)
    ret = wsd.searchServices()

    for service in ret:
        print(service.getEPR() + ":" + service.getXAddrs()[0])

    wsd.stop()

Development state

This is not 100% complete and correct WS-Discovery implementation. It doesn't verify data received from the network. It may crash, and might contain security holes. No guarantees - test it carefully for your use case.

Changelog

1.1.2 (2019-01-01)

  • Refactoring & Python2 fixes
  • Introduce automated Travis testing

1.1.1 (2018-12-21)

  • Fix packaging

1.1.0 (2018-12-21)

  • Add a simple command-line client (petri)
  • Debugging support, including message capture (petri)
  • Fix breakage caused by refactoring (petri)
  • Simple tests (petri)

1.0.0 (2018-12-18)

  • Improved packaging (petri)
  • Modularize & refactor (petri)
  • Better Python2 support (mleinart)

0.2 (2017-05-19)

  • First release @pypi (petri)

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

WSDiscovery-1.1.2.tar.gz (17.7 kB view details)

Uploaded Source

Built Distributions

WSDiscovery-1.1.2-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

WSDiscovery-1.1.2-py2-none-any.whl (24.2 kB view details)

Uploaded Python 2

File details

Details for the file WSDiscovery-1.1.2.tar.gz.

File metadata

  • Download URL: WSDiscovery-1.1.2.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for WSDiscovery-1.1.2.tar.gz
Algorithm Hash digest
SHA256 f0a28cd63dc84decc98064b8bdc876ce6cf06643fc797a52cf9609a831b7f9c5
MD5 cf783088ab14bf138e4785088f5c2be4
BLAKE2b-256 5d49796c6da6f54481a4cae85d25645e699d5f41504d0b444fba91f3d3951a33

See more details on using hashes here.

File details

Details for the file WSDiscovery-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: WSDiscovery-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 24.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for WSDiscovery-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e7f3477948d7bd4f60b2e280db934eb0b547fab576da90343e45e16c600d7225
MD5 15fa5257a66299f59df03186dffc9ca7
BLAKE2b-256 8103d2d6b5555cc6bffae65c596cee873b4ad0f1b59202af351d8c6db59b517d

See more details on using hashes here.

File details

Details for the file WSDiscovery-1.1.2-py2-none-any.whl.

File metadata

  • Download URL: WSDiscovery-1.1.2-py2-none-any.whl
  • Upload date:
  • Size: 24.2 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for WSDiscovery-1.1.2-py2-none-any.whl
Algorithm Hash digest
SHA256 d3a6a84c286615ea6d99da412301a98d77f78a1785b92fc30b693acb96444704
MD5 1054a3202fa96dabb77e33ffdebda03f
BLAKE2b-256 e57b409d06d2fdfe1a2935d059934b346ec9d797a3dfeb98fc671e0be61c153b

See more details on using hashes here.

Supported by

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