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.
Files changed (36) hide show
  1. {loglan_core-0.4.6 → loglan_core-0.4.7/Loglan_Core.egg-info}/PKG-INFO +6 -6
  2. {loglan_core-0.4.6/Loglan_Core.egg-info → loglan_core-0.4.7}/PKG-INFO +6 -6
  3. {loglan_core-0.4.6 → loglan_core-0.4.7}/README.md +1 -1
  4. {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/addons/definition_selector.py +10 -7
  5. {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/addons/key_selector.py +7 -3
  6. {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/definition.py +1 -1
  7. {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/event.py +1 -1
  8. {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/type.py +1 -1
  9. {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/word.py +2 -1
  10. loglan_core-0.4.7/pyproject.toml +44 -0
  11. loglan_core-0.4.7/setup.py +9 -0
  12. loglan_core-0.4.6/pyproject.toml +0 -10
  13. loglan_core-0.4.6/setup.py +0 -46
  14. {loglan_core-0.4.6 → loglan_core-0.4.7}/LICENSE +0 -0
  15. {loglan_core-0.4.6 → loglan_core-0.4.7}/Loglan_Core.egg-info/SOURCES.txt +0 -0
  16. {loglan_core-0.4.6 → loglan_core-0.4.7}/Loglan_Core.egg-info/dependency_links.txt +0 -0
  17. {loglan_core-0.4.6 → loglan_core-0.4.7}/Loglan_Core.egg-info/requires.txt +0 -0
  18. {loglan_core-0.4.6 → loglan_core-0.4.7}/Loglan_Core.egg-info/top_level.txt +0 -0
  19. {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/__init__.py +0 -0
  20. {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/addons/__init__.py +0 -0
  21. {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/addons/base_selector.py +0 -0
  22. {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/addons/export_word_converter.py +0 -0
  23. {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/addons/exporter.py +0 -0
  24. {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/addons/utils.py +0 -0
  25. {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/addons/word_linker.py +0 -0
  26. {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/addons/word_selector.py +0 -0
  27. {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/addons/word_sourcer.py +0 -0
  28. {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/author.py +0 -0
  29. {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/base.py +0 -0
  30. {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/connect_tables.py +0 -0
  31. {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/key.py +0 -0
  32. {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/setting.py +0 -0
  33. {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/syllable.py +0 -0
  34. {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/table_names.py +0 -0
  35. {loglan_core-0.4.6 → loglan_core-0.4.7}/loglan_core/word_spell.py +0 -0
  36. {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.6
3
+ Version: 0.4.7
4
4
  Summary: Loglan Dictionary Database Model for SQLAlchemy
5
- Home-page: https://github.com/torrua/loglan_core
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
  ![Codecov](https://img.shields.io/codecov/c/github/torrua/loglan_core?logo=Codecov&logoColor=%23F01F7A&label=codecov)
27
27
  ![Scrutinizer code quality (GitHub/Bitbucket)](https://img.shields.io/scrutinizer/quality/g/torrua/loglan_core/main?logo=Scrutinizer%20CI&logoColor=%238A9296&label=Scrutinizer%20CC&link=https%3A%2F%2Fscrutinizer-ci.com%2Fg%2Ftorrua%2Floglan_core%2F%3Fbranch%3Dmain)
28
28
  ![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability-percentage/torrua/loglan_core?logo=Code%20Climate)
29
- ![pylint](https://img.shields.io/badge/PyLint-9.95-yellow?logo=python&logoColor=white)
29
+ ![pylint](https://img.shields.io/badge/PyLint-10.00-brightgreen?logo=python&logoColor=white)
30
30
  [![Pytest](https://github.com/torrua/loglan_core/actions/workflows/pytest.yml/badge.svg)](https://github.com/torrua/loglan_core/actions/workflows/pytest.yml)
31
31
  ![Bandit Status](https://img.shields.io/github/actions/workflow/status/torrua/loglan_core/bandit.yml?label=bandit)
32
32
  ![Black Status](https://img.shields.io/github/actions/workflow/status/torrua/loglan_core/black.yml?label=Black&labelColor=black)
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: Loglan-Core
3
- Version: 0.4.6
3
+ Version: 0.4.7
4
4
  Summary: Loglan Dictionary Database Model for SQLAlchemy
5
- Home-page: https://github.com/torrua/loglan_core
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
  ![Codecov](https://img.shields.io/codecov/c/github/torrua/loglan_core?logo=Codecov&logoColor=%23F01F7A&label=codecov)
27
27
  ![Scrutinizer code quality (GitHub/Bitbucket)](https://img.shields.io/scrutinizer/quality/g/torrua/loglan_core/main?logo=Scrutinizer%20CI&logoColor=%238A9296&label=Scrutinizer%20CC&link=https%3A%2F%2Fscrutinizer-ci.com%2Fg%2Ftorrua%2Floglan_core%2F%3Fbranch%3Dmain)
28
28
  ![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability-percentage/torrua/loglan_core?logo=Code%20Climate)
29
- ![pylint](https://img.shields.io/badge/PyLint-9.95-yellow?logo=python&logoColor=white)
29
+ ![pylint](https://img.shields.io/badge/PyLint-10.00-brightgreen?logo=python&logoColor=white)
30
30
  [![Pytest](https://github.com/torrua/loglan_core/actions/workflows/pytest.yml/badge.svg)](https://github.com/torrua/loglan_core/actions/workflows/pytest.yml)
31
31
  ![Bandit Status](https://img.shields.io/github/actions/workflow/status/torrua/loglan_core/bandit.yml?label=bandit)
32
32
  ![Black Status](https://img.shields.io/github/actions/workflow/status/torrua/loglan_core/black.yml?label=Black&labelColor=black)
@@ -3,7 +3,7 @@
3
3
  ![Codecov](https://img.shields.io/codecov/c/github/torrua/loglan_core?logo=Codecov&logoColor=%23F01F7A&label=codecov)
4
4
  ![Scrutinizer code quality (GitHub/Bitbucket)](https://img.shields.io/scrutinizer/quality/g/torrua/loglan_core/main?logo=Scrutinizer%20CI&logoColor=%238A9296&label=Scrutinizer%20CC&link=https%3A%2F%2Fscrutinizer-ci.com%2Fg%2Ftorrua%2Floglan_core%2F%3Fbranch%3Dmain)
5
5
  ![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability-percentage/torrua/loglan_core?logo=Code%20Climate)
6
- ![pylint](https://img.shields.io/badge/PyLint-9.95-yellow?logo=python&logoColor=white)
6
+ ![pylint](https://img.shields.io/badge/PyLint-10.00-brightgreen?logo=python&logoColor=white)
7
7
  [![Pytest](https://github.com/torrua/loglan_core/actions/workflows/pytest.yml/badge.svg)](https://github.com/torrua/loglan_core/actions/workflows/pytest.yml)
8
8
  ![Bandit Status](https://img.shields.io/github/actions/workflow/status/torrua/loglan_core/bandit.yml?label=bandit)
9
9
  ![Black Status](https://img.shields.io/github/actions/workflow/status/torrua/loglan_core/black.yml?label=Black&labelColor=black)
@@ -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.distinct()
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
@@ -48,7 +48,7 @@ class BaseDefinition(BaseModel):
48
48
 
49
49
  __tablename__ = T_NAME_DEFINITIONS
50
50
 
51
- def __init__(
51
+ def __init__( # pylint: disable=too-many-positional-arguments
52
52
  self,
53
53
  word_id: Mapped[int],
54
54
  position: Mapped[int],
@@ -43,7 +43,7 @@ class BaseEvent(BaseModel):
43
43
 
44
44
  __tablename__ = T_NAME_EVENTS
45
45
 
46
- def __init__(
46
+ def __init__( # pylint: disable=too-many-positional-arguments
47
47
  self,
48
48
  event_id: Mapped[int],
49
49
  name: Mapped[str_064],
@@ -27,7 +27,7 @@ class BaseType(BaseModel):
27
27
 
28
28
  __tablename__ = T_NAME_TYPES
29
29
 
30
- def __init__(
30
+ def __init__( # pylint: disable=too-many-positional-arguments
31
31
  self,
32
32
  type_: Mapped[str_016],
33
33
  type_x: Mapped[str_016],
@@ -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
@@ -0,0 +1,9 @@
1
+ from setuptools import setup
2
+
3
+
4
+ setup(
5
+ package_data={
6
+ "loglan_core": ["*"],
7
+ },
8
+ include_package_data=True,
9
+ )
@@ -1,10 +0,0 @@
1
- [build-system]
2
- requires = ['setuptools>=42']
3
- build-backend = 'setuptools.build_meta'
4
-
5
- [tool.pylint]
6
- disable = ["R0902", "R0913", "R0801"]
7
-
8
- [tool.mypy]
9
- python_version = "3.10"
10
- strict = false
@@ -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