Loglan-Core 0.4.7__tar.gz → 0.4.9__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.
- {loglan_core-0.4.7 → loglan_core-0.4.9/Loglan_Core.egg-info}/PKG-INFO +2 -2
- {loglan_core-0.4.7 → loglan_core-0.4.9}/Loglan_Core.egg-info/SOURCES.txt +0 -2
- {loglan_core-0.4.7/Loglan_Core.egg-info → loglan_core-0.4.9}/PKG-INFO +2 -2
- {loglan_core-0.4.7 → loglan_core-0.4.9}/loglan_core/addons/base_selector.py +29 -24
- {loglan_core-0.4.7 → loglan_core-0.4.9}/loglan_core/addons/utils.py +0 -2
- {loglan_core-0.4.7 → loglan_core-0.4.9}/pyproject.toml +2 -2
- loglan_core-0.4.9/setup.cfg +4 -0
- loglan_core-0.4.7/setup.cfg +0 -7
- loglan_core-0.4.7/setup.py +0 -9
- {loglan_core-0.4.7 → loglan_core-0.4.9}/LICENSE +0 -0
- {loglan_core-0.4.7 → loglan_core-0.4.9}/Loglan_Core.egg-info/dependency_links.txt +0 -0
- {loglan_core-0.4.7 → loglan_core-0.4.9}/Loglan_Core.egg-info/requires.txt +0 -0
- {loglan_core-0.4.7 → loglan_core-0.4.9}/Loglan_Core.egg-info/top_level.txt +0 -0
- {loglan_core-0.4.7 → loglan_core-0.4.9}/README.md +0 -0
- {loglan_core-0.4.7 → loglan_core-0.4.9}/loglan_core/__init__.py +0 -0
- {loglan_core-0.4.7 → loglan_core-0.4.9}/loglan_core/addons/__init__.py +0 -0
- {loglan_core-0.4.7 → loglan_core-0.4.9}/loglan_core/addons/definition_selector.py +0 -0
- {loglan_core-0.4.7 → loglan_core-0.4.9}/loglan_core/addons/export_word_converter.py +0 -0
- {loglan_core-0.4.7 → loglan_core-0.4.9}/loglan_core/addons/exporter.py +0 -0
- {loglan_core-0.4.7 → loglan_core-0.4.9}/loglan_core/addons/key_selector.py +0 -0
- {loglan_core-0.4.7 → loglan_core-0.4.9}/loglan_core/addons/word_linker.py +0 -0
- {loglan_core-0.4.7 → loglan_core-0.4.9}/loglan_core/addons/word_selector.py +0 -0
- {loglan_core-0.4.7 → loglan_core-0.4.9}/loglan_core/addons/word_sourcer.py +0 -0
- {loglan_core-0.4.7 → loglan_core-0.4.9}/loglan_core/author.py +0 -0
- {loglan_core-0.4.7 → loglan_core-0.4.9}/loglan_core/base.py +0 -0
- {loglan_core-0.4.7 → loglan_core-0.4.9}/loglan_core/connect_tables.py +0 -0
- {loglan_core-0.4.7 → loglan_core-0.4.9}/loglan_core/definition.py +0 -0
- {loglan_core-0.4.7 → loglan_core-0.4.9}/loglan_core/event.py +0 -0
- {loglan_core-0.4.7 → loglan_core-0.4.9}/loglan_core/key.py +0 -0
- {loglan_core-0.4.7 → loglan_core-0.4.9}/loglan_core/setting.py +0 -0
- {loglan_core-0.4.7 → loglan_core-0.4.9}/loglan_core/syllable.py +0 -0
- {loglan_core-0.4.7 → loglan_core-0.4.9}/loglan_core/table_names.py +0 -0
- {loglan_core-0.4.7 → loglan_core-0.4.9}/loglan_core/type.py +0 -0
- {loglan_core-0.4.7 → loglan_core-0.4.9}/loglan_core/word.py +0 -0
- {loglan_core-0.4.7 → loglan_core-0.4.9}/loglan_core/word_spell.py +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: Loglan-Core
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.9
|
|
4
4
|
Summary: Loglan Dictionary Database Model for SQLAlchemy
|
|
5
5
|
Author-email: torrua <torrua@gmail.com>
|
|
6
6
|
License: MIT
|
|
7
|
-
Project-URL: Download, https://github.com/torrua/loglan_core/archive/0.4.
|
|
7
|
+
Project-URL: Download, https://github.com/torrua/loglan_core/archive/0.4.9.tar.gz
|
|
8
8
|
Project-URL: Homepage, https://github.com/torrua/loglan_core
|
|
9
9
|
Project-URL: Repository, https://github.com/torrua/loglan_core
|
|
10
10
|
Keywords: Loglan,Dictionary,Database,Model,LOD
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: Loglan-Core
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.9
|
|
4
4
|
Summary: Loglan Dictionary Database Model for SQLAlchemy
|
|
5
5
|
Author-email: torrua <torrua@gmail.com>
|
|
6
6
|
License: MIT
|
|
7
|
-
Project-URL: Download, https://github.com/torrua/loglan_core/archive/0.4.
|
|
7
|
+
Project-URL: Download, https://github.com/torrua/loglan_core/archive/0.4.9.tar.gz
|
|
8
8
|
Project-URL: Homepage, https://github.com/torrua/loglan_core
|
|
9
9
|
Project-URL: Repository, https://github.com/torrua/loglan_core
|
|
10
10
|
Keywords: Loglan,Dictionary,Database,Model,LOD
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
This module provides a base selector for SQLAlchemy
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
from __future__ import annotations
|
|
6
|
-
|
|
7
5
|
from typing import Type, Iterable, Any
|
|
8
6
|
|
|
9
7
|
from sqlalchemy import select, Select
|
|
@@ -46,7 +44,7 @@ class BaseSelector: # pylint: disable=too-many-ancestors
|
|
|
46
44
|
"""Initializes the Selector.
|
|
47
45
|
|
|
48
46
|
Args:
|
|
49
|
-
model (Type): The SQLAlchemy model class to
|
|
47
|
+
model (Type): The SQLAlchemy model class to select from.
|
|
50
48
|
is_sqlite (bool): Flag indicating if the database is SQLite.
|
|
51
49
|
case_sensitive (bool): Flag indicating if the queries should be case-sensitive.
|
|
52
50
|
disable_model_check (bool): Flag indicating if the model check should be disabled.
|
|
@@ -62,27 +60,30 @@ class BaseSelector: # pylint: disable=too-many-ancestors
|
|
|
62
60
|
self.is_sqlite = is_sqlite
|
|
63
61
|
self.case_sensitive = case_sensitive
|
|
64
62
|
|
|
65
|
-
def execute(self, session: Session):
|
|
63
|
+
def execute(self, session: Session, unique: bool = False) -> Any:
|
|
66
64
|
"""Executes the given session and returns the result.
|
|
67
65
|
|
|
68
66
|
Args:
|
|
69
67
|
session (Session): SQLAlchemy Session object.
|
|
70
|
-
|
|
68
|
+
unique (bool, optional): Flag indicating if the result should be unique.
|
|
69
|
+
Defaults to False.
|
|
71
70
|
Returns:
|
|
72
71
|
ResultProxy: The result of the executed session.
|
|
73
72
|
"""
|
|
74
|
-
|
|
73
|
+
result = session.execute(self._statement)
|
|
74
|
+
return result.unique() if unique else result
|
|
75
75
|
|
|
76
|
-
def all(self, session: Session):
|
|
76
|
+
def all(self, session: Session, unique: bool = False):
|
|
77
77
|
"""Executes the given session and returns all the results as a list.
|
|
78
78
|
|
|
79
79
|
Args:
|
|
80
80
|
session (Session): SQLAlchemy Session object.
|
|
81
|
-
|
|
81
|
+
unique (bool, optional): Flag indicating if the result should contain unique items.
|
|
82
|
+
Defaults to False.
|
|
82
83
|
Returns:
|
|
83
84
|
List[ResultRow]: All the results of the executed session.
|
|
84
85
|
"""
|
|
85
|
-
return
|
|
86
|
+
return self.execute(session, unique).scalars().all()
|
|
86
87
|
|
|
87
88
|
def scalar(self, session: Session):
|
|
88
89
|
"""Executes the given session and returns a scalar result.
|
|
@@ -93,19 +94,34 @@ class BaseSelector: # pylint: disable=too-many-ancestors
|
|
|
93
94
|
Returns:
|
|
94
95
|
Any: The scalar result of the executed session.
|
|
95
96
|
"""
|
|
96
|
-
return
|
|
97
|
+
return self.execute(session).scalar()
|
|
97
98
|
|
|
98
|
-
def fetchmany(
|
|
99
|
+
def fetchmany(
|
|
100
|
+
self, session: Session, size: int | None = None, unique: bool = False
|
|
101
|
+
):
|
|
99
102
|
"""Executes the given session and fetches a specified number of results.
|
|
100
103
|
|
|
101
104
|
Args:
|
|
102
105
|
session (Session): SQLAlchemy Session object.
|
|
103
106
|
size (int, optional): Number of results to fetch. If None, fetches all results.
|
|
104
|
-
|
|
107
|
+
unique (bool, optional): Flag indicating if the result should contain unique items.
|
|
108
|
+
Defaults to False.
|
|
105
109
|
Returns:
|
|
106
110
|
List[ResultRow]: The fetched results.
|
|
107
111
|
"""
|
|
108
|
-
return
|
|
112
|
+
return self.execute(session, unique).scalars().fetchmany(size)
|
|
113
|
+
|
|
114
|
+
def __call__(self, session: Session, unique: bool = False) -> list:
|
|
115
|
+
"""Execute the current _statement and return the results.
|
|
116
|
+
|
|
117
|
+
Args:
|
|
118
|
+
session (Session): The SQLAlchemy session to use for executing the query.
|
|
119
|
+
unique (bool, optional): Flag indicating if the result should contain unique items.
|
|
120
|
+
Defaults to False.
|
|
121
|
+
Returns:
|
|
122
|
+
list: The results of the query.
|
|
123
|
+
"""
|
|
124
|
+
return self.all(session, unique)
|
|
109
125
|
|
|
110
126
|
def select_columns(self, *columns: type[BaseModel]) -> Self:
|
|
111
127
|
"""Specify which columns to select without resetting the filters.
|
|
@@ -254,17 +270,6 @@ class BaseSelector: # pylint: disable=too-many-ancestors
|
|
|
254
270
|
"""
|
|
255
271
|
return self._statement
|
|
256
272
|
|
|
257
|
-
def __call__(self, session: Session):
|
|
258
|
-
"""Execute the current _statement and return the results.
|
|
259
|
-
|
|
260
|
-
Args:
|
|
261
|
-
session (Session): The SQLAlchemy session to use for executing the query.
|
|
262
|
-
|
|
263
|
-
Returns:
|
|
264
|
-
list: The results of the query.
|
|
265
|
-
"""
|
|
266
|
-
return self.all(session)
|
|
267
|
-
|
|
268
273
|
def with_relationships(self, selected: Iterable[str] | None = None) -> Self:
|
|
269
274
|
"""Adds relationships to the query.
|
|
270
275
|
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
This module provides utility functions for the loglan_core package.
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
from __future__ import annotations
|
|
6
|
-
|
|
7
5
|
from sqlalchemy import select, true, func
|
|
8
6
|
from sqlalchemy.sql.elements import BinaryExpression
|
|
9
7
|
from sqlalchemy.sql.elements import BooleanClauseList
|
|
@@ -4,7 +4,7 @@ build-backend = 'setuptools.build_meta'
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "Loglan-Core"
|
|
7
|
-
version = "0.4.
|
|
7
|
+
version = "0.4.9"
|
|
8
8
|
description = "Loglan Dictionary Database Model for SQLAlchemy"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "MIT" }
|
|
@@ -29,7 +29,7 @@ dependencies = [
|
|
|
29
29
|
]
|
|
30
30
|
|
|
31
31
|
[project.urls]
|
|
32
|
-
"Download" = "https://github.com/torrua/loglan_core/archive/0.4.
|
|
32
|
+
"Download" = "https://github.com/torrua/loglan_core/archive/0.4.9.tar.gz"
|
|
33
33
|
"Homepage" = "https://github.com/torrua/loglan_core"
|
|
34
34
|
"Repository" = "https://github.com/torrua/loglan_core"
|
|
35
35
|
|
loglan_core-0.4.7/setup.cfg
DELETED
loglan_core-0.4.7/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
|