Loglan-Core 0.4.6__tar.gz → 0.4.7__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.6 → loglan_core-0.4.7/Loglan_Core.egg-info}/PKG-INFO +6 -6
- {loglan_core-0.4.6/Loglan_Core.egg-info → loglan_core-0.4.7}/PKG-INFO +6 -6
- {loglan_core-0.4.6 → loglan_core-0.4.7}/README.md +1 -1
- {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/addons/definition_selector.py +10 -7
- {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/addons/key_selector.py +7 -3
- {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/definition.py +1 -1
- {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/event.py +1 -1
- {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/type.py +1 -1
- {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/word.py +2 -1
- loglan_core-0.4.7/pyproject.toml +44 -0
- loglan_core-0.4.7/setup.py +9 -0
- loglan_core-0.4.6/pyproject.toml +0 -10
- loglan_core-0.4.6/setup.py +0 -46
- {loglan_core-0.4.6 → loglan_core-0.4.7}/LICENSE +0 -0
- {loglan_core-0.4.6 → loglan_core-0.4.7}/Loglan_Core.egg-info/SOURCES.txt +0 -0
- {loglan_core-0.4.6 → loglan_core-0.4.7}/Loglan_Core.egg-info/dependency_links.txt +0 -0
- {loglan_core-0.4.6 → loglan_core-0.4.7}/Loglan_Core.egg-info/requires.txt +0 -0
- {loglan_core-0.4.6 → loglan_core-0.4.7}/Loglan_Core.egg-info/top_level.txt +0 -0
- {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/__init__.py +0 -0
- {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/addons/__init__.py +0 -0
- {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/addons/base_selector.py +0 -0
- {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/addons/export_word_converter.py +0 -0
- {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/addons/exporter.py +0 -0
- {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/addons/utils.py +0 -0
- {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/addons/word_linker.py +0 -0
- {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/addons/word_selector.py +0 -0
- {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/addons/word_sourcer.py +0 -0
- {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/author.py +0 -0
- {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/base.py +0 -0
- {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/connect_tables.py +0 -0
- {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/key.py +0 -0
- {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/setting.py +0 -0
- {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/syllable.py +0 -0
- {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/table_names.py +0 -0
- {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/word_spell.py +0 -0
- {loglan_core-0.4.6 → loglan_core-0.4.7}/setup.cfg +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: Loglan-Core
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.7
|
|
4
4
|
Summary: Loglan Dictionary Database Model for SQLAlchemy
|
|
5
|
-
|
|
6
|
-
Download-URL: https://github.com/torrua/loglan_core/archive/0.4.6.tar.gz
|
|
7
|
-
Author: torrua
|
|
8
|
-
Author-email: torrua@gmail.com
|
|
5
|
+
Author-email: torrua <torrua@gmail.com>
|
|
9
6
|
License: MIT
|
|
7
|
+
Project-URL: Download, https://github.com/torrua/loglan_core/archive/0.4.7.tar.gz
|
|
8
|
+
Project-URL: Homepage, https://github.com/torrua/loglan_core
|
|
9
|
+
Project-URL: Repository, https://github.com/torrua/loglan_core
|
|
10
10
|
Keywords: Loglan,Dictionary,Database,Model,LOD
|
|
11
11
|
Classifier: Development Status :: 5 - Production/Stable
|
|
12
12
|
Classifier: Intended Audience :: Developers
|
|
@@ -26,7 +26,7 @@ Requires-Dist: sqlalchemy>=2.0.21
|
|
|
26
26
|

|
|
27
27
|

|
|
28
28
|

|
|
29
|
-

|
|
30
30
|
[](https://github.com/torrua/loglan_core/actions/workflows/pytest.yml)
|
|
31
31
|

|
|
32
32
|

|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: Loglan-Core
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.7
|
|
4
4
|
Summary: Loglan Dictionary Database Model for SQLAlchemy
|
|
5
|
-
|
|
6
|
-
Download-URL: https://github.com/torrua/loglan_core/archive/0.4.6.tar.gz
|
|
7
|
-
Author: torrua
|
|
8
|
-
Author-email: torrua@gmail.com
|
|
5
|
+
Author-email: torrua <torrua@gmail.com>
|
|
9
6
|
License: MIT
|
|
7
|
+
Project-URL: Download, https://github.com/torrua/loglan_core/archive/0.4.7.tar.gz
|
|
8
|
+
Project-URL: Homepage, https://github.com/torrua/loglan_core
|
|
9
|
+
Project-URL: Repository, https://github.com/torrua/loglan_core
|
|
10
10
|
Keywords: Loglan,Dictionary,Database,Model,LOD
|
|
11
11
|
Classifier: Development Status :: 5 - Production/Stable
|
|
12
12
|
Classifier: Intended Audience :: Developers
|
|
@@ -26,7 +26,7 @@ Requires-Dist: sqlalchemy>=2.0.21
|
|
|
26
26
|

|
|
27
27
|

|
|
28
28
|

|
|
29
|
-

|
|
30
30
|
[](https://github.com/torrua/loglan_core/actions/workflows/pytest.yml)
|
|
31
31
|

|
|
32
32
|

|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|

|
|
4
4
|

|
|
5
5
|

|
|
6
|
-

|
|
7
7
|
[](https://github.com/torrua/loglan_core/actions/workflows/pytest.yml)
|
|
8
8
|

|
|
9
9
|

|
|
@@ -101,6 +101,7 @@ class DefinitionSelector(BaseSelector): # pylint: disable=too-many-ancestors
|
|
|
101
101
|
self,
|
|
102
102
|
key: BaseKey | str,
|
|
103
103
|
language: str | None = None,
|
|
104
|
+
distinct: bool = False,
|
|
104
105
|
) -> Self:
|
|
105
106
|
"""
|
|
106
107
|
This method filters the definitions by the provided key, language and case sensitivity.
|
|
@@ -109,6 +110,7 @@ class DefinitionSelector(BaseSelector): # pylint: disable=too-many-ancestors
|
|
|
109
110
|
key (BaseKey | str): The key to filter by. Can be an instance of BaseKey or a string.
|
|
110
111
|
language (str | None): The language to filter by.
|
|
111
112
|
If None, no language filtering is applied.
|
|
113
|
+
distinct (bool): If True, only distinct keys will be returned.
|
|
112
114
|
|
|
113
115
|
Returns:
|
|
114
116
|
Self: The filtered DefinitionSelector instance with distinct keys.
|
|
@@ -122,17 +124,18 @@ class DefinitionSelector(BaseSelector): # pylint: disable=too-many-ancestors
|
|
|
122
124
|
key.language if isinstance(key, BaseKey) else language
|
|
123
125
|
)
|
|
124
126
|
|
|
125
|
-
if hasattr(self.model, "keys"):
|
|
126
|
-
self._statement = (
|
|
127
|
-
self._statement.join(self.model.keys)
|
|
128
|
-
.where(filter_key, filter_language)
|
|
129
|
-
.distinct()
|
|
130
|
-
)
|
|
131
|
-
else:
|
|
127
|
+
if not hasattr(self.model, "keys"):
|
|
132
128
|
raise AttributeError(
|
|
133
129
|
f"{self.model.__name__} does not have a 'keys' attribute"
|
|
134
130
|
)
|
|
135
131
|
|
|
132
|
+
self._statement = self._statement.join(self.model.keys).where(
|
|
133
|
+
filter_key, filter_language
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
if distinct:
|
|
137
|
+
self._statement = self._statement.distinct()
|
|
138
|
+
|
|
136
139
|
return self
|
|
137
140
|
|
|
138
141
|
def by_language(self, language: str | None = None) -> Self:
|
|
@@ -131,12 +131,13 @@ class KeySelector(BaseSelector): # pylint: disable=too-many-ancestors
|
|
|
131
131
|
self._statement = self._statement.where(filter_key_by_language(language))
|
|
132
132
|
return self
|
|
133
133
|
|
|
134
|
-
def by_word_id(self, word_id: int) -> KeySelector:
|
|
134
|
+
def by_word_id(self, word_id: int, distinct: bool = False) -> KeySelector:
|
|
135
135
|
"""
|
|
136
136
|
Filters the keys by the given word ID.
|
|
137
137
|
|
|
138
138
|
Args:
|
|
139
139
|
word_id (int): The identifier of the word to filter by.
|
|
140
|
+
distinct (bool): If the query should be distinct. Defaults to False.
|
|
140
141
|
|
|
141
142
|
Returns:
|
|
142
143
|
KeySelector: The filtered KeySelector instance.
|
|
@@ -146,11 +147,14 @@ class KeySelector(BaseSelector): # pylint: disable=too-many-ancestors
|
|
|
146
147
|
|
|
147
148
|
"""
|
|
148
149
|
self._statement = (
|
|
149
|
-
self._statement.
|
|
150
|
-
.join(t_connect_keys)
|
|
150
|
+
self._statement.join(t_connect_keys)
|
|
151
151
|
.join(BaseDefinition, BaseDefinition.id == t_connect_keys.c.DID)
|
|
152
152
|
.join(BaseWord, BaseWord.id == BaseDefinition.word_id)
|
|
153
153
|
.filter(BaseWord.id == word_id)
|
|
154
154
|
.order_by(BaseKey.word.asc())
|
|
155
155
|
)
|
|
156
|
+
|
|
157
|
+
if distinct:
|
|
158
|
+
self._statement = self._statement.distinct()
|
|
159
|
+
|
|
156
160
|
return self
|
|
@@ -34,7 +34,7 @@ class BaseWord(BaseModel):
|
|
|
34
34
|
|
|
35
35
|
__tablename__ = T_NAME_WORDS
|
|
36
36
|
|
|
37
|
-
def __init__(
|
|
37
|
+
def __init__( # pylint: disable=too-many-positional-arguments
|
|
38
38
|
self,
|
|
39
39
|
id_old: Mapped[int],
|
|
40
40
|
name: Mapped[str_064],
|
|
@@ -138,6 +138,7 @@ class BaseWord(BaseModel):
|
|
|
138
138
|
|
|
139
139
|
definitions: Mapped[list[BaseDefinition]] = relationship(
|
|
140
140
|
back_populates="source_word",
|
|
141
|
+
cascade="all, delete-orphan",
|
|
141
142
|
)
|
|
142
143
|
|
|
143
144
|
# word's derivatives
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ['setuptools>=42']
|
|
3
|
+
build-backend = 'setuptools.build_meta'
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "Loglan-Core"
|
|
7
|
+
version = "0.4.7" # Placeholder, will be replaced by the script
|
|
8
|
+
description = "Loglan Dictionary Database Model for SQLAlchemy"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { text = "MIT" }
|
|
11
|
+
authors = [
|
|
12
|
+
{ name = "torrua", email = "torrua@gmail.com" }
|
|
13
|
+
]
|
|
14
|
+
keywords = ["Loglan", "Dictionary", "Database", "Model", "LOD"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 5 - Production/Stable",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"Intended Audience :: Science/Research",
|
|
19
|
+
"Topic :: Database",
|
|
20
|
+
"License :: OSI Approved :: MIT License",
|
|
21
|
+
"Programming Language :: Python :: 3.10",
|
|
22
|
+
"Programming Language :: Python :: 3.11",
|
|
23
|
+
"Programming Language :: Python :: 3.12",
|
|
24
|
+
]
|
|
25
|
+
requires-python = ">=3.10"
|
|
26
|
+
|
|
27
|
+
dependencies = [
|
|
28
|
+
"sqlalchemy>=2.0.21",
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
[project.urls]
|
|
32
|
+
"Download" = "https://github.com/torrua/loglan_core/archive/0.4.7.tar.gz" # Placeholder, will be replaced by the script
|
|
33
|
+
"Homepage" = "https://github.com/torrua/loglan_core"
|
|
34
|
+
"Repository" = "https://github.com/torrua/loglan_core"
|
|
35
|
+
|
|
36
|
+
[tool.setuptools.packages.find]
|
|
37
|
+
include = ["loglan_core", "loglan_core.addons"]
|
|
38
|
+
|
|
39
|
+
[tool.pylint]
|
|
40
|
+
disable = ["R0902", "R0913", "R0801"]
|
|
41
|
+
|
|
42
|
+
[tool.mypy]
|
|
43
|
+
python_version = "3.10"
|
|
44
|
+
strict = false
|
loglan_core-0.4.6/pyproject.toml
DELETED
loglan_core-0.4.6/setup.py
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
# pylint: disable=C0114
|
|
2
|
-
|
|
3
|
-
from io import open
|
|
4
|
-
|
|
5
|
-
from setuptools import setup
|
|
6
|
-
|
|
7
|
-
CURRENT_VERSION = "0.4.6"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def read(filename): # pylint: disable=C0116
|
|
11
|
-
with open(filename, encoding="utf-8") as file:
|
|
12
|
-
return file.read()
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
setup(
|
|
16
|
-
name="Loglan-Core",
|
|
17
|
-
packages=["loglan_core", "loglan_core.addons"],
|
|
18
|
-
package_data={
|
|
19
|
-
"loglan_core": ["*"],
|
|
20
|
-
},
|
|
21
|
-
include_package_data=True,
|
|
22
|
-
version=CURRENT_VERSION,
|
|
23
|
-
license="MIT",
|
|
24
|
-
description="Loglan Dictionary Database Model for SQLAlchemy",
|
|
25
|
-
long_description=read("README.md"),
|
|
26
|
-
long_description_content_type="text/markdown",
|
|
27
|
-
author="torrua",
|
|
28
|
-
author_email="torrua@gmail.com",
|
|
29
|
-
url="https://github.com/torrua/loglan_core",
|
|
30
|
-
download_url=f"https://github.com/torrua/loglan_core/archive/{CURRENT_VERSION}.tar.gz",
|
|
31
|
-
keywords=["Loglan", "Dictionary", "Database", "Model", "LOD"],
|
|
32
|
-
install_requires=[
|
|
33
|
-
"sqlalchemy>=2.0.21",
|
|
34
|
-
],
|
|
35
|
-
classifiers=[
|
|
36
|
-
"Development Status :: 5 - Production/Stable", # "3 - Alpha", "4 - Beta" or "5 - Production/Stable"
|
|
37
|
-
"Intended Audience :: Developers",
|
|
38
|
-
"Intended Audience :: Science/Research",
|
|
39
|
-
"Topic :: Database",
|
|
40
|
-
"License :: OSI Approved :: MIT License",
|
|
41
|
-
"Programming Language :: Python :: 3.10",
|
|
42
|
-
"Programming Language :: Python :: 3.11",
|
|
43
|
-
"Programming Language :: Python :: 3.12",
|
|
44
|
-
],
|
|
45
|
-
python_requires=">=3.10",
|
|
46
|
-
)
|
|
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
|