organizations-local 0.0.53__tar.gz → 0.0.55__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: organizations-local
3
- Version: 0.0.53
3
+ Version: 0.0.55
4
4
  Summary: PyPI Package for Circles organizations-local Python
5
5
  Home-page: https://github.com/circles-zone/organizations-local-python-package
6
6
  Author: Circles
@@ -0,0 +1 @@
1
+ TODO Please update the README of the package
@@ -0,0 +1,19 @@
1
+ from logger_local.LoggerComponentEnum import LoggerComponentEnum
2
+
3
+ ORGANIZATIONS_LOCAL_PYTHON_COMPONENT_ID = 286
4
+ ORGANIZATIONS_LOCAL_PYTHON_COMPONENT_NAME = "organization-local-python-package"
5
+ DEVELOPER_EMAIL = "tal.g@circ.zone"
6
+ ORGANIZATIONS_PYTHON_PACKAGE_CODE_LOGGER_OBJECT = {
7
+ "component_id": ORGANIZATIONS_LOCAL_PYTHON_COMPONENT_ID,
8
+ "component_name": ORGANIZATIONS_LOCAL_PYTHON_COMPONENT_NAME,
9
+ "component_category": LoggerComponentEnum.ComponentCategory.Code.value,
10
+ "developer_email": DEVELOPER_EMAIL,
11
+ }
12
+
13
+ ORGANIZATIONS_PYTHON_PACKAGE_TEST_LOGGER_OBJECT = {
14
+ "component_id": ORGANIZATIONS_LOCAL_PYTHON_COMPONENT_ID,
15
+ "component_name": ORGANIZATIONS_LOCAL_PYTHON_COMPONENT_NAME,
16
+ "component_category": LoggerComponentEnum.ComponentCategory.Unit_Test.value,
17
+ "testing_framework": LoggerComponentEnum.testingFramework.pytest.value,
18
+ "developer_email": DEVELOPER_EMAIL,
19
+ }
@@ -5,7 +5,7 @@ from language_remote.lang_code import LangCode
5
5
  from logger_local.MetaLogger import MetaLogger
6
6
  from user_context_remote.user_context import UserContext
7
7
 
8
- from .organizations_constants import ORGANIZATIONS_PYTHON_PACKAGE_CODE_LOGGER_OBJECT
8
+ from .organizations_constants_src import ORGANIZATIONS_PYTHON_PACKAGE_CODE_LOGGER_OBJECT
9
9
 
10
10
  user_context = UserContext()
11
11
 
@@ -57,13 +57,19 @@ DEFAULT_NOT_DELETED_ML_VIEW_NAME = "organization_ml_not_deleted_view"
57
57
  # "description"
58
58
 
59
59
 
60
- class OrganizationsLocal(GenericCRUDML, metaclass=MetaLogger,
61
- object=ORGANIZATIONS_PYTHON_PACKAGE_CODE_LOGGER_OBJECT):
60
+ class OrganizationsLocal(
61
+ GenericCRUDML,
62
+ metaclass=MetaLogger,
63
+ object=ORGANIZATIONS_PYTHON_PACKAGE_CODE_LOGGER_OBJECT,
64
+ ):
62
65
  def __init__(self, is_test_data=False) -> None:
63
- GenericCRUDML.__init__(self, default_schema_name=DEFAULT_SCHEMA_NAME,
64
- default_table_name=DEFAULT_TABLE_NAME,
65
- default_column_name=DEFAULT_ID_COLUMN_NAME,
66
- is_test_data=is_test_data)
66
+ GenericCRUDML.__init__(
67
+ self,
68
+ default_schema_name=DEFAULT_SCHEMA_NAME,
69
+ default_table_name=DEFAULT_TABLE_NAME,
70
+ default_column_name=DEFAULT_ID_COLUMN_NAME,
71
+ is_test_data=is_test_data,
72
+ )
67
73
  self.default_view_table_name = DEFAULT_VIEW_NAME
68
74
 
69
75
  @staticmethod
@@ -78,8 +84,14 @@ class OrganizationsLocal(GenericCRUDML, metaclass=MetaLogger,
78
84
 
79
85
  @staticmethod
80
86
  def _clean_organization_ml_dict(organization_dict: dict) -> dict:
81
- columns = ("lang_code", "is_main", "title", "is_title_approved",
82
- "is_description_approved", "description")
87
+ columns = (
88
+ "lang_code",
89
+ "is_main",
90
+ "title",
91
+ "is_title_approved",
92
+ "is_description_approved",
93
+ "description",
94
+ )
83
95
  organization_ml_dict = {key: organization_dict.get(key) for key in columns}
84
96
  return organization_ml_dict
85
97
 
@@ -133,12 +145,14 @@ class OrganizationsLocal(GenericCRUDML, metaclass=MetaLogger,
133
145
  # TODO upsert_result_dict
134
146
  upsert_information = {
135
147
  "organization_id": organization_id,
136
- "organization_ml_ids_list": organzation_ml_ids_list
148
+ "organization_ml_ids_list": organzation_ml_ids_list,
137
149
  }
138
150
 
139
151
  return upsert_information
140
152
 
141
- def update_organization(self, *, organization_id: int, organization_ml_id: int, organization_dict: dict) -> None:
153
+ def update_organization(
154
+ self, *, organization_id: int, organization_ml_id: int, organization_dict: dict
155
+ ) -> None:
142
156
  # TODO: should we have such a method in CRUD ML? Same for delete
143
157
  organization_ml_dict = self._clean_organization_ml_dict(
144
158
  organization_dict)
@@ -164,7 +178,9 @@ class OrganizationsLocal(GenericCRUDML, metaclass=MetaLogger,
164
178
  column_name="organization_ml_id")
165
179
  organization_dict = self.select_one_dict_by_column_and_value(
166
180
  view_table_name=view_table_name,
167
- column_value=organization_id, column_name="organization_id")
181
+ column_value=organization_id,
182
+ column_name="organization_id",
183
+ )
168
184
 
169
185
  return {**organization_dict, **organization_ml_dict}
170
186
 
@@ -203,7 +219,7 @@ class OrganizationsLocal(GenericCRUDML, metaclass=MetaLogger,
203
219
  view_table_name = view_table_name or DEFAULT_ML_VIEW_NAME
204
220
  organizations_ids_and_names_list = []
205
221
  select_clause_value = "organization_id, title"
206
- placeholders = ', '.join(['%s'] * len(organizations_ids_list))
222
+ placeholders = ", ".join(["%s"] * len(organizations_ids_list))
207
223
  where_clause_value = f"organization_id in ({placeholders})"
208
224
  organizations_ids_and_names_list = self.select_multi_tuple_by_where(
209
225
  view_table_name=view_table_name,
@@ -235,9 +251,11 @@ class OrganizationsLocal(GenericCRUDML, metaclass=MetaLogger,
235
251
  # Was def get_update_status(self, *, last_modified_timestamp: str, main_profile_id: int) -> UpdateStatus:
236
252
  def get_update_status_and_information_list(self, *,
237
253
  last_modified_timestamp: str,
238
- main_profile_id: int or None) -> list[dict]:
254
+ main_profile_id: int | None) -> list[dict]:
239
255
  if main_profile_id is None:
240
- update_status_and_information_list = [{"update_status": UpdateStatus.UPDATE_CIRCLEZ}]
256
+ update_status_and_information_list = [
257
+ {"update_status": UpdateStatus.UPDATE_CIRCLEZ}
258
+ ]
241
259
  return update_status_and_information_list
242
260
  sync_conflict_resolution = SyncConflictResolution()
243
261
  # TODO: Shall we also check update_timestamp in organization_table to see if the name was changed?
@@ -256,12 +274,17 @@ class OrganizationsLocal(GenericCRUDML, metaclass=MetaLogger,
256
274
  if organization_id is not None:
257
275
  organizations_ids_list.append(organization_id)
258
276
 
259
- organizations_ids_and_names_list = self.get_organizations_ids_and_names_list_by_organizations_ids(
260
- organizations_ids_list=organizations_ids_list,
261
- view_table_name="organization_ml_view")
277
+ organizations_ids_and_names_list = (
278
+ self.get_organizations_ids_and_names_list_by_organizations_ids(
279
+ organizations_ids_list=organizations_ids_list,
280
+ view_table_name="organization_ml_view",
281
+ )
282
+ )
262
283
 
263
284
  # Convert organizations_ids_and_names_list to a dictionary
264
- organizations_ids_and_names_dict = {item[0]: item[1] for item in organizations_ids_and_names_list}
285
+ organizations_ids_and_names_dict = {
286
+ item[0]: item[1] for item in organizations_ids_and_names_list
287
+ }
265
288
 
266
289
  for update_status_and_information in update_status_and_information_list:
267
290
  organization_id = update_status_and_information.get("organization_id")
@@ -270,7 +293,7 @@ class OrganizationsLocal(GenericCRUDML, metaclass=MetaLogger,
270
293
 
271
294
  return update_status_and_information_list
272
295
 
273
- def get_organization_name_by_organization_identifier(self, organization_identifier: str) -> str or None:
296
+ def get_organization_name_by_organization_identifier(self, organization_identifier: str) -> str | None:
274
297
  organization_name = self.select_one_value_by_column_and_value(
275
298
  select_clause_value="name",
276
299
  schema_name="organization",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: organizations-local
3
- Version: 0.0.53
3
+ Version: 0.0.55
4
4
  Summary: PyPI Package for Circles organizations-local Python
5
5
  Home-page: https://github.com/circles-zone/organizations-local-python-package
6
6
  Author: Circles
@@ -7,5 +7,5 @@ organizations_local.egg-info/dependency_links.txt
7
7
  organizations_local.egg-info/requires.txt
8
8
  organizations_local.egg-info/top_level.txt
9
9
  organizations_local/src/__init__.py
10
- organizations_local/src/organizations_constants.py
10
+ organizations_local/src/organizations_constants_src.py
11
11
  organizations_local/src/organizations_local.py
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "organizations-local"
7
- version = "0.0.23" # https://pypi.org/project/organizations-local
7
+ version = "0.0.24" # https://pypi.org/project/organizations-local
8
8
  description = "organizations-local Python Package"
9
9
  readme = "README.md"
10
10
  authors = [
@@ -5,25 +5,25 @@ package_dir = PACKAGE_NAME.replace("-", "_")
5
5
 
6
6
  setuptools.setup(
7
7
  name=PACKAGE_NAME,
8
- version='0.0.53', # https://pypi.org/project/organizations-local/
8
+ version='0.0.55', # https://pypi.org/project/organizations-local/
9
9
  author="Circles",
10
10
  author_email="info@circlez.ai",
11
11
  description="PyPI Package for Circles organizations-local Python",
12
12
  long_description="PyPI Package for Circles organizations-local Python",
13
- long_description_content_type='text/markdown',
13
+ long_description_content_type="text/markdown",
14
14
  url=f"https://github.com/circles-zone/{PACKAGE_NAME}-python-package",
15
15
  packages=[package_dir],
16
- package_dir={package_dir: f'{package_dir}/src'},
17
- package_data={package_dir: ['*.py']},
16
+ package_dir={package_dir: f"{package_dir}/src"},
17
+ package_data={package_dir: ["*.py"]},
18
18
  classifiers=[
19
19
  "Programming Language :: Python :: 3",
20
20
  # "License :: Other/Proprietary License",
21
21
  "Operating System :: OS Independent",
22
22
  ],
23
23
  install_requires=[
24
- 'database-mysql-local>=0.0.290',
25
- 'language-remote>=0.0.20',
26
- 'location-local>=0.0.8',
27
- 'user-context-remote>=0.0.58',
24
+ "database-mysql-local>=0.0.290",
25
+ "language-remote>=0.0.20",
26
+ "location-local>=0.0.8",
27
+ "user-context-remote>=0.0.58",
28
28
  ],
29
29
  )
@@ -1 +0,0 @@
1
- TODO Please update the README of the package
@@ -1,19 +0,0 @@
1
- from logger_local.LoggerComponentEnum import LoggerComponentEnum
2
-
3
- ORGANIZATIONS_LOCAL_PYTHON_COMPONENT_ID = 286
4
- ORGANIZATIONS_LOCAL_PYTHON_COMPONENT_NAME = "organization-local-python-package"
5
- DEVELOPER_EMAIL = "tal.g@circ.zone"
6
- ORGANIZATIONS_PYTHON_PACKAGE_CODE_LOGGER_OBJECT = {
7
- 'component_id': ORGANIZATIONS_LOCAL_PYTHON_COMPONENT_ID,
8
- 'component_name': ORGANIZATIONS_LOCAL_PYTHON_COMPONENT_NAME,
9
- 'component_category': LoggerComponentEnum.ComponentCategory.Code.value,
10
- 'developer_email': DEVELOPER_EMAIL
11
- }
12
-
13
- ORGANIZATIONS_PYTHON_PACKAGE_TEST_LOGGER_OBJECT = {
14
- 'component_id': ORGANIZATIONS_LOCAL_PYTHON_COMPONENT_ID,
15
- 'component_name': ORGANIZATIONS_LOCAL_PYTHON_COMPONENT_NAME,
16
- 'component_category': LoggerComponentEnum.ComponentCategory.Unit_Test.value,
17
- 'testing_framework': LoggerComponentEnum.testingFramework.pytest.value,
18
- 'developer_email': DEVELOPER_EMAIL
19
- }