Skip to main content

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_ipfs_pubsub-0.0.2-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

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

Hashes for py-ipfs-pubsub-0.0.2.tar.gz
Algorithm Hash digest
SHA256 b55dc4cb540fb1fc9cbb63e578cfe5367f0c3e408834751eb38469c0decf2f96
MD5 485a4e9bc34f3eb2db4cffdb228c12cf
BLAKE2b-256 04a709a0876492c5a44163917732f3243b673bdb550cc790ae26ab74d3b2168b

See more details on using hashes here.

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

Hashes for py_ipfs_pubsub-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0c156f07d78b30568f4d61f89681c24a854b03a17373dd26d1cff16401978582
MD5 e4315089917c28a63db35d7b7302de3e
BLAKE2b-256 e1b9db227b1ef6a189b58b25c87d7821f689b561778ee5970c0a0b7966051f58

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page