Skip to main content

NetworkPype is a Python 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

PyPI version Python Documentation Status License

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

networkpype-1.0.1.tar.gz (26.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

networkpype-1.0.1-py3-none-any.whl (38.2 kB view details)

Uploaded Python 3

File details

Details for the file networkpype-1.0.1.tar.gz.

File metadata

  • Download URL: networkpype-1.0.1.tar.gz
  • Upload date:
  • Size: 26.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.2 Darwin/24.3.0

File hashes

Hashes for networkpype-1.0.1.tar.gz
Algorithm Hash digest
SHA256 58b587fba2b781ed6a3d9df756e584054b7732b9879c76814dc022bc19ce38e2
MD5 79c78f36936f04b8700fe47a92338dc6
BLAKE2b-256 4c689000605eea21c64d8b1290db87212365c489f4d98a7c6bd75623aabbdf57

See more details on using hashes here.

File details

Details for the file networkpype-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: networkpype-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 38.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.2 Darwin/24.3.0

File hashes

Hashes for networkpype-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 27cd3c4cb6f4d183c6e83cbc151167bc77669652b5d6d9deeb9cdb1a693c198b
MD5 2fd7230c9d19547205774d26cfb98fe1
BLAKE2b-256 952c6eb6e38a2415a96909f47c20a0089832182b61950131f112dfe210189818

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page