No project description provided
Project description
py-dtn7 (Work in Progress -- don't use yet)
A Python library for the DTN7 REST and WebSocket API of dtn7-rs
including a BP7 style Bundle
type (sort of).
Be warned:
This is very much a work-in-progress. Apart from not being very useful yet, anything might change at any time since the package is still under development and the requirements are not all completely clear yet.
PR Politics
I'm sorry to say that right now I can't accept any Pull Requests, since this repo is part of my Bachelor Thesis and logically any external contribution is forbidden. If you want to contribute, please check back around November 2022. Until then feel free to fork this repo and do some of your own experiments.
Quickstart
>>> from py_dtn7 import DTNRESTClient
>>> client = DTNRESTClient(host="http://localhost", port=3000)
>>> d.peers
{'box1': {'eid': [1, '//box1/'], 'addr': {'Ip': '10.0.0.42'}, 'con_type': 'Dynamic', 'period': None, 'cla_list': [['MtcpConvergenceLayer', 16162]], 'services': {}, 'last_contact': 1653316457}}
>>> d.info
{'incoming': 0, 'dups': 0, 'outgoing': 0, 'delivered': 3, 'broken': 0}
When sending a bundle to a known peer, we can simply supply the peer name and endpoint, otherwise we use the complete URI:
>>> d.send(payload={"body": "This will be transferred as json"}, peer_name="box1", endpoint="info")
<Response [200]>
>>> r = d.send(payload="Is there anybody out there?", destination="dtn://greatunkown/incoming")
>>> r.content.decode("utf-8")
'Sent payload with 27 bytes'
Documentation
Use pdoc
to generate the API docs or check out py-dtn7.readthedocs.org
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 Distribution
Hashes for py_dtn7-0.2.1a4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e24faf27d3896df5d47383aeabf7378f76ebeb366b92d47ce5a7b28220d46c8b |
|
MD5 | 83310fc1a985b6108c8667fbca724001 |
|
BLAKE2b-256 | f2b3d8d52b62eba9530e6d842be91cbd410d0bf02e431887e2b6e0bead8a3437 |