Skip to main content

shared ram based data distribution lib

Project description

README

Project Scope:

ramshare:

Create data structures in shared memory based on a data structure file. Read and write to data structure tag. Data structure tags can be accessed system-wide.

procon:

producer:

Creates a socket server and either connect or create shared data structure. Consumers can connect to producer, and all data from data structure will be transferred to connected consumers periodic.

consumer:

Connects to producer, either creates or connects to shared data structure. Shared data structure will be overwritten periodic, so shared data structure is read only on consumer site.

Data structure .xml file:

<config>
    <connection_status LENGTH="2" TYPE="int" INIT_VALUE="0" DESCRIPTION="connection of status" > </connection_status>
    <tag_1 LENGTH="10" TYPE="int" > </tag_1>
    <timestamp LENGTH="20" TYPE="float" > </timestamp>
    <status LENGTH="100" TYPE="string" ></status>
</config>

Required tags:

For produced / consumed data structures, "connection_status" is required.

Required members:

tag_1 = reference name, used to read or write from data structure.

LENGTH = tag length in bytes, minimum value is 2

Optional members

TYPE = tag type, INIT_VALUE = initial tag value

DESCRIPTION = description of tag

Usage:

Write to tag:

from comram import ramshare

test = ramshare.RamShare("share_name", data_type="/path_to_structure/test_structure.xml")
test.write_to_tag("tag_1", 99)

Read from tag:

from comram import ramshare

test = ramshare.RamShare("share_name", data_type="/path_to_structure/test_structure.xml")
tag_1 = test.read_tag("tag_1")

Produce data structure:

from comram import procon

producer = procon.Produce("share_name", data_type="/path_to_structure/test_structure.xml", ip="127.0.0.1", port=9980, 
                          send_interval=0.01)
producer.start_produce()

Consume data structure:

from comram import procon

consumer = procon.Consume("share_name", "consumer_name", data_type="/path_to_structure/test_structure.xml",
                          ip="127.0.0.1", port=9980)
consumer.start_consume()

Known issues

tag lenght under under 2 byte not possible

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

comram-0.0.10.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

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

comram-0.0.10-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file comram-0.0.10.tar.gz.

File metadata

  • Download URL: comram-0.0.10.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.9

File hashes

Hashes for comram-0.0.10.tar.gz
Algorithm Hash digest
SHA256 1e3b5068101d27d3a04eb527d57b327b2cb149f160b8c2e67579b7f300dd456e
MD5 354fbf5459ea30762d6d7a5f53c72cd0
BLAKE2b-256 ac3048ca15f912b4b5b36bcacf36ad59b80b84b575f896de5bcdf17f26aec02d

See more details on using hashes here.

File details

Details for the file comram-0.0.10-py3-none-any.whl.

File metadata

  • Download URL: comram-0.0.10-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.9

File hashes

Hashes for comram-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 00b744a35a36225c4f8bfb6b36c382d67a9d9ddae715f68ed463fd2465a25e51
MD5 7271a2fe847af28e28dbf53c62e07a79
BLAKE2b-256 129c8fa17b5733d524f95619c5e4e289e4dd132992a4c9ba49e74280f77320a6

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