dmart 1.4.6__py3-none-any.whl → 1.4.8__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.
Files changed (32) hide show
  1. alembic/README +1 -0
  2. alembic/__pycache__/__init__.cpython-314.pyc +0 -0
  3. alembic/__pycache__/env.cpython-314.pyc +0 -0
  4. alembic/env.py +6 -3
  5. alembic/notes.txt +11 -0
  6. alembic/script.py.mako +28 -0
  7. alembic/versions/__pycache__/0f3d2b1a7c21_add_authz_materialized_views.cpython-314.pyc +0 -0
  8. alembic/versions/__pycache__/10d2041b94d4_last_checksum_history.cpython-314.pyc +0 -0
  9. alembic/versions/__pycache__/1cf4e1ee3cb8_ext_permission_with_filter_fields_values.cpython-314.pyc +0 -0
  10. alembic/versions/__pycache__/26bfe19b49d4_rm_failedloginattempts.cpython-314.pyc +0 -0
  11. alembic/versions/__pycache__/3c8bca2219cc_add_otp_table.cpython-314.pyc +0 -0
  12. alembic/versions/__pycache__/6675fd9dfe42_remove_unique_from_sessions_table.cpython-314.pyc +0 -0
  13. alembic/versions/__pycache__/71bc1df82e6a_adding_user_last_login_at.cpython-314.pyc +0 -0
  14. alembic/versions/__pycache__/74288ccbd3b5_initial.cpython-314.pyc +0 -0
  15. alembic/versions/__pycache__/7520a89a8467_rm_activesession_table.cpython-314.pyc +0 -0
  16. alembic/versions/__pycache__/848b623755a4_make_created_nd_updated_at_required.cpython-314.pyc +0 -0
  17. alembic/versions/__pycache__/8640dcbebf85_add_notes_to_users.cpython-314.pyc +0 -0
  18. alembic/versions/__pycache__/91c94250232a_adding_fk_on_owner_shortname.cpython-314.pyc +0 -0
  19. alembic/versions/__pycache__/98ecd6f56f9a_ext_meta_with_owner_group_shortname.cpython-314.pyc +0 -0
  20. alembic/versions/__pycache__/9aae9138c4ef_indexing_created_at_updated_at.cpython-314.pyc +0 -0
  21. alembic/versions/__pycache__/b53f916b3f6d_json_to_jsonb.cpython-314.pyc +0 -0
  22. alembic/versions/__pycache__/eb5f1ec65156_adding_user_locked_to_device.cpython-314.pyc +0 -0
  23. alembic/versions/__pycache__/f7a4949eed19_adding_query_policies_to_meta.cpython-314.pyc +0 -0
  24. alembic.ini +117 -0
  25. {dmart-1.4.6.dist-info → dmart-1.4.8.dist-info}/METADATA +1 -1
  26. {dmart-1.4.6.dist-info → dmart-1.4.8.dist-info}/RECORD +31 -8
  27. dmart.py +13 -0
  28. info.json +1 -0
  29. alembic/__init__.py +0 -0
  30. {dmart-1.4.6.dist-info → dmart-1.4.8.dist-info}/WHEEL +0 -0
  31. {dmart-1.4.6.dist-info → dmart-1.4.8.dist-info}/entry_points.txt +0 -0
  32. {dmart-1.4.6.dist-info → dmart-1.4.8.dist-info}/top_level.txt +0 -0
alembic/README ADDED
@@ -0,0 +1 @@
1
+ Generic single-database configuration.
Binary file
alembic/env.py CHANGED
@@ -19,9 +19,12 @@ config = context.config
19
19
  if config.config_file_name is not None:
20
20
  fileConfig(config.config_file_name)
21
21
 
22
- driver = settings.database_driver.replace('+asyncpg', '+psycopg')
23
- database_connection_string = f"{driver}://{settings.database_username}:{settings.database_password}@{settings.database_host}:{settings.database_port}"
24
- connection_string = f"{database_connection_string}/{settings.database_name}"
22
+ if "sqlite" in settings.database_driver:
23
+ connection_string = f"sqlite:///{settings.database_name}"
24
+ else:
25
+ driver = settings.database_driver.replace('+asyncpg', '+psycopg')
26
+ database_connection_string = f"{driver}://{settings.database_username}:{settings.database_password}@{settings.database_host}:{settings.database_port}"
27
+ connection_string = f"{database_connection_string}/{settings.database_name}"
25
28
  config.set_main_option('sqlalchemy.url', connection_string)
26
29
 
27
30
  # add your model's MetaData object here
alembic/notes.txt ADDED
@@ -0,0 +1,11 @@
1
+ # 1st : Make sure in alembic.ini to have proper db config for sqlalchemy.url
2
+
3
+
4
+ # To establish the base for a previously created database run the following
5
+
6
+ CREATE TABLE alembic_version (
7
+ version_num VARCHAR(32) NOT NULL,
8
+ CONSTRAINT alembic_version_pkc PRIMARY KEY (version_num)
9
+ );
10
+
11
+ INSERT INTO alembic_version (version_num) VALUES ('74288ccbd3b5') RETURNING alembic_version.version_num;
alembic/script.py.mako ADDED
@@ -0,0 +1,28 @@
1
+ """${message}
2
+
3
+ Revision ID: ${up_revision}
4
+ Revises: ${down_revision | comma,n}
5
+ Create Date: ${create_date}
6
+
7
+ """
8
+ from typing import Sequence, Union
9
+
10
+ from alembic import op
11
+ import sqlalchemy as sa
12
+ import sqlmodel
13
+ import sqlmodel.sql.sqltypes
14
+ ${imports if imports else ""}
15
+
16
+ # revision identifiers, used by Alembic.
17
+ revision: str = ${repr(up_revision)}
18
+ down_revision: Union[str, None] = ${repr(down_revision)}
19
+ branch_labels: Union[str, Sequence[str], None] = ${repr(branch_labels)}
20
+ depends_on: Union[str, Sequence[str], None] = ${repr(depends_on)}
21
+
22
+
23
+ def upgrade() -> None:
24
+ ${upgrades if upgrades else "pass"}
25
+
26
+
27
+ def downgrade() -> None:
28
+ ${downgrades if downgrades else "pass"}
alembic.ini ADDED
@@ -0,0 +1,117 @@
1
+ # A generic, single database configuration.
2
+
3
+ [alembic]
4
+ # path to migration scripts
5
+ # Use forward slashes (/) also on windows to provide an os agnostic path
6
+ script_location = alembic
7
+
8
+ # template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
9
+ # Uncomment the line below if you want the files to be prepended with date and time
10
+ # see https://alembic.sqlalchemy.org/en/latest/tutorial.html#editing-the-ini-file
11
+ # for all available tokens
12
+ # file_template = %%(year)d_%%(month).2d_%%(day).2d_%%(hour).2d%%(minute).2d-%%(rev)s_%%(slug)s
13
+
14
+ # sys.path path, will be prepended to sys.path if present.
15
+ # defaults to the current working directory.
16
+ prepend_sys_path = .
17
+
18
+ # timezone to use when rendering the date within the migration file
19
+ # as well as the filename.
20
+ # If specified, requires the python>=3.9 or backports.zoneinfo library.
21
+ # Any required deps can installed by adding `alembic[tz]` to the pip requirements
22
+ # string value is passed to ZoneInfo()
23
+ # leave blank for localtime
24
+ # timezone =
25
+
26
+ # max length of characters to apply to the "slug" field
27
+ # truncate_slug_length = 40
28
+
29
+ # set to 'true' to run the environment during
30
+ # the 'revision' command, regardless of autogenerate
31
+ # revision_environment = false
32
+
33
+ # set to 'true' to allow .pyc and .pyo files without
34
+ # a source .py file to be detected as revisions in the
35
+ # versions/ directory
36
+ # sourceless = false
37
+
38
+ # version location specification; This defaults
39
+ # to alembic/versions. When using multiple version
40
+ # directories, initial revisions must be specified with --version-path.
41
+ # The path separator used here should be the separator specified by "version_path_separator" below.
42
+ # version_locations = %(here)s/bar:%(here)s/bat:alembic/versions
43
+
44
+ # version path separator; As mentioned above, this is the character used to split
45
+ # version_locations. The default within new alembic.ini files is "os", which uses os.pathsep.
46
+ # If this key is omitted entirely, it falls back to the legacy behavior of splitting on spaces and/or commas.
47
+ # Valid values for version_path_separator are:
48
+ #
49
+ # version_path_separator = :
50
+ # version_path_separator = ;
51
+ # version_path_separator = space
52
+ # version_path_separator = newline
53
+ version_path_separator = os # Use os.pathsep. Default configuration used for new projects.
54
+
55
+ # set to 'true' to search source files recursively
56
+ # in each "version_locations" directory
57
+ # new in Alembic version 1.10
58
+ # recursive_version_locations = false
59
+
60
+ # the output encoding used when revision files
61
+ # are written from script.py.mako
62
+ # output_encoding = utf-8
63
+
64
+ sqlalchemy.url = postgresql+asyncpg://dmart:somepassword@localhost:5432/dmart
65
+
66
+
67
+ [post_write_hooks]
68
+ # post_write_hooks defines scripts or Python functions that are run
69
+ # on newly generated revision scripts. See the documentation for further
70
+ # detail and examples
71
+
72
+ # format using "black" - use the console_scripts runner, against the "black" entrypoint
73
+ # hooks = black
74
+ # black.type = console_scripts
75
+ # black.entrypoint = black
76
+ # black.options = -l 79 REVISION_SCRIPT_FILENAME
77
+
78
+ # lint with attempts to fix using "ruff" - use the exec runner, execute a binary
79
+ # hooks = ruff
80
+ # ruff.type = exec
81
+ # ruff.executable = %(here)s/.venv/bin/ruff
82
+ # ruff.options = --fix REVISION_SCRIPT_FILENAME
83
+
84
+ # Logging configuration
85
+ [loggers]
86
+ keys = root,sqlalchemy,alembic
87
+
88
+ [handlers]
89
+ keys = console
90
+
91
+ [formatters]
92
+ keys = generic
93
+
94
+ [logger_root]
95
+ level = WARNING
96
+ handlers = console
97
+ qualname =
98
+
99
+ [logger_sqlalchemy]
100
+ level = WARNING
101
+ handlers =
102
+ qualname = sqlalchemy.engine
103
+
104
+ [logger_alembic]
105
+ level = INFO
106
+ handlers =
107
+ qualname = alembic
108
+
109
+ [handler_console]
110
+ class = StreamHandler
111
+ args = (sys.stderr,)
112
+ level = NOTSET
113
+ formatter = generic
114
+
115
+ [formatter_generic]
116
+ format = %(levelname)-5.5s [%(name)s] %(message)s
117
+ datefmt = %H:%M:%S
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dmart
3
- Version: 1.4.6
3
+ Version: 1.4.8
4
4
  Requires-Python: >=3.11
5
5
  Requires-Dist: fastapi
6
6
  Requires-Dist: pydantic
@@ -1,7 +1,9 @@
1
+ alembic.ini,sha256=wQweByyHQm-EI8BQkE0SHNRjULJ6Xn5jqgvv88IT5Sg,3738
1
2
  bundler.py,sha256=so8ZJResb1PcOH5vboa_mpFAdYr_T8u8DbbFXd570Lg,1704
2
3
  data_generator.py,sha256=CnE-VHEeX7-lAXtqCgbRqR9WHjTuOgeiZcviYrHAmho,2287
3
- dmart.py,sha256=1oQXSPgHiVpSPKhKy2EhP2Mmu1ZKPEdKqbXehXUj7MA,21760
4
+ dmart.py,sha256=M2Tb4Z4A8NMPfdgJRHzugluBfT4JiIVVLMxXFJJVo68,22376
4
5
  get_settings.py,sha256=Sbe2WCoiK398E7HY4SNLfDN_GmE8knR4M-YJWF31jcg,153
6
+ info.json,sha256=hXQWl19lfMkEj_zXdehGeKjiKGNJ7emY4S7d4pIqJ1E,123
5
7
  main.py,sha256=KZGhIL6AnEm5ZAPy4IvhBDpzSTjuodilV7NafNOyhzM,19676
6
8
  migrate.py,sha256=hn1MZoVby_Jjqhc7y3CrLcGD619QmVZv3PONNvO7VKQ,665
7
9
  password_gen.py,sha256=xjx8wi105ZYvhLBBQj7_rugACpxifGXHse6f7YlGXWQ,196
@@ -12,8 +14,12 @@ schema_modulate.py,sha256=vB7NxvqghqNpFe__p0ll03WsvNftzxBbQ6UXB2UfxNU,6454
12
14
  set_admin_passwd.py,sha256=Ei8wnoJ_UDHIXmMb-E_dd_NqyM6Gt5AgJPJ4fAxARXI,1950
13
15
  sync.py,sha256=FlmubtlnFaxtZkbRV1-eyS_Sx5KBRvWyIZjvd0Tiar4,7339
14
16
  websocket.py,sha256=Q8WUTvOTBHKP5xy5wim8yn0t-BfjrPwx7J_6vbzAm1A,7576
15
- alembic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
- alembic/env.py,sha256=z12UKhorKSOKEovOCQOwRjfR_tup4VeRlhcB1UPk3Xw,2700
17
+ alembic/README,sha256=MVlc9TYmr57RbhXET6QxgyCcwWP7w-vLkEsirENqiIQ,38
18
+ alembic/env.py,sha256=ahYndeefOvhqeZ7EQMkI1NdqJVQCUqLxYNP_MtJeDfY,2821
19
+ alembic/notes.txt,sha256=X7LYSNmulLRiAUXvw07Z85bSGRTnx4NUpoNC9D2DfO8,395
20
+ alembic/script.py.mako,sha256=u-ABdYW1tcIILgJFJdQZYLxoAI8Awd6wZbx30rY6fxU,680
21
+ alembic/__pycache__/__init__.cpython-314.pyc,sha256=CcFVDJxqk1nR7sZH9dbbffqoMo0jRHW-MiSSGFX--qA,174
22
+ alembic/__pycache__/env.cpython-314.pyc,sha256=9L-2pPlUSIrHh1JLQilY0TDxqo7_ikqfKhFwImuCuwk,3935
17
23
  alembic/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
24
  alembic/scripts/calculate_checksums.py,sha256=v2NLEvReA9V3noJE-BWANgKDdhc8Mqg1ZmJJ8nc8sGI,3443
19
25
  alembic/scripts/migration_f7a4949eed19.py,sha256=oUXuxjU4MbVafm4S-xu5J_4apHqW6hQZ8ftpJtCtM28,1462
@@ -35,6 +41,23 @@ alembic/versions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
35
41
  alembic/versions/b53f916b3f6d_json_to_jsonb.py,sha256=LPnevQjbjs0KrwqxYHtGUC6mSBBsUpiCBnwD-FN2x50,24840
36
42
  alembic/versions/eb5f1ec65156_adding_user_locked_to_device.py,sha256=Z9skCus52jg_xV5a7JVYK3IenNlvsdMKIFf1H5POst0,1030
37
43
  alembic/versions/f7a4949eed19_adding_query_policies_to_meta.py,sha256=LA4rx3u0Ei5m4OcSsVYHBsGMeKOJdx8G88yK1kBLFys,2307
44
+ alembic/versions/__pycache__/0f3d2b1a7c21_add_authz_materialized_views.cpython-314.pyc,sha256=mevU12_Y6RzGxc8Xg1bkFIVaNu7uvx7zCQ2j6bn_Pqo,3955
45
+ alembic/versions/__pycache__/10d2041b94d4_last_checksum_history.cpython-314.pyc,sha256=n3eMeDeLN8WXXzoKA-8b4t9k-WQF4FPVYIRReNm-uN4,6199
46
+ alembic/versions/__pycache__/1cf4e1ee3cb8_ext_permission_with_filter_fields_values.cpython-314.pyc,sha256=_8yowo72FtcMsYQOp2vpy_hWJ5QlDOPsDsEt6NOr9cY,2649
47
+ alembic/versions/__pycache__/26bfe19b49d4_rm_failedloginattempts.cpython-314.pyc,sha256=1PYF87QiiSXEmHUM6wnq9Ck_ktq981W3TgS-_7QqG4M,3309
48
+ alembic/versions/__pycache__/3c8bca2219cc_add_otp_table.cpython-314.pyc,sha256=HD6h3iYtGyhDcOjRK4xWa9Hl6YzdIszmyO95wPZvFOM,2710
49
+ alembic/versions/__pycache__/6675fd9dfe42_remove_unique_from_sessions_table.cpython-314.pyc,sha256=k71q5tLr6x2cDoHw4pDNeBem136qz2XFjUg11a6DDpM,2422
50
+ alembic/versions/__pycache__/71bc1df82e6a_adding_user_last_login_at.cpython-314.pyc,sha256=35cwhVRGhtvREO4j3pBDtGoSD8sZd0MdZ0SRZKLsK5s,3399
51
+ alembic/versions/__pycache__/74288ccbd3b5_initial.cpython-314.pyc,sha256=BDS6zx-enw-oWeAIju5plp4lB10q8BeFwBnaUDEgtKY,28589
52
+ alembic/versions/__pycache__/7520a89a8467_rm_activesession_table.cpython-314.pyc,sha256=x5m_sxYMDP6myKKlVTivP-VM-2EH6d0D21pv9URFyXU,2791
53
+ alembic/versions/__pycache__/848b623755a4_make_created_nd_updated_at_required.cpython-314.pyc,sha256=A4E0A4eJliMs-uNeVZfGo2j8UrXhdRrtBB1Ky-OA_O0,7917
54
+ alembic/versions/__pycache__/8640dcbebf85_add_notes_to_users.cpython-314.pyc,sha256=94zNRuU2L3ra43Z3eDa4duVMXMsKTLiNUUj7lUxeZzY,2526
55
+ alembic/versions/__pycache__/91c94250232a_adding_fk_on_owner_shortname.cpython-314.pyc,sha256=IIEupLleN5nEUUpTCXWGV-LXsdzGJrcnrolJmpi8WMo,6383
56
+ alembic/versions/__pycache__/98ecd6f56f9a_ext_meta_with_owner_group_shortname.cpython-314.pyc,sha256=tPXDQ_TCEK9sv3ZinAk9vUJcwuqE75ymoT_0O_0qLss,5657
57
+ alembic/versions/__pycache__/9aae9138c4ef_indexing_created_at_updated_at.cpython-314.pyc,sha256=D3m2fuhNbUUNZi21p45UDy8uUmAOio1RZzqoPnKD6G4,6990
58
+ alembic/versions/__pycache__/b53f916b3f6d_json_to_jsonb.cpython-314.pyc,sha256=tsx4FNUeGpuqnMm_ewhDnjXGdBOzypSVqo_AQtzoOVk,34026
59
+ alembic/versions/__pycache__/eb5f1ec65156_adding_user_locked_to_device.cpython-314.pyc,sha256=v47hBAxgbjkSAsEn8O2EUTUOPR0D9bVD8fJl9erlpzM,2514
60
+ alembic/versions/__pycache__/f7a4949eed19_adding_query_policies_to_meta.cpython-314.pyc,sha256=jCW56_bq_qQM6H9CjPu2qOm8gywSO7TEHHywlyv1qcI,5099
38
61
  api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
62
  api/info/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
40
63
  api/info/router.py,sha256=sQZZor7A-uDzsJX39aqEA7bMZOJ-WTitYeFvVNWfaHw,3938
@@ -258,8 +281,8 @@ utils/ticket_sys_utils.py,sha256=9QAlW2iiy8KyxQRBDj_WmzS5kKb0aYJmGwd4qzmGVqo,700
258
281
  utils/web_notifier.py,sha256=QM87VVid2grC5lK3NdS1yzz0z1wXljr4GChJOeK86W4,843
259
282
  utils/templates/activation.html.j2,sha256=XAMKCdoqONoc4ZQucD0yV-Pg5DlHHASZrTVItNS-iBE,640
260
283
  utils/templates/reminder.html.j2,sha256=aoS8bTs56q4hjAZKsb0jV9c-PIURBELuBOpT_qPZNVU,639
261
- dmart-1.4.6.dist-info/METADATA,sha256=0jB-34rhbCWG-Ox3mtL0GkRMt4DZ8fYarnibCLJZ4TA,2068
262
- dmart-1.4.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
263
- dmart-1.4.6.dist-info/entry_points.txt,sha256=GjfoGh1bpxuU9HHGJzbtCFPNptHv9TryxHMN3uBSKpg,37
264
- dmart-1.4.6.dist-info/top_level.txt,sha256=iPbBisVNr4KDWyZhxMl2x3oJSgf71knWXMh21_xutrE,266
265
- dmart-1.4.6.dist-info/RECORD,,
284
+ dmart-1.4.8.dist-info/METADATA,sha256=MPoNax5zdjNPoEUEa8Cp5gLb3MKCMaq129c86xfRh3A,2068
285
+ dmart-1.4.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
286
+ dmart-1.4.8.dist-info/entry_points.txt,sha256=GjfoGh1bpxuU9HHGJzbtCFPNptHv9TryxHMN3uBSKpg,37
287
+ dmart-1.4.8.dist-info/top_level.txt,sha256=iPbBisVNr4KDWyZhxMl2x3oJSgf71knWXMh21_xutrE,266
288
+ dmart-1.4.8.dist-info/RECORD,,
dmart.py CHANGED
@@ -40,6 +40,7 @@ commands = """ server
40
40
  archive
41
41
  json_to_db
42
42
  db_to_json
43
+ migrate
43
44
  help
44
45
  version
45
46
  info
@@ -532,6 +533,18 @@ def main():
532
533
  asyncio.run(json_to_db_migration())
533
534
  case "db_to_json":
534
535
  db_to_json_migration()
536
+ case "migrate":
537
+ try:
538
+ from alembic.config import Config
539
+ from alembic import command
540
+ except ModuleNotFoundError:
541
+ print("Error: 'alembic' library not found. Please install it with 'pip install alembic'.")
542
+ sys.exit(1)
543
+
544
+ alembic_ini_path = Path(__file__).resolve().parent / "alembic.ini"
545
+ alembic_cfg = Config(str(alembic_ini_path))
546
+ alembic_cfg.set_main_option("script_location", str(Path(__file__).resolve().parent / "alembic"))
547
+ command.upgrade(alembic_cfg, "head")
535
548
  case "help":
536
549
  print("Available commands:")
537
550
  print(commands)
info.json ADDED
@@ -0,0 +1 @@
1
+ {"branch": "pypi", "version": "2e6304dd", "tag": "v1.4.0-72-g2e6304dd", "version_date": "'Mon Jan 19 08:55:04 2026 +0000'"}
alembic/__init__.py DELETED
File without changes
File without changes