REEM
Author: Trishul Nagenalli, updates by Kris Hauser
About
REEM (Redis Extendable Efficient Middleware) is a centralized middleware package for communication across distributed systems (e.g., robots). It is designed to be a single-package solution for passing information anywhere in the system while emphasizing ease of use and efficiency.
To make it easy, we chose to model information as a nested data structure that closely resembles python dictionaries. To the user, working with a database feels like working with a python dictionary. Out of the box, REEM supports communicating all native python types and numpy arrays.
To make it fast, we used Redis (an in-memory key-value database) running ReJSON (enabling Redis to store JSON data) as a central information store. To get maximum performance, we give users the power to control exactly how information is passed between the local program and Redis by defining their own encoder/decoder objects.
REEM currently offers two communication paradigms:
- get/set database
- publish-subscribe
Installation
To install the python package (and its dependencies), run
pip install reem
You will also need to have access to a Redis server with RedisJSON enabled. See the setup tutorial for step-by-step instructions o installing and configuring a compatible local Redis server.
Tutorials and API documentation
See example.py or the docs on read the docs.
Version history
0.1.2:
- bug fixes in pub/sub implementation.
- Added
get(key,default_value)to subkey accessor analogous to dict'sgetmethod.
0.1.1:
- added
get()andset()to KeyValueStore for direct access to Rejson's JSON.GET / JSON.SET.
0.1.0: fork by Kris Hauser
- Can now access items by array index.
- Much easier to work with items like normal Python objects. Can:
- Can treat accesssors as variables using
read()andwrite(), e.g.,var = server['key']; var.read(); var.write(x). (See bug fix note below). - Delete items via
del server['key']ordel server['key']['subkey'](uses Rejson's JSON.DEL) - Increment/decrement values via
server['key']['subkey'] += 1or-=(uses Rejson's JSON.NUMINCRBY). Note: does not work for Numpy arrays. - Multiply/divide values via
server['key']['subkey'] *= 2or/=(uses Rejson's JSON.NUMMULTBY). Note: does not work for Numpy arrays. - Append to arrays via
server['key'].append(x)orserver['key']['subkey'].append(x)(uses Rejson's JSON.ARRAPPEND) - Multiple append to arrays via
server['key'] += [x,y,z]orserver['key']['subkey'] += [x,y,z](uses Rejson's JSON.ARRAPPEND) - Get sizes of arrays/objects using
len(server['key'])orlen(server['key']['subkey'])(uses Rejson's JSON.OBJLEN or JSON.ARRLEN) - Get types of items using
server['key'].type()orserver['key']['subkey'].type()(uses Rejson's JSON.TYPE)
- Can treat accesssors as variables using
- KeyValueStore, PublishSpace, SilentSubscriber, and CallbackSubscriber are now in the global reem namespace. Also, they can be given a string host rather than separately having to create a RedisInterface object.
- KeyValueStore and PublishSpace are now thread safe. (Note: not thoroughly tested yet).
- Objects retrieved by ['key'] no longer get clobbered when accessing ['subkey']. E.g.,
kvs['topkey'] = {'subkey':{'foo':3}} a = kvs['topkey'] b = a['subkey'] b['foo'] = 4 print(a.read()) #prior version unexpected prints {'subkey':{'foo':3},'foo':4}, new version prints {'subkey'{'foo':4}} as expected. - Slight performance improvements for deeply nested accesses
- Python 2 version automatically returns json objects with keys / values as str instead of unicode.
0.0.x: original from Trishul Nagenalli
Metadata
Release files for reem 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| reem-0.1.2-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for reem-0.1.2-py2.py3-none-any.whl |
Release files / reem-0.1.2-py2.py3-none-any.whl
| Download URL | reem-0.1.2-py2.py3-none-any.whl |
|---|---|
| Size | 20.6 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
d5a300d4e4a5c92f2a1804f5a92d3be0a6d5b704d3d7a847aadff8606b452e0e
|
|
BLAKE2b-256 checksum How to use checksums |
3c5f9dc361bf0d00cdcf3213e2174b5b654bdaf0a148ec6bec29dadf0a1ae7dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.3.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.10
|
Security for reem 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.