Memory Object Server
A high-performance Python object sharing pool with distributed capabilities.
Features
- Support for any Python object: Including system-level objects like sockets
- Asynchronous communication: Built on asyncio for high performance
- Minimal API: Simple and intuitive interface
- Distributed support: Multi-node synchronization and discovery
- Auto-reconnection: Reliable TCP socket communication with automatic reconnection
- Thread-safe: Concurrent operations are fully supported
- Port detection: Smart startup with port availability checking
Installation
pip install memory-obj-server
Quick Start
Server
from memory_obj_pool import Server
server = Server(host='0.0.0.0', port=8765)
server.run()
Client
from memory_obj_pool import SyncClient
client = SyncClient(host='localhost', port=8765)
client.put('key', {'data': 'value'})
result = client.get('key')
print(result) # {'data': 'value'}
Async Client
import asyncio
from memory_obj_pool import Client
async def main():
client = Client(host='localhost', port=8765)
await client.put('key', {'data': 'value'})
result = await client.get('key')
print(result)
asyncio.run(main())
API Reference
Server
Server(host='0.0.0.0', port=8765, max_size=10000): Create a server instanceserver.run(): Start the server (blocking)await server.start(): Start the server (async)await server.stop(): Stop the server
Client
Client(host='localhost', port=8765, auto_reconnect=True): Create async clientawait client.connect(): Connect to serverawait client.put(key, obj): Store an objectawait client.get(key): Retrieve an objectawait client.remove(key): Remove an objectawait client.clear(): Clear all objectsawait client.size(): Get pool sizeawait client.contains(key): Check if key exists
SyncClient
SyncClient(host='localhost', port=8765, auto_reconnect=True): Create sync clientclient.put(key, obj): Store an objectclient.get(key): Retrieve an objectclient.remove(key): Remove an objectclient.clear(): Clear all objectsclient.size(): Get pool sizeclient.contains(key): Check if key exists
Distributed Usage
from memory_obj_pool import DistributedPool
pool = DistributedPool(
node_id='node1',
known_nodes=[('localhost', 8765)]
)
pool.start()
Requirements
- Python 3.7+
- dill
- asyncio
License
Apache License 2.0
Metadata
Release files for memory-obj-server 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| memory_obj_server-0.2.0.tar.gz | 11.5 kB | Without provenance | Details for memory_obj_server-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| memory_obj_server-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for memory_obj_server-0.2.0-py3-none-any.whl |
Total release size: 23.8 kB
Release files / memory_obj_server-0.2.0.tar.gz
| Download URL | memory_obj_server-0.2.0.tar.gz |
|---|---|
| Size | 11.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
20b5e735fe7b4d0de9668b458e3c1c896678f160e6b592136d9622c21fa2d03b
|
|
BLAKE2b-256 checksum How to use checksums |
ef58ded9cf3a7d0a72ab10632214e6259574565d27648da2b86a9e4516883fb5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.11
|
Release files / memory_obj_server-0.2.0-py3-none-any.whl
| Download URL | memory_obj_server-0.2.0-py3-none-any.whl |
|---|---|
| Size | 12.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
59b3309474d9af82dcf57db89ecaeab19160fd7ab8c30fab01826fffd74e9f95
|
|
BLAKE2b-256 checksum How to use checksums |
2d8f2ddc48011c24e0bba94bf41e37bea1a8abb044fe766c4e42e3d065fdfc76
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.11
|
Security for memory-obj-server 0.2.0
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.