A library built for azira application to make it easier for users to subscribe to stock tokens and continuously receive data in near real-time
Project description
AziraClient
AziraClient is a comprehensive library designed for testing and interacting with message bus streams, handling user authentication, and managing WebSocket connections in a streamlined manner.
The goal here is to make it easier for people to get off the ground quickly with using ZeroMQ for sending message streams in realtime.
The basis for this was built for an application that allows users to subscribe to stock tokens that interests them and receive that continuously in realtime.
Features
User authentication and registration.
- WebSocket connection management.
- Subscription to message bus streams.
- Testing utilities for ZeroMQ message bus.
Installation
To install AziraClient, run the following command:
``pip install aziraclient``
Quick Start
Here's a quick example to get you started:
from aziraclient.auth.auth_client import AuthClient
from aziraclient.subscription.subscription import SubscribeToToken
# User authentication
"""
base_url: url where your server application is running.
"""
auth_client = AuthClient(base_url="http://localhost:8000")
auth_client.register_user("username", "password")
auth_client.login_user("username", "password")
# WebSocket subscription
"""
username: name of what you registered with
jwt_token: would be returned upon successful login.
action: "subscribe" or "unsubscribe"
token_name: name of token to subscribe to.
"""
tester = SubscribeToToken("username", "jwt_token", "action", "token_name")
tester.test_connection()
Modules
Authentication
Handles user registration and login, managing JWT tokens for secure access.
Subscription
Manages WebSocket subscriptions, allowing users to subscribe or unsubscribe from specific tokens.
Message Bus Tester
Provides tools for testing and interacting with ZeroMQ message bus streams.
Usage
Refer to example_usage.py
for detailed examples on how to use each module.
Contributing
Contributions to aziraclient are welcome! Please read our contributing guidelines for details on how to submit pull requests, report issues, or request features.
License
This project is licensed under the MIT License - see the LICENSE file for details.
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
Built Distribution
File details
Details for the file aziraclient-0.1.1.tar.gz
.
File metadata
- Download URL: aziraclient-0.1.1.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a7647820126bb4f9641c4cb34ebc0f34b224fff383e154ee934e92a767dabee |
|
MD5 | e6c3115abf5675b8a8084e7a1a0f8f41 |
|
BLAKE2b-256 | 4f0729978504c009c397bbe879b0646821db7248c0bc7ab1a2893a39d22ae8ec |
File details
Details for the file aziraclient-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: aziraclient-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8633816d3d26aaa36ea8503ad956ef6e3233b30a6d367c1e403a4ce7415b8f2 |
|
MD5 | c4978571bfa20bbaa1a293680d7e58c4 |
|
BLAKE2b-256 | fc59d4aef376f43b0cce0284dc56abf6728bdfdaf674e60a74568387eaaa936d |