organizations-local 0.0.51__tar.gz → 0.0.53__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.51
3
+ Version: 0.0.53
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,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
+ }
@@ -57,19 +57,13 @@ DEFAULT_NOT_DELETED_ML_VIEW_NAME = "organization_ml_not_deleted_view"
57
57
  # "description"
58
58
 
59
59
 
60
- class OrganizationsLocal(
61
- GenericCRUDML,
62
- metaclass=MetaLogger,
63
- object=ORGANIZATIONS_PYTHON_PACKAGE_CODE_LOGGER_OBJECT,
64
- ):
60
+ class OrganizationsLocal(GenericCRUDML, metaclass=MetaLogger,
61
+ object=ORGANIZATIONS_PYTHON_PACKAGE_CODE_LOGGER_OBJECT):
65
62
  def __init__(self, is_test_data=False) -> None:
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
- )
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)
73
67
  self.default_view_table_name = DEFAULT_VIEW_NAME
74
68
 
75
69
  @staticmethod
@@ -84,14 +78,8 @@ class OrganizationsLocal(
84
78
 
85
79
  @staticmethod
86
80
  def _clean_organization_ml_dict(organization_dict: dict) -> dict:
87
- columns = (
88
- "lang_code",
89
- "is_main",
90
- "title",
91
- "is_title_approved",
92
- "is_description_approved",
93
- "description",
94
- )
81
+ columns = ("lang_code", "is_main", "title", "is_title_approved",
82
+ "is_description_approved", "description")
95
83
  organization_ml_dict = {key: organization_dict.get(key) for key in columns}
96
84
  return organization_ml_dict
97
85
 
@@ -145,14 +133,12 @@ class OrganizationsLocal(
145
133
  # TODO upsert_result_dict
146
134
  upsert_information = {
147
135
  "organization_id": organization_id,
148
- "organization_ml_ids_list": organzation_ml_ids_list,
136
+ "organization_ml_ids_list": organzation_ml_ids_list
149
137
  }
150
138
 
151
139
  return upsert_information
152
140
 
153
- def update_organization(
154
- self, *, organization_id: int, organization_ml_id: int, organization_dict: dict
155
- ) -> None:
141
+ def update_organization(self, *, organization_id: int, organization_ml_id: int, organization_dict: dict) -> None:
156
142
  # TODO: should we have such a method in CRUD ML? Same for delete
157
143
  organization_ml_dict = self._clean_organization_ml_dict(
158
144
  organization_dict)
@@ -178,9 +164,7 @@ class OrganizationsLocal(
178
164
  column_name="organization_ml_id")
179
165
  organization_dict = self.select_one_dict_by_column_and_value(
180
166
  view_table_name=view_table_name,
181
- column_value=organization_id,
182
- column_name="organization_id",
183
- )
167
+ column_value=organization_id, column_name="organization_id")
184
168
 
185
169
  return {**organization_dict, **organization_ml_dict}
186
170
 
@@ -219,7 +203,7 @@ class OrganizationsLocal(
219
203
  view_table_name = view_table_name or DEFAULT_ML_VIEW_NAME
220
204
  organizations_ids_and_names_list = []
221
205
  select_clause_value = "organization_id, title"
222
- placeholders = ", ".join(["%s"] * len(organizations_ids_list))
206
+ placeholders = ', '.join(['%s'] * len(organizations_ids_list))
223
207
  where_clause_value = f"organization_id in ({placeholders})"
224
208
  organizations_ids_and_names_list = self.select_multi_tuple_by_where(
225
209
  view_table_name=view_table_name,
@@ -251,11 +235,9 @@ class OrganizationsLocal(
251
235
  # Was def get_update_status(self, *, last_modified_timestamp: str, main_profile_id: int) -> UpdateStatus:
252
236
  def get_update_status_and_information_list(self, *,
253
237
  last_modified_timestamp: str,
254
- main_profile_id: int | None) -> list[dict]:
238
+ main_profile_id: int or None) -> list[dict]:
255
239
  if main_profile_id is None:
256
- update_status_and_information_list = [
257
- {"update_status": UpdateStatus.UPDATE_CIRCLEZ}
258
- ]
240
+ update_status_and_information_list = [{"update_status": UpdateStatus.UPDATE_CIRCLEZ}]
259
241
  return update_status_and_information_list
260
242
  sync_conflict_resolution = SyncConflictResolution()
261
243
  # TODO: Shall we also check update_timestamp in organization_table to see if the name was changed?
@@ -274,17 +256,12 @@ class OrganizationsLocal(
274
256
  if organization_id is not None:
275
257
  organizations_ids_list.append(organization_id)
276
258
 
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
- )
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")
283
262
 
284
263
  # Convert organizations_ids_and_names_list to a dictionary
285
- organizations_ids_and_names_dict = {
286
- item[0]: item[1] for item in organizations_ids_and_names_list
287
- }
264
+ organizations_ids_and_names_dict = {item[0]: item[1] for item in organizations_ids_and_names_list}
288
265
 
289
266
  for update_status_and_information in update_status_and_information_list:
290
267
  organization_id = update_status_and_information.get("organization_id")
@@ -293,7 +270,7 @@ class OrganizationsLocal(
293
270
 
294
271
  return update_status_and_information_list
295
272
 
296
- def get_organization_name_by_organization_identifier(self, organization_identifier: str) -> str | None:
273
+ def get_organization_name_by_organization_identifier(self, organization_identifier: str) -> str or None:
297
274
  organization_name = self.select_one_value_by_column_and_value(
298
275
  select_clause_value="name",
299
276
  schema_name="organization",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: organizations-local
3
- Version: 0.0.51
3
+ Version: 0.0.53
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
@@ -5,25 +5,25 @@ package_dir = PACKAGE_NAME.replace("-", "_")
5
5
 
6
6
  setuptools.setup(
7
7
  name=PACKAGE_NAME,
8
- version='0.0.51', # https://pypi.org/project/organizations-local/
8
+ version='0.0.53', # 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,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
- }