py-ipfs-pubsub
Pubsub client for python, since ipfshttpclient pubsub isn't compatibe with the newer versions of ipfs. Using openpubsub.com
http://github.com/ZachisGit/py-ipfs-pubsub
Install
pip3 install py-ipfs-pubsub
Example
import pubsub
# Topic specific callback
def on_sub_test(data,seqno,topic_ids,cid):
print ("New Message:",cid)
print (data)
print ("")
# Subscribe - pubsub.sub(endpoint, topic, callback)
pubsub.sub("/dns/nodes.openpubsub.com/tcp/5001/http","mytopic",on_sub_test)
# Publish 10x
for i in range(10):
# Publish - pubsub.pub(endpoint, topic, str/bytes message)
pubsub.pub("/dns/nodes.openpubsub.com/tcp/5001/http","mytopic","Hello World!")
input("")
# Unsubscribe from topic - pubsub.unsub(topic)
pubsub.unsub("mytopic")
Release files for openpubsub 0.0.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 | |
|---|---|---|---|
| openpubsub-0.0.2.tar.gz | 2.3 kB | Details |
Release files / openpubsub-0.0.2.tar.gz
| Download URL | openpubsub-0.0.2.tar.gz |
|---|---|
| Size | 2.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3455b7b200998edf365a25774c24faf85c822fb6d6d8700107698bc65480c200
|
|
BLAKE2b-256 checksum How to use checksums |
2116354414e44dfc39668a954e02cc549ca8774b6921655cec5003b08be5041a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.6
|