-
-
Notifications
You must be signed in to change notification settings - Fork 9
Network & Ecosystem
Lukatrum edited this page May 12, 2026
·
1 revision
Transform a local omni-json-db instance into a highly concurrent networked microservice with a single command.
Server Side:
from omni_json_db import run_files_server
# Start a daemon serving the database over TCP
run_files_server(host='127.0.0.1', port=59898, files='storage.jdb')Client Side:
from omni_json_db import JDb
# Connect directly via IP and Port
jdb = JDb('127.0.0.1:59898')
jdb["remote_key"] = "Hello from client!"Easily isolate and manage different data modules within the same database file using "Groups".
# Add a logical group
r_jdb = jdb.add_group('red')
y_jdb = jdb.add_group('yellow')
r_jdb += {'apple': {'qty': 1}, 'tomato': {'qty': 2}}
y_jdb += {'banana': {'qty': 4}, 'lemon': {'qty': 6}}
# Read across groups using namespace syntax
print(jdb['red:::apple']['qty']) # Output: 1Built-in hooks allow you to quickly import/export massive datasets to CSV for analysis in Excel or Pandas.
# Export the database to CSV
jdb.to_csv('dataset.csv')
# Create a new in-memory DB and import the CSV
mem_db = JDb()
mem_db.from_csv('dataset.csv')