Skip to main content

Basic but fast network communication between scientific applications

Project description

py-hi-tension, hi-tension for Python

py-hi-tension is a Python module designed for basic but fast network communication between scientific applications, backed by hi-tension. The focus is on transferring large unsized arrays of f64 with maximum throughput and minimum latency. More informations to be found in hi-tension's github page.

Usage

Using the library is quite simple:

# Connect to a server
socket = HiTensionSocket.connect("127.0.0.1:34487")
# You can make such a server though the following line:
# socket = HiTensionSocket.accept("127.0.0.1:34487")

# Send a simple text message
socket.send(b"status\n")
# Receive a simple text message
text_data = socket.read()

# Send formatted data as simple text message
id = 1
msg = f"do_something {id + 1}\n"
socket.send(msg.encode())

# Send formatted data and receive a high tension message
msg = f"fly {id}\n"
socket.send(msg.encode())
array = socket.hiread() # array is a numpy array

# Send the array back as a high tension message
socket.hisend(array)
socket.hidelimiter()

# You can send the array back
socket.hisend(array)
socket.hidelimiter()

# You may send your data in multible packets
socket.hisend(array[:10])
socket.hisend(array[10:])
socket.hidelimiter()
# This is useful for example if you are calculating your data while
# transferring it.

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

hi_tension-0.1.0.tar.gz (4.8 kB view hashes)

Uploaded Source

Built Distributions

hi_tension-0.1.0-cp36-abi3-win_amd64.whl (137.4 kB view hashes)

Uploaded CPython 3.6+ Windows x86-64

hi_tension-0.1.0-cp36-abi3-win32.whl (131.1 kB view hashes)

Uploaded CPython 3.6+ Windows x86

hi_tension-0.1.0-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (892.4 kB view hashes)

Uploaded CPython 3.6+ manylinux: glibc 2.17+ ARM64

hi_tension-0.1.0-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (904.3 kB view hashes)

Uploaded CPython 3.6+ manylinux: glibc 2.12+ x86-64

hi_tension-0.1.0-cp36-abi3-manylinux_2_12_i686.manylinux2010_i686.whl (944.0 kB view hashes)

Uploaded CPython 3.6+ manylinux: glibc 2.12+ i686

hi_tension-0.1.0-cp36-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (479.8 kB view hashes)

Uploaded CPython 3.6+ macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

hi_tension-0.1.0-cp36-abi3-macosx_10_7_x86_64.whl (237.8 kB view hashes)

Uploaded CPython 3.6+ macOS 10.7+ x86-64

Supported by

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