GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - taskiq-python/natsrpy: NATS client written in rust

BranchesTags
Open more actions menu

Latest commit

 

History

84 Commits
84 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
examples
examples
 
 
python
python
 
 
scripts
scripts
 
 
src
src
 
 
.gitignore
.gitignore
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
.rustfmt.toml
.rustfmt.toml
 
 
Cargo.lock
Cargo.lock
 
 
Cargo.toml
Cargo.toml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
docker-compose.yaml
docker-compose.yaml
 
 
pyproject.toml
pyproject.toml
 
 
uv.lock
uv.lock
 
 

Repository files navigation

PyPI PyPI - Downloads

Nats client

This is a client library for NATS written in rust.

Sponsors of this project

Special thanks for supporting development of this project.

share to connect

installation

This package can be installed from pypi:

pip install natsrpy

Or alternatively you can build it yourself using maturin, and stable rust.

Usage

import asyncio

from natsrpy import Nats

async def main() -> None:
    nats = Nats(["nats://localhost:4222"])
    await nats.startup()

    subscription = await nats.subscribe("hello")

    await nats.publish("hello", "str world")

    subscription.unsubscribe(limit=1)
    async for message in subscription:
        print(message)

    # Don't forget to call shutdown.
    await nats.shutdown()


if __name__ == "__main__":
    asyncio.run(main())

You can see more usage examples in our examples folder.

Also, our tests are written in python and could be a good place to discover features and the way they intended to be used.

As of for now, our documentation is only availabe in source code. You can see it in our type-stubs folder.

Development

We use stable rust and pyo3 for writing python extension module. In order to build the project, use uv and maturin.

uv is used for all python-side dependencies (including dev deps). Maturin is used only for building rust-side.

# To create .venv folder
uv venv
# Sync deps
uv sync --locked
# To build and install the package in a virtual environment
uv run -- maturin dev --uv

If you want to setup automatic rebuilds, use this command:

uv run -- python -m maturin_import_hook site install

It will force rebuild project when rust code changes.

For lints please use pre-commit.

pre-commit run -a

About

NATS client written in rust

Resources

Readme
MIT license
Activity
Custom properties

Stars

17 stars

Watchers

0 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.