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.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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file WSDiscovery-1.1.1.tar.gz
.
File metadata
- Download URL: WSDiscovery-1.1.1.tar.gz
- Upload date:
- Size: 17.6 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90f33ef319338e4e5f163f1533a09e442dd3d1d104127aac96407d07f639163c |
|
MD5 | f03951eb0cbc332233f9df132698dc4b |
|
BLAKE2b-256 | f37bc2176d3ee8b98705d43ae39cdf1f8b7e36947ed7eadefee83600cf36f181 |
File details
Details for the file WSDiscovery-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: WSDiscovery-1.1.1-py3-none-any.whl
- Upload date:
- Size: 24.0 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | c39d87f816b82555e82a81c27065dff870a594238e97dd5b651ba2cb2c603714 |
|
MD5 | f851866cbb2ebae270f84c593f470901 |
|
BLAKE2b-256 | 3b5a901c4431901e6a4534fe36a74709347b3564dd8839268e30e2211b386b9c |
File details
Details for the file WSDiscovery-1.1.1-py2-none-any.whl
.
File metadata
- Download URL: WSDiscovery-1.1.1-py2-none-any.whl
- Upload date:
- Size: 24.0 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b1746ed447c29c5d4f8dd56b1b98153edbc146bf919ebbe3aec724c203e26bf |
|
MD5 | c470580e1d1b5815b5ec04a874e4e5d3 |
|
BLAKE2b-256 | e0eea80a5cd8ea304df2ec2f40f72cf0677e2d3c2d71f948585417e02fde0f30 |