A Python asyncio client for NATS messaging system with JetStream support and server management tools.
NATS.py is a Python client library for the NATS messaging system that provides async/await support for publish-subscribe patterns and JetStream functionality. It enables developers to build distributed, real-time applications with high-performance messaging capabilities using native Python async patterns.
Python developers building distributed systems, microservices architectures, or real-time applications that require reliable messaging patterns and async communication.
Developers choose NATS.py for its clean asyncio-native API, full JetStream support, and comprehensive feature set that makes it the most complete Python client for NATS while maintaining minimal dependencies and excellent performance.
Python3 client for NATS
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides a clean, idiomatic async API that integrates seamlessly with modern Python asyncio, as shown in the getting started examples with `async def` and `await` calls for pub/sub operations.
Supports NATS JetStream with stream management, consumers, and persistence, enabling at-least-once delivery and durable subscriptions, demonstrated in the JetStream code snippets for push and pull consumers.
Includes TLS support with customizable SSL contexts and NATS 2.0 authentication using NKEYS and JWT, with specific instructions in the README for secure connections and credential setup.
Comes with the nats-server package for managing NATS servers in testing environments, making it easier to develop and debug NATS-based applications without external dependencies.
Designed exclusively for asyncio, so it cannot be used in synchronous Python code without significant refactoring or event loop management, limiting compatibility with legacy systems.
Configuring NKEYS and JWT authentication requires installing optional dependencies (`nats-py[nkeys]`) and managing credential files, adding steps and potential points of failure to the setup process.
The client is specific to the NATS ecosystem, so migrating to other messaging systems like Apache Kafka or RabbitMQ would require rewriting core messaging logic, creating vendor lock-in.