Skip to main content

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.0 (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)

Metadata

Release files for WSDiscovery 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for WSDiscovery 1.1.1
File Size Uploaded Provenance Actions
WSDiscovery-1.1.1.tar.gz 17.6 kB Without provenance Details for WSDiscovery-1.1.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for WSDiscovery 1.1.1
File Interpreter ABI Platform Actions
WSDiscovery-1.1.1-py3-none-any.whl Python 3 none any Details for WSDiscovery-1.1.1-py3-none-any.whl
WSDiscovery-1.1.1-py2-none-any.whl Python 2 none any Details for WSDiscovery-1.1.1-py2-none-any.whl

Total release size: 65.5 kB

Release files / WSDiscovery-1.1.1.tar.gz

Download URL WSDiscovery-1.1.1.tar.gz
Size 17.6 kB
Tags Source
SHA-256 checksum
How to use checksums
90f33ef319338e4e5f163f1533a09e442dd3d1d104127aac96407d07f639163c
BLAKE2b-256 checksum
How to use checksums
f37bc2176d3ee8b98705d43ae39cdf1f8b7e36947ed7eadefee83600cf36f181
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / WSDiscovery-1.1.1-py3-none-any.whl

Download URL WSDiscovery-1.1.1-py3-none-any.whl
Size 24.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c39d87f816b82555e82a81c27065dff870a594238e97dd5b651ba2cb2c603714
BLAKE2b-256 checksum
How to use checksums
3b5a901c4431901e6a4534fe36a74709347b3564dd8839268e30e2211b386b9c
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / WSDiscovery-1.1.1-py2-none-any.whl

Download URL WSDiscovery-1.1.1-py2-none-any.whl
Size 24.0 kB
Tags Python 2
SHA-256 checksum
How to use checksums
6b1746ed447c29c5d4f8dd56b1b98153edbc146bf919ebbe3aec724c203e26bf
BLAKE2b-256 checksum
How to use checksums
e0eea80a5cd8ea304df2ec2f40f72cf0677e2d3c2d71f948585417e02fde0f30
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for WSDiscovery 1.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page