Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Python client for NATS messaging system

License

NotificationsYou must be signed in to change notification settings

Gr1N/nats-python

Repository files navigation

Build StatuscodecovPyPIPyPI - Downloads

Python client for NATS messaging system.

This project is a replacement for abandonedpynats.nats-python supports only Python 3.6+ and fully covered with typings.

Go to theasyncio-nats project, if you're looking forasyncio implementation.

Installation

$ pip install nats-python

Usage

frompynatsimportNATSClientwithNATSClient()asclient:# Connectclient.connect()# Subscribedefcallback(msg):print(f"Received a message with subject{msg.subject}:{msg}")client.subscribe(subject="test-subject",callback=callback)# Publish a messageclient.publish(subject="test-subject",payload=b"test-payload")# wait for 1 messageclient.wait(count=1)

Contributing

To work on thenats-python codebase, you'll want to clone the project locally and install the required dependencies viapoetry:

$ git clone git@github.com:Gr1N/nats-python.git$ make install

To run tests and linters use command below:

$ make lint&& maketest

If you want to run only tests or linters you can explicitly specify which test environment you want to run, e.g.:

$ make lint-black

License

nats-python is licensed under the MIT license. See the license file for details.

About

Python client for NATS messaging system

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2026 Movatter.jp