kedis-python 0.1.1__tar.gz → 0.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. {kedis_python-0.1.1 → kedis_python-0.1.3}/PKG-INFO +3 -1
  2. {kedis_python-0.1.1 → kedis_python-0.1.3}/kedis_python/main.py +34 -1
  3. {kedis_python-0.1.1 → kedis_python-0.1.3}/kedis_python/server.py +5 -1
  4. {kedis_python-0.1.1 → kedis_python-0.1.3}/kedis_python.egg-info/PKG-INFO +3 -1
  5. {kedis_python-0.1.1 → kedis_python-0.1.3}/kedis_python.egg-info/SOURCES.txt +1 -0
  6. {kedis_python-0.1.1 → kedis_python-0.1.3}/kedis_python.egg-info/entry_points.txt +1 -0
  7. kedis_python-0.1.3/kedis_python.egg-info/requires.txt +2 -0
  8. {kedis_python-0.1.1 → kedis_python-0.1.3}/pyproject.toml +3 -2
  9. {kedis_python-0.1.1 → kedis_python-0.1.3}/LICENSE +0 -0
  10. {kedis_python-0.1.1 → kedis_python-0.1.3}/README.md +0 -0
  11. {kedis_python-0.1.1 → kedis_python-0.1.3}/kedis_python/__init__.py +0 -0
  12. {kedis_python-0.1.1 → kedis_python-0.1.3}/kedis_python/benchmark.py +0 -0
  13. {kedis_python-0.1.1 → kedis_python-0.1.3}/kedis_python/benchmark_asyncio.py +0 -0
  14. {kedis_python-0.1.1 → kedis_python-0.1.3}/kedis_python/commands.py +0 -0
  15. {kedis_python-0.1.1 → kedis_python-0.1.3}/kedis_python/kesp_cli.py +0 -0
  16. {kedis_python-0.1.1 → kedis_python-0.1.3}/kedis_python/network.py +0 -0
  17. {kedis_python-0.1.1 → kedis_python-0.1.3}/kedis_python/parser.py +0 -0
  18. {kedis_python-0.1.1 → kedis_python-0.1.3}/kedis_python/replica.py +0 -0
  19. {kedis_python-0.1.1 → kedis_python-0.1.3}/kedis_python/simulator.py +0 -0
  20. {kedis_python-0.1.1 → kedis_python-0.1.3}/kedis_python/skiplist.py +0 -0
  21. {kedis_python-0.1.1 → kedis_python-0.1.3}/kedis_python/store.py +0 -0
  22. {kedis_python-0.1.1 → kedis_python-0.1.3}/kedis_python/ui.py +0 -0
  23. {kedis_python-0.1.1 → kedis_python-0.1.3}/kedis_python.egg-info/dependency_links.txt +0 -0
  24. {kedis_python-0.1.1 → kedis_python-0.1.3}/kedis_python.egg-info/top_level.txt +0 -0
  25. {kedis_python-0.1.1 → kedis_python-0.1.3}/setup.cfg +0 -0
  26. {kedis_python-0.1.1 → kedis_python-0.1.3}/tests/test_bench.py +0 -0
  27. {kedis_python-0.1.1 → kedis_python-0.1.3}/tests/test_kesp.py +0 -0
  28. {kedis_python-0.1.1 → kedis_python-0.1.3}/tests/test_kesp2.py +0 -0
  29. {kedis_python-0.1.1 → kedis_python-0.1.3}/tests/test_lists.py +0 -0
  30. {kedis_python-0.1.1 → kedis_python-0.1.3}/tests/test_lru.py +0 -0
  31. {kedis_python-0.1.1 → kedis_python-0.1.3}/tests/test_replica.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kedis-python
3
- Version: 0.1.1
3
+ Version: 0.1.3
4
4
  Summary: A Redis-inspired in-memory store in Python.
5
5
  Author: V SS Karthik
6
6
  License-Expression: MIT
@@ -8,6 +8,8 @@ Project-URL: Homepage, https://github.com/Hogwarts-coder10/kedis-python
8
8
  Requires-Python: >=3.9
9
9
  Description-Content-Type: text/markdown
10
10
  License-File: LICENSE
11
+ Requires-Dist: rich
12
+ Requires-Dist: pyfiglet
11
13
  Dynamic: license-file
12
14
 
13
15
  # 🚀 Kedis-Python
@@ -97,6 +97,7 @@ class KedisClient:
97
97
  "INFO",
98
98
  "HELP",
99
99
  "DEBUG",
100
+ "DISCONNECT",
100
101
  "RECONNECT",
101
102
  "CLEAR",
102
103
  "CLS",
@@ -173,6 +174,7 @@ class KedisClient:
173
174
  "INFO",
174
175
  "HELP",
175
176
  "DEBUG",
177
+ "DISCONNECT",
176
178
  "RECONNECT",
177
179
  "CLEAR",
178
180
  "CLS",
@@ -310,6 +312,36 @@ class KedisClient:
310
312
  console.print(f"\n[dim]🔧 Diagnostic telemetry is now {status}[/dim]\n")
311
313
  return True
312
314
 
315
+ if cmd == "DISCONNECT":
316
+ if self.local_mode:
317
+ UI.print_panel(
318
+ "[white]You are already in Standalone Mode.[/white]",
319
+ "⚠ NETWORK STATUS",
320
+ "yellow",
321
+ )
322
+ else:
323
+ console.print("[dim]Closing TCP network connection...[/dim]")
324
+ self.network.disconnect()
325
+
326
+ # Manual disconnect means the user wants to STAY local —
327
+ # suppress the radar so it doesn't immediately nag them
328
+ # back to TCP mode the moment it sees the server again.
329
+ self.suppress_reconnect = True
330
+
331
+ if self.store is None:
332
+ self._init_local_engine()
333
+ else:
334
+ self.local_mode = True
335
+
336
+ UI.print_panel(
337
+ "[bold yellow]✓ Disconnected from Kedis TCP Engine[/bold yellow]\n"
338
+ "[white]Mode: Standalone (Local Disk)[/white]\n"
339
+ "[dim]Reconnect radar disabled — use RECONNECT to resume TCP mode.[/dim]",
340
+ "🔌 CONNECTION CLOSED",
341
+ "yellow",
342
+ )
343
+ return True
344
+
313
345
  if cmd == "RECONNECT":
314
346
  if not self.local_mode:
315
347
  UI.print_panel(
@@ -474,6 +506,7 @@ class KedisClient:
474
506
  " [yellow]INFO[/yellow] : View engine telemetry and version\n"
475
507
  " [yellow]HELP[/yellow] : Show this command reference\n"
476
508
  " [yellow]DEBUG[/yellow] : Toggle diagnostic logs\n"
509
+ " [yellow]DISCONNECT[/yellow] : Manually drop TCP link, go Standalone\n"
477
510
  " [yellow]RECONNECT[/yellow] : Manually reconnect to TCP server\n"
478
511
  " [yellow]STATS[/yellow] : Deep Memory Map\n"
479
512
  " [yellow]CONFIG[/yellow] : Hot-swap engine dials mid-flight\n"
@@ -645,7 +678,7 @@ class KedisClient:
645
678
  return "(connection closed)"
646
679
 
647
680
  try:
648
- # 🛡️ THE FIX: Safely handle both raw bytes and pre-decoded text strings
681
+ # FIX: Safely handle both raw bytes and pre-decoded text strings
649
682
  text = (
650
683
  raw_bytes.decode("utf-8")
651
684
  if isinstance(raw_bytes, bytes)
@@ -507,8 +507,12 @@ async def main():
507
507
  shutdown_sequence("SIGINT")
508
508
 
509
509
 
510
- if __name__ == "__main__":
510
+ def run():
511
511
  try:
512
512
  asyncio.run(main())
513
513
  except KeyboardInterrupt:
514
514
  pass
515
+
516
+
517
+ if __name__ == "__main__":
518
+ run()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kedis-python
3
- Version: 0.1.1
3
+ Version: 0.1.3
4
4
  Summary: A Redis-inspired in-memory store in Python.
5
5
  Author: V SS Karthik
6
6
  License-Expression: MIT
@@ -8,6 +8,8 @@ Project-URL: Homepage, https://github.com/Hogwarts-coder10/kedis-python
8
8
  Requires-Python: >=3.9
9
9
  Description-Content-Type: text/markdown
10
10
  License-File: LICENSE
11
+ Requires-Dist: rich
12
+ Requires-Dist: pyfiglet
11
13
  Dynamic: license-file
12
14
 
13
15
  # 🚀 Kedis-Python
@@ -19,6 +19,7 @@ kedis_python.egg-info/PKG-INFO
19
19
  kedis_python.egg-info/SOURCES.txt
20
20
  kedis_python.egg-info/dependency_links.txt
21
21
  kedis_python.egg-info/entry_points.txt
22
+ kedis_python.egg-info/requires.txt
22
23
  kedis_python.egg-info/top_level.txt
23
24
  tests/test_bench.py
24
25
  tests/test_kesp.py
@@ -1,2 +1,3 @@
1
1
  [console_scripts]
2
2
  kedis-cli = kedis_python.main:main
3
+ kedis-server = kedis_python.server:run
@@ -0,0 +1,2 @@
1
+ rich
2
+ pyfiglet
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "kedis-python"
7
- version = "0.1.1"
7
+ version = "0.1.3"
8
8
  description = "A Redis-inspired in-memory store in Python."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -17,13 +17,14 @@ authors = [
17
17
  # If your project actually depends on third-party packages at runtime,
18
18
  # list them here instead of leaving this empty — check requirements.txt
19
19
  # and copy the real ones over.
20
- dependencies = []
20
+ dependencies = ["rich","pyfiglet"]
21
21
 
22
22
  [project.urls]
23
23
  Homepage = "https://github.com/Hogwarts-coder10/kedis-python"
24
24
 
25
25
  [project.scripts]
26
26
  kedis-cli = "kedis_python.main:main"
27
+ kedis-server = "kedis_python.server:run"
27
28
 
28
29
  [tool.setuptools.packages.find]
29
30
  include = ["kedis_python*"]
File without changes
File without changes
File without changes