Cosmo Network Discovery API
Documentation for The OpenSource Cosmo Network Discovery API
This is the main implemtation written in python. For other implementations see Implemtations and for a description on the API and Protocol see API Docs
Installation
You can Install it with Pip and PyPi
python3 -m pip install cosmodiscovery
or with Pip and Github without PyPi
python3 -m pip install git+https://github.com/SamHDev/CosmoDiscovery.git
Usage
Import the libary
import cosmodiscovery as discovery
A Discovery Server
server = discovery.DiscoveryServer()
server.listen()
Yep! Thats it!
If you want a custom scheme or port you can do it like this:
server = discovery.DiscoveryServer(port=12892, scheme="_discovery._cosmo.home_device"))
Sending Custom Data with the discovery reply. cls is a DiscoveryRequestMessage Object
@server.discovery_callback
def on_msg(cls):
cls.reply(data={})
A Discovery Client
Create a DiscoveryClient Object like this
server = discovery.DiscoveryServer()
Or with Paramaters like so
client = discovery.DiscoveryClient(port=12892, scheme="_discovery._cosmo.home_device"))
One Created you can run this
results = client.discovery()
This function returns a list of DiscoveryResult objects. If the list is empty, then no devices were found.
If you wish to add arguments such as custom data to send within the Discovery Request or shorten the discovey reply wait time
you can do so like this:
results = discovery(timeout=1, data={})
Again! Its that simple
Further Documentation
For Further Documentation see docs.md
Written for CosmoHome by SamHDev. Licensed under GNU General Public License v3.0 as per License File
Metadata
Release files for cosmodiscovery 0.1.0
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 |
|---|---|---|---|---|
| cosmodiscovery-0.1.0.tar.gz | 3.5 kB | Without provenance | Details for cosmodiscovery-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cosmodiscovery-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for cosmodiscovery-0.1.0-py3-none-any.whl |
Total release size: 21.0 kB
Release files / cosmodiscovery-0.1.0.tar.gz
| Download URL | cosmodiscovery-0.1.0.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
719d7bd979b62a55464e99eb9c8d6790cd5a6cbae32f7f88320f324575ba7107
|
|
BLAKE2b-256 checksum How to use checksums |
a824fd2dcb6babee9ee93472cbccd45d42aad0914f4e146fdef6261dcab61e29
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8
|
Release files / cosmodiscovery-0.1.0-py3-none-any.whl
| Download URL | cosmodiscovery-0.1.0-py3-none-any.whl |
|---|---|
| Size | 17.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4523ca40ed4b522ba3d209066f3af585bdfe55c5209d5281ae8f92fafffd2103
|
|
BLAKE2b-256 checksum How to use checksums |
220bcc1fd5965bbaedff2fe1ea645c450c9e92da790de1cdb1a5876271a156f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8
|
Security for cosmodiscovery 0.1.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.