arpakitlib 1.8.246__py3-none-any.whl → 1.8.248__py3-none-any.whl

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.
@@ -0,0 +1,2 @@
1
+ cd ..
2
+ alembic heads
@@ -0,0 +1,2 @@
1
+ cd ..
2
+ alembic history --verbose
@@ -1,10 +1,10 @@
1
- from arpakitlib.ensure_sqlalchemy_check_constraints import ensure_sqlalchemy_check_constraints
2
1
  from project.core.setup_logging import setup_logging
2
+ from project.sqlalchemy_db_.sqlalchemy_db import get_cached_sqlalchemy_db
3
3
 
4
4
 
5
5
  def __command():
6
6
  setup_logging()
7
- ensure_sqlalchemy_check_constraints()
7
+ get_cached_sqlalchemy_db().ensure_check_constraints()
8
8
 
9
9
 
10
10
  if __name__ == '__main__':
@@ -298,8 +298,14 @@ class SQLAlchemyDb:
298
298
  connection.commit()
299
299
  self._logger.info("alembic tables data were removed")
300
300
 
301
- def init(self):
301
+ def ensure_check_constraints(self):
302
+ from arpakitlib.ensure_sqlalchemy_check_constraints import ensure_sqlalchemy_check_constraints
303
+ ensure_sqlalchemy_check_constraints(base_=self.base_dbm, engine=self.engine)
304
+
305
+ def init(self, ensure_check_constraints: bool = True):
302
306
  self.base_dbm.metadata.create_all(bind=self.engine, checkfirst=True)
307
+ if ensure_check_constraints:
308
+ self.ensure_check_constraints()
303
309
  self._logger.info("inited")
304
310
 
305
311
  def drop(self):
@@ -0,0 +1,17 @@
1
+ from random import randint
2
+
3
+
4
+ def generate_simple_code(
5
+ *,
6
+ amount: int = 5
7
+ ) -> str:
8
+ alphabet: list = list("JZSDQWRLGFZ" + "123456789")
9
+ return "".join(alphabet[randint(0, len(alphabet) - 1)] for _ in range(amount))
10
+
11
+
12
+ def __example():
13
+ print(generate_simple_code(amount=5))
14
+
15
+
16
+ if __name__ == '__main__':
17
+ __example()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: arpakitlib
3
- Version: 1.8.246
3
+ Version: 1.8.248
4
4
  Summary: arpakitlib
5
5
  License: Apache-2.0
6
6
  Keywords: arpakitlib,arpakit,arpakit-company,arpakitcompany,arpakit_company
@@ -10,7 +10,9 @@ arpakitlib/_arpakit_project_template_v_5/alembic/versions/__init__.py,sha256=47D
10
10
  arpakitlib/_arpakit_project_template_v_5/alembic.ini,sha256=8fuyeEvGBiPGbxEFy8ISBV3xX_fgVmuhEGpB10_B5Uo,3733
11
11
  arpakitlib/_arpakit_project_template_v_5/arpakitlib_project_template_info.json,sha256=UoKetK4zTpBysXy0mTDYjsHSOoPgzgYDeIuecYG27ZU,98
12
12
  arpakitlib/_arpakit_project_template_v_5/command/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
+ arpakitlib/_arpakit_project_template_v_5/command/alembic_heads.sh,sha256=9RjZqc9jje7o01779YCvllka3Tk6N25t71A05S1OxO4,19
13
14
  arpakitlib/_arpakit_project_template_v_5/command/alembic_history.sh,sha256=OMnDNtHIksGh9iavWnzbtxcudZW4vjdcISsBXvzZSPw,22
15
+ arpakitlib/_arpakit_project_template_v_5/command/alembic_history_verbose.sh,sha256=ovY9AxLbNC6oMfsvHIm0mMbEcNBBZmCeZAc1mremUhM,32
14
16
  arpakitlib/_arpakit_project_template_v_5/command/alembic_revision_autogenerate.sh,sha256=yW2i-SBOtBx15Ya0poVQqKkJM5t2JZp06r9AEW-DmGE,46
15
17
  arpakitlib/_arpakit_project_template_v_5/command/alembic_upgrade_head.sh,sha256=RIkhv5e5ERZHoxmTvvo_nCeDeVqeVIam7CjVoE9_E4k,38
16
18
  arpakitlib/_arpakit_project_template_v_5/command/beautify_json.py,sha256=oyxkT3wGqCwGNgwGHW-gPLJd063V8-SXA5OXkszAE2g,215
@@ -25,7 +27,7 @@ arpakitlib/_arpakit_project_template_v_5/command/docker_stop_postgres.sh,sha256=
25
27
  arpakitlib/_arpakit_project_template_v_5/command/drop_json_db.py,sha256=TjdM4kW6F4BBa07PoJmXgA5HX-vqoqK2oT-aAB4nF7s,325
26
28
  arpakitlib/_arpakit_project_template_v_5/command/drop_sqlalchemy_db.py,sha256=U4eG5w9At8bTcU8PzB6GfZhxox836CRPWODXqgx4HOU,455
27
29
  arpakitlib/_arpakit_project_template_v_5/command/emojize.py,sha256=RpIBA60HXqHvWGrB8pFGJ5glpI4tWfPGkw9QRy32YLg,134
28
- arpakitlib/_arpakit_project_template_v_5/command/ensure_sqlalchemy_check_constraints.py,sha256=22qTo33waXGGqKBa6qePNZAJmsVXHY1PLmam6FeWC4w,274
30
+ arpakitlib/_arpakit_project_template_v_5/command/ensure_sqlalchemy_check_constraints.py,sha256=71s3Jy1F4HxzURBTod6Ye7HrNpgaX1uhfG88jJkBCts,269
29
31
  arpakitlib/_arpakit_project_template_v_5/command/generate_settings_env_example.py,sha256=v05NKSG-hFZyFiMfV6n8uObv-1qoS59UdztSsq4lF1c,437
30
32
  arpakitlib/_arpakit_project_template_v_5/command/git_commit.sh,sha256=AW1NEel-ZHaYeVWFlRbgZSYPQdnVKsTkpR_07RQL1Mw,42
31
33
  arpakitlib/_arpakit_project_template_v_5/command/git_push_arpakit_company_github_1.sh,sha256=Sx-OegryHeNTIfAOoCfj3Z3CF-XKEY0AJF5HVJAgGpU,70
@@ -417,17 +419,18 @@ arpakitlib/ar_schedule_uust_api_client_util.py,sha256=rXI2_3OTaIBgR-GixM1Ti-Ue1f
417
419
  arpakitlib/ar_settings_util.py,sha256=Y5wi_cmsjDjfJpM0VJHjbo0NoVPKfypKaD1USowwDtQ,1327
418
420
  arpakitlib/ar_sleep_util.py,sha256=ggaj7ML6QK_ADsHMcyu6GUmUpQ_9B9n-SKYH17h-9lM,1045
419
421
  arpakitlib/ar_sqladmin_util.py,sha256=SEoaowAPF3lhxPsNjwmOymNJ55Ty9rmzvsDm7gD5Ceo,861
420
- arpakitlib/ar_sqlalchemy_util.py,sha256=aNHK7kT1VNSHmGx8m6KsaLOZ9ofO7pFa10rW4vZe2Bc,15698
422
+ arpakitlib/ar_sqlalchemy_util.py,sha256=U_pb6oKKaLH_JcCh_6Zvm3DRpv79EOUxhr5kD3h-G3Y,16047
421
423
  arpakitlib/ar_str_util.py,sha256=2lGpnXDf2h1cBZpVf5i1tX_HCv5iBd6IGnrCw4QWWlY,4350
422
424
  arpakitlib/ar_type_util.py,sha256=Cs_tef-Fc5xeyAF54KgISCsP11NHyzIsglm4S3Xx7iM,4049
423
425
  arpakitlib/ar_yookassa_api_client_util.py,sha256=VozuZeCJjmLd1zj2BdC9WfiAQ3XYOrIMsdpNK-AUlm0,5347
424
426
  arpakitlib/clone_pydantic_model_fields.py,sha256=xxLwtvJzDf8EWMvBE4psWIj8c-cyeCxLRX76oCY_4zk,1214
425
427
  arpakitlib/ensure_sqlalchemy_check_constraints.py,sha256=JJbgaUiLT8D8oDVevP25wlMz1BTtx0JMasJ_ILyIJ3o,5328
428
+ arpakitlib/generate_simple_code.py,sha256=EkrebrTi7sArSRAuxvN5BPm_A0-dFSCZgdoJhx5kPhk,344
426
429
  arpakitlib/pydantic_schema_from_sqlalchemy_model.py,sha256=_5Y79kQ4lLIOL6_afIFVwxY1EXzTMpi-veRR-WkPFOs,2879
427
430
  arpakitlib/raise_own_exception_if_exception.py,sha256=A6TuNSBk1pHaQ_qxnUmE2LgsNGA1IGqX26b1_HEA4Nc,5978
428
431
  arpakitlib/really_validate_email.py,sha256=HBfhyiDB3INI6Iq6hR2WOMKA5wVWWRl0Qun-x__OZ9o,1201
429
- arpakitlib-1.8.246.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
430
- arpakitlib-1.8.246.dist-info/METADATA,sha256=Eh_2z0ZW4cCZfAGafGAQtWt42yJM3SiE15Nan5C4uXM,3919
431
- arpakitlib-1.8.246.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
432
- arpakitlib-1.8.246.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
433
- arpakitlib-1.8.246.dist-info/RECORD,,
432
+ arpakitlib-1.8.248.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
433
+ arpakitlib-1.8.248.dist-info/METADATA,sha256=Ocp-lR_y6KwilRNh4IY-i3e44-AGz8zJFu-bovEVwHY,3919
434
+ arpakitlib-1.8.248.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
435
+ arpakitlib-1.8.248.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
436
+ arpakitlib-1.8.248.dist-info/RECORD,,