Skip to main content

Shared Memory Data Structure

This package allows you to use your data structures like numpy arrays in the shared memory environment between two or more python processes. This library simplifies the use of shared memory data structures as you don't need to manually manage shared memory.

SharedArray example:

Process #1

from shared_ds import SharedArray

# Create shared memory and put you numpy array into that memory segment.
shared_np_array = SharedArray.from_array(np_array)

shm_descriptor = shared_np_array.to_json()

Process #2

from shared_ds import SharedArray

# Attaches to existing shared memory and reads numpy array representation.
shared_np_array = SharedArray.from_json(shm_descriptor)

shm_descriptor = shared_np_array.to_json()

io.BytesIO example:

Process #1

from shared_ds import SharedBytesIO
import io

# Create shared memory and put content of passed BytesIO into that memory segment.
data_to_store = io.BytesIO(b'data which we want to store')
shared_memory = SharedBytesIO.from_bytes_io(data_to_store)

shm_descriptor = shared_memory.to_json()

Process #2

from shared_ds import SharedBytesIO

# Attaches to existing shared memory and gets io.BytesIO content.
shared_memory = SharedBytesIO.from_json(shm_descriptor)

data = shared_memory.get_data()

Currently supported data structures:

  • Numpy Array
  • io.BytesIO

Metadata

Release files for shared-ds 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for shared-ds 0.0.5
File Size Uploaded
shared_ds-0.0.5.tar.gz 3.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for shared-ds 0.0.5
File Interpreter ABI Platform
shared_ds-0.0.5-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 7.9 kB

Release files / shared_ds-0.0.5.tar.gz

Download URL shared_ds-0.0.5.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f2f5299f5c735fa532e2abadca9814c8bad1dc9e69952b5d00547b1c15eb43d7
BLAKE2b-256 checksum
How to use checksums
af020a46381401e8d650540870e9596c13d1b22160af089f3c0098ccb48f5e34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

Release files / shared_ds-0.0.5-py2.py3-none-any.whl

Download URL shared_ds-0.0.5-py2.py3-none-any.whl
Size 4.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
4d6ce53b9a549933dea6f1ce5f2953fffe6f83d556d674dab165c1cfa6c1b708
BLAKE2b-256 checksum
How to use checksums
cd0237ad4c209bde3f2e746fbfd04e157b72b03343f71d58e19d4d86e9618748
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page