Pubsub client for python, since ipfshttpclient pubsub isn't compatibe with the newer versions of ipfs
Project description
py-ipfs-pubsub
Pubsub client for python, since ipfshttpclient pubsub isn't compatibe with the newer versions of ipfs
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/127.0.0.1/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/127.0.0.1/tcp/5001/http","mytopic","Hello World!")
input("")
# Unsubscribe from topic - pubsub.unsub(topic)
pubsub.unsub("mytopic")
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
py-ipfs-pubsub-0.0.2.tar.gz
(3.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file py-ipfs-pubsub-0.0.2.tar.gz.
File metadata
- Download URL: py-ipfs-pubsub-0.0.2.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b55dc4cb540fb1fc9cbb63e578cfe5367f0c3e408834751eb38469c0decf2f96
|
|
| MD5 |
485a4e9bc34f3eb2db4cffdb228c12cf
|
|
| BLAKE2b-256 |
04a709a0876492c5a44163917732f3243b673bdb550cc790ae26ab74d3b2168b
|
File details
Details for the file py_ipfs_pubsub-0.0.2-py3-none-any.whl.
File metadata
- Download URL: py_ipfs_pubsub-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c156f07d78b30568f4d61f89681c24a854b03a17373dd26d1cff16401978582
|
|
| MD5 |
e4315089917c28a63db35d7b7302de3e
|
|
| BLAKE2b-256 |
e1b9db227b1ef6a189b58b25c87d7821f689b561778ee5970c0a0b7966051f58
|