Skip to main content

Documentation Status

WS-Discovery in Python

This is WS-Discovery implementation for Python 3. It allows to both discover services and publish discoverable services. For Python 2 support, use the latest 1.x version of this package.

Extensive package documentation is available at ReadTheDocs.

Basic usage

A simple wsdiscover command-line client is provided for discovering WS-Discovery compliant devices and systems. Run wsdiscover --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.discovery import ThreadedWSDiscovery as WSDiscovery
    from wsdiscovery.publishing import ThreadedWSPublishing as WSPublishing
    from wsdiscovery import QName, Scope

    # Define type, scope & address of service
    ttype1 = QName("http://www.onvif.org/ver10/device/wsdl", "Device")
    scope1 = Scope("onvif://www.onvif.org/Model")
    xAddr1 = "localhost:8080/abc"

    # Publish the service
    wsp = WSPublishing()
    wsp.start()
    wsp.publishService(types=[ttype1], scopes=[scope1], xAddrs=[xAddr1])

    # Discover it (along with any other service out there)
    wsd = WSDiscovery()
    wsd.start()
    services = wsd.searchServices()
    for service in services:
        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.

Authors and maintaining

Original version created by L.A. Fernando.

Code was then forked and maintained by Andrei Kopats.

Python2 support fixes by Michael Leinartas.

Python3 port done by Pieter Jordaan.

Packaging, major refactoring & command-line clients and reStructuredText package documentation by Petri Savolainen.

Changelog

2.0.0 (2020-04-16)

  • decoupled threaded networking from ws-discovery implementation
  • refactored app-level discovery & publishing code into their own modules
  • refactored message construction, serialization & deserialization
  • added new wspublish command-line client to publish a service
  • added unicast discovery support to wsdiscovercommand-line client
  • collected all namespaces in one module
  • improved README example
  • good documentation in reStructuredText with Sphinx
  • removed Python 2 support code

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)

Metadata

Release files for WSDiscovery 2.0.0

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 2.0.0
File Size Uploaded Provenance Actions
WSDiscovery-2.0.0.tar.gz 23.5 kB Without provenance Details for WSDiscovery-2.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 54.8 kB

Release files / WSDiscovery-2.0.0.tar.gz

Download URL WSDiscovery-2.0.0.tar.gz
Size 23.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b0f9c36a11f9a56905223915c33c295f4240a6a25de60b32b305cbe69202ee78
BLAKE2b-256 checksum
How to use checksums
e5aed9055527b2e49232bbcca175c091aee82a4ba27ee137e33cf9f2f21fb3cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

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

Download URL WSDiscovery-2.0.0-py3-none-any.whl
Size 31.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
749400746d077d38c560f6bf89043421974809f93d92ad109668b95e7690b4a6
BLAKE2b-256 checksum
How to use checksums
1aeda415d6e41e9d46a2c4cfc60906d928909886491e4a70252301b93382bfba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

Security for WSDiscovery 2.0.0

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