memory-graph 0.3.91__tar.gz → 0.3.92__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.
- {memory_graph-0.3.91 → memory_graph-0.3.92}/PKG-INFO +4 -4
- {memory_graph-0.3.91 → memory_graph-0.3.92}/README.md +3 -3
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/__init__.py +1 -1
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/extension_sqlite3.py +45 -30
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph.egg-info/PKG-INFO +4 -4
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph.egg-info/SOURCES.txt +0 -1
- {memory_graph-0.3.91 → memory_graph-0.3.92}/pyproject.toml +1 -1
- memory_graph-0.3.91/setup.py +0 -7
- {memory_graph-0.3.91 → memory_graph-0.3.92}/LICENSE.txt +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/call_stack.py +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/config.py +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/config_default.py +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/config_helpers.py +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/extension_numpy.py +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/extension_pandas.py +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/extension_polars.py +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/extension_torch.py +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/html_table.py +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/list_view.py +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/memory_to_nodes.py +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/node_base.py +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/node_key_value.py +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/node_leaf.py +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/node_linear.py +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/node_table.py +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/sequence.py +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/slicer.py +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/slices.py +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/slices_iterator.py +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/slices_table_iterator.py +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/test.py +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/test_max_graph_depth.py +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/test_memory_graph.py +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/test_memory_to_nodes.py +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/test_sequence.py +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/test_slicer.py +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/test_slices.py +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/test_slices_iterator.py +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph/utils.py +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph.egg-info/dependency_links.txt +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph.egg-info/requires.txt +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/memory_graph.egg-info/top_level.txt +0 -0
- {memory_graph-0.3.91 → memory_graph-0.3.92}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: memory_graph
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.92
|
|
4
4
|
Summary: Teaching tool and debugging aid in context of references, mutable data types, and shallow and deep copy.
|
|
5
5
|
Author-email: Bas Terwijn <bterwijn@gmail.com>
|
|
6
6
|
License-Expression: BSD-2-Clause
|
|
@@ -1574,7 +1574,7 @@ mg.show(locals())
|
|
|
1574
1574
|
```
|
|
1575
1575
|

|
|
1576
1576
|
|
|
1577
|
-
Or see it in the [Memory Graph Web Debugger](https://memory-graph.com/#micropip=numpy&codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/mg_numpy.py&play).
|
|
1577
|
+
Or see it in the [Memory Graph Web Debugger](https://memory-graph.com/#micropip=numpy&codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/mg_numpy.py×tep=0.5&play).
|
|
1578
1578
|
|
|
1579
1579
|
See this [introduction to NumPy operations](https://memory-graph.com/#micropip=numpy&codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/numpy_operations.py×tep=0.5&play).
|
|
1580
1580
|
|
|
@@ -1597,9 +1597,9 @@ mg.show(locals())
|
|
|
1597
1597
|
```
|
|
1598
1598
|

|
|
1599
1599
|
|
|
1600
|
-
Or see it in the [Memory Graph Web Debugger](https://memory-graph.com/#micropip=pandas&codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/mg_pandas.py&play).
|
|
1600
|
+
Or see it in the [Memory Graph Web Debugger](https://memory-graph.com/#micropip=pandas&codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/mg_pandas.py×tep=0.5&play).
|
|
1601
1601
|
|
|
1602
|
-
See this [introduction to Pandas operations](https://memory-graph.com/#micropip=numpy&codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/pandas_operations.py×tep=0.5&play).
|
|
1602
|
+
See this [introduction to Pandas operations](https://memory-graph.com/#micropip=numpy,pandas&codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/pandas_operations.py×tep=0.5&play).
|
|
1603
1603
|
|
|
1604
1604
|
## Polars ##
|
|
1605
1605
|
For Polars types `DataFrame`, use `mg.extend_polars()`:
|
|
@@ -1554,7 +1554,7 @@ mg.show(locals())
|
|
|
1554
1554
|
```
|
|
1555
1555
|

|
|
1556
1556
|
|
|
1557
|
-
Or see it in the [Memory Graph Web Debugger](https://memory-graph.com/#micropip=numpy&codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/mg_numpy.py&play).
|
|
1557
|
+
Or see it in the [Memory Graph Web Debugger](https://memory-graph.com/#micropip=numpy&codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/mg_numpy.py×tep=0.5&play).
|
|
1558
1558
|
|
|
1559
1559
|
See this [introduction to NumPy operations](https://memory-graph.com/#micropip=numpy&codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/numpy_operations.py×tep=0.5&play).
|
|
1560
1560
|
|
|
@@ -1577,9 +1577,9 @@ mg.show(locals())
|
|
|
1577
1577
|
```
|
|
1578
1578
|

|
|
1579
1579
|
|
|
1580
|
-
Or see it in the [Memory Graph Web Debugger](https://memory-graph.com/#micropip=pandas&codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/mg_pandas.py&play).
|
|
1580
|
+
Or see it in the [Memory Graph Web Debugger](https://memory-graph.com/#micropip=pandas&codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/mg_pandas.py×tep=0.5&play).
|
|
1581
1581
|
|
|
1582
|
-
See this [introduction to Pandas operations](https://memory-graph.com/#micropip=numpy&codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/pandas_operations.py×tep=0.5&play).
|
|
1582
|
+
See this [introduction to Pandas operations](https://memory-graph.com/#micropip=numpy,pandas&codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/pandas_operations.py×tep=0.5&play).
|
|
1583
1583
|
|
|
1584
1584
|
## Polars ##
|
|
1585
1585
|
For Polars types `DataFrame`, use `mg.extend_polars()`:
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Copyright (c) 2023, Bas Terwijn.
|
|
3
3
|
# SPDX-License-Identifier: BSD-2-Clause
|
|
4
4
|
|
|
5
|
-
""" Extension to add the memory graph configuration for
|
|
5
|
+
""" Extension to add the memory graph configuration for SQLite3 types. """
|
|
6
6
|
from memory_graph.node_key_value import Node_Key_Value
|
|
7
7
|
from memory_graph.node_table import Node_Table
|
|
8
8
|
|
|
@@ -50,38 +50,53 @@ def get_table(conn, table_name):
|
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
def get_tables(conn):
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
import sqlite3
|
|
54
|
+
try:
|
|
55
|
+
table_names = (
|
|
56
|
+
row[0] for row in conn.execute(
|
|
57
|
+
"SELECT name FROM sqlite_master "
|
|
58
|
+
"WHERE type = 'table' AND name NOT LIKE 'sqlite_%'"
|
|
59
|
+
)
|
|
57
60
|
)
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
tables = {name: get_table(conn, name) for name in table_names}
|
|
62
|
+
return tables
|
|
63
|
+
except sqlite3.Error as e:
|
|
64
|
+
typename= type(e).__name__
|
|
65
|
+
error_msg = str(e)
|
|
66
|
+
tables = {typename: error_msg}
|
|
67
|
+
return tables
|
|
62
68
|
|
|
63
69
|
def sqlite_table_node(d):
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
70
|
+
import sqlite3
|
|
71
|
+
try:
|
|
72
|
+
headers = []
|
|
73
|
+
for name in d.header:
|
|
74
|
+
labels = []
|
|
75
|
+
# Declared SQLite column type
|
|
76
|
+
column_type = d.column_types.get(name)
|
|
77
|
+
if column_type:
|
|
78
|
+
labels.append(column_type)
|
|
79
|
+
# Primary key
|
|
80
|
+
if name in d.primary_keys:
|
|
81
|
+
labels.append("PK")
|
|
82
|
+
# Foreign key
|
|
83
|
+
if any(fk[0] == name for fk in d.foreign_keys):
|
|
84
|
+
labels.append("FK")
|
|
85
|
+
|
|
86
|
+
suffix = f" ({', '.join(labels)})" if labels else ""
|
|
87
|
+
headers.append(name + suffix)
|
|
88
|
+
return Node_Table(
|
|
89
|
+
d,
|
|
90
|
+
list(d.rows),
|
|
91
|
+
col_names=headers
|
|
92
|
+
)
|
|
93
|
+
except sqlite3.Error as e:
|
|
94
|
+
typename= type(e).__name__
|
|
95
|
+
error_msg = str(e)
|
|
96
|
+
return Node_Table(
|
|
97
|
+
d,
|
|
98
|
+
[[typename, error_msg]],
|
|
99
|
+
)
|
|
85
100
|
|
|
86
101
|
def extend_sqlite3():
|
|
87
102
|
import sqlite3
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: memory_graph
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.92
|
|
4
4
|
Summary: Teaching tool and debugging aid in context of references, mutable data types, and shallow and deep copy.
|
|
5
5
|
Author-email: Bas Terwijn <bterwijn@gmail.com>
|
|
6
6
|
License-Expression: BSD-2-Clause
|
|
@@ -1574,7 +1574,7 @@ mg.show(locals())
|
|
|
1574
1574
|
```
|
|
1575
1575
|

|
|
1576
1576
|
|
|
1577
|
-
Or see it in the [Memory Graph Web Debugger](https://memory-graph.com/#micropip=numpy&codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/mg_numpy.py&play).
|
|
1577
|
+
Or see it in the [Memory Graph Web Debugger](https://memory-graph.com/#micropip=numpy&codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/mg_numpy.py×tep=0.5&play).
|
|
1578
1578
|
|
|
1579
1579
|
See this [introduction to NumPy operations](https://memory-graph.com/#micropip=numpy&codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/numpy_operations.py×tep=0.5&play).
|
|
1580
1580
|
|
|
@@ -1597,9 +1597,9 @@ mg.show(locals())
|
|
|
1597
1597
|
```
|
|
1598
1598
|

|
|
1599
1599
|
|
|
1600
|
-
Or see it in the [Memory Graph Web Debugger](https://memory-graph.com/#micropip=pandas&codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/mg_pandas.py&play).
|
|
1600
|
+
Or see it in the [Memory Graph Web Debugger](https://memory-graph.com/#micropip=pandas&codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/mg_pandas.py×tep=0.5&play).
|
|
1601
1601
|
|
|
1602
|
-
See this [introduction to Pandas operations](https://memory-graph.com/#micropip=numpy&codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/pandas_operations.py×tep=0.5&play).
|
|
1602
|
+
See this [introduction to Pandas operations](https://memory-graph.com/#micropip=numpy,pandas&codeurl=https://raw.githubusercontent.com/bterwijn/memory_graph/refs/heads/main/src/pandas_operations.py×tep=0.5&play).
|
|
1603
1603
|
|
|
1604
1604
|
## Polars ##
|
|
1605
1605
|
For Polars types `DataFrame`, use `mg.extend_polars()`:
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "memory_graph"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.92"
|
|
8
8
|
description = "Teaching tool and debugging aid in context of references, mutable data types, and shallow and deep copy."
|
|
9
9
|
authors = [
|
|
10
10
|
{name = "Bas Terwijn", email = "bterwijn@gmail.com"}
|
memory_graph-0.3.91/setup.py
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|