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)
Metadata
Release files for WSDiscovery 1.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| WSDiscovery-1.1.2.tar.gz | 17.7 kB | Without provenance | Details for WSDiscovery-1.1.2.tar.gz |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| WSDiscovery-1.1.2-py3-none-any.whl | Python 3 | none | any | Details for WSDiscovery-1.1.2-py3-none-any.whl |
| WSDiscovery-1.1.2-py2-none-any.whl | Python 2 | none | any | Details for WSDiscovery-1.1.2-py2-none-any.whl |
Total release size: 66.2 kB
Release files / WSDiscovery-1.1.2.tar.gz
| Download URL | WSDiscovery-1.1.2.tar.gz |
|---|---|
| Size | 17.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f0a28cd63dc84decc98064b8bdc876ce6cf06643fc797a52cf9609a831b7f9c5
|
|
BLAKE2b-256 checksum How to use checksums |
5d49796c6da6f54481a4cae85d25645e699d5f41504d0b444fba91f3d3951a33
|
| 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.2-py3-none-any.whl
| Download URL | WSDiscovery-1.1.2-py3-none-any.whl |
|---|---|
| Size | 24.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e7f3477948d7bd4f60b2e280db934eb0b547fab576da90343e45e16c600d7225
|
|
BLAKE2b-256 checksum How to use checksums |
8103d2d6b5555cc6bffae65c596cee873b4ad0f1b59202af351d8c6db59b517d
|
| 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.2-py2-none-any.whl
| Download URL | WSDiscovery-1.1.2-py2-none-any.whl |
|---|---|
| Size | 24.2 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
d3a6a84c286615ea6d99da412301a98d77f78a1785b92fc30b693acb96444704
|
|
BLAKE2b-256 checksum How to use checksums |
e57b409d06d2fdfe1a2935d059934b346ec9d797a3dfeb98fc671e0be61c153b
|
| 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.2
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.