NetworkPype is aPython library for building efficient network communication pipelines, supporting both REST and WebSocket protocols with built-in rate limiting and time synchronization.
Project description
Network Pypeline
A powerful Python library for building efficient network communication pipelines, supporting both REST and WebSocket protocols with built-in rate limiting and time synchronization.
Features
- 🔄 Dual Protocol Support: Seamlessly handle both REST and WebSocket communications
- 🚦 Rate Limiting: Built-in throttling mechanism to respect API rate limits
- ⏰ Time Synchronization: Automatic time synchronization for accurate API interactions
- 🏭 Factory Pattern: Easy-to-use factory for creating and managing connections
- 🔌 Modular Design: Extensible processor architecture for custom request/response handling
- 🛡️ Type Safety: Full type hinting support for better development experience
Installation
Install using pip:
pip install networkpype
Or with Poetry:
poetry add networkpype
Quick Start
REST Example
from networkpype.factory import ConnectionFactory
from networkpype.rest.method import Method
# Create a REST connection
factory = ConnectionFactory()
connection = factory.create_rest_connection(
base_url="https://api.example.com",
rate_limit=100 # requests per minute
)
# Make a request
response = connection.request(
method=Method.GET,
endpoint="/users",
params={"page": 1}
)
WebSocket Example
from networkpype.factory import ConnectionFactory
# Create a WebSocket connection
factory = ConnectionFactory()
connection = factory.create_websocket_connection(
url="wss://ws.example.com"
)
# Subscribe to updates
connection.subscribe(
channel="market.btcusdt.trade",
callback=lambda msg: print(f"Received: {msg}")
)
Documentation
For detailed documentation, please visit networkpype.readthedocs.io.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file networkpype-1.0.0.tar.gz.
File metadata
- Download URL: networkpype-1.0.0.tar.gz
- Upload date:
- Size: 27.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.13.1 Darwin/24.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e41dd7dcb3d0e1467ca4341ae0e3653096a032b47a2ac08606d76d71f226f4b8
|
|
| MD5 |
57c024fb048167739d58c7bce63514c9
|
|
| BLAKE2b-256 |
a8837b54fb844c50bdd053d00976433f1791cbf0f2d874b7d0ad444ef217c282
|
File details
Details for the file networkpype-1.0.0-py3-none-any.whl.
File metadata
- Download URL: networkpype-1.0.0-py3-none-any.whl
- Upload date:
- Size: 38.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.13.1 Darwin/24.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3526ea759dc6d83f5a4bf21bf928d47ed6558e152371cfa6c813761e0e72cc15
|
|
| MD5 |
cba677f41eb98cd1ec0eccef2e5d8410
|
|
| BLAKE2b-256 |
36d566e4e18a471a9bd45660bf78f3125baee478ac34dbe363ce8f655f1d8b1e
|