plexus-python-common 1.0.66__tar.gz → 1.0.67__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.
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/PKG-INFO +1 -1
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/utils/ormutils.py +8 -8
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/utils/tagutils.py +181 -157
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus_python_common.egg-info/PKG-INFO +1 -1
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/.editorconfig +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/.github/workflows/pr.yml +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/.github/workflows/push.yml +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/.gitignore +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/MANIFEST.in +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/README.md +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/VERSION +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/pyproject.toml +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/jsonutils/dummy.0.jsonl +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/jsonutils/dummy.1.jsonl +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/jsonutils/dummy.2.jsonl +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/pathutils/0-dummy +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/pathutils/1-dummy +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/pathutils/2-dummy +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/pathutils/dummy.0.0.jsonl +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/pathutils/dummy.0.0.vol-0.jsonl +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/pathutils/dummy.0.jsonl +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/pathutils/dummy.1.1.jsonl +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/pathutils/dummy.1.1.vol-1.jsonl +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/pathutils/dummy.1.jsonl +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/pathutils/dummy.2.2.jsonl +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/pathutils/dummy.2.2.vol-2.jsonl +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/pathutils/dummy.2.jsonl +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/pathutils/dummy.csv.part0 +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/pathutils/dummy.csv.part1 +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/pathutils/dummy.csv.part2 +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/pathutils/dummy.txt +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/s3utils/dir.baz/file.bar.baz +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/s3utils/dir.baz/file.foo.bar +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/s3utils/dir.baz/file.foo.baz +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/s3utils/dir.foo/dir.foo.bar/dir.foo.bar.baz/file.foo.bar.baz +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/s3utils/dir.foo/dir.foo.bar/file.bar.baz +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/s3utils/dir.foo/dir.foo.bar/file.foo.bar +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/s3utils/dir.foo/dir.foo.bar/file.foo.baz +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/s3utils/dir.foo/file.bar +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/s3utils/dir.foo/file.baz +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/s3utils/dir.foo/file.foo +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/s3utils_archive/archive.compressed.zip +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/s3utils_archive/archive.uncompressed.zip +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/setup.cfg +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/setup.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/__init__.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/carto/OSMFile.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/carto/OSMNode.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/carto/OSMTags.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/carto/OSMWay.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/carto/__init__.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/resources/__init__.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/resources/tags/__init__.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/resources/tags/unittest-1.0.0.tagset.yaml +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/resources/tags/universal-1.0.0.tagset.yaml +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/utils/__init__.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/utils/apiutils.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/utils/bagutils.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/utils/config.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/utils/datautils.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/utils/dockerutils.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/utils/gisutils.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/utils/jsonutils.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/utils/pathutils.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/utils/s3utils.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/utils/sqlutils.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/utils/strutils.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/utils/testutils.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus_python_common.egg-info/SOURCES.txt +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus_python_common.egg-info/dependency_links.txt +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus_python_common.egg-info/not-zip-safe +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus_python_common.egg-info/requires.txt +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus_python_common.egg-info/top_level.txt +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/test/plexus_tests/__init__.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/test/plexus_tests/common/__init__.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/test/plexus_tests/common/carto/__init__.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/test/plexus_tests/common/carto/osm_file_test.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/test/plexus_tests/common/carto/osm_tags_test.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/test/plexus_tests/common/utils/__init__.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/test/plexus_tests/common/utils/bagutils_test.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/test/plexus_tests/common/utils/datautils_test.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/test/plexus_tests/common/utils/dockerutils_test.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/test/plexus_tests/common/utils/gisutils_test.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/test/plexus_tests/common/utils/jsonutils_test.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/test/plexus_tests/common/utils/ormutils_test.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/test/plexus_tests/common/utils/pathutils_test.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/test/plexus_tests/common/utils/s3utils_test.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/test/plexus_tests/common/utils/strutils_test.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/test/plexus_tests/common/utils/tagutils_test.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/test/plexus_tests/common/utils/testutils_test.py +0 -0
- {plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/test/testenv.py +0 -0
{plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/utils/ormutils.py
RENAMED
|
@@ -468,10 +468,10 @@ def model_revision_type(dialect: str | None = None) -> sa.types.TypeEngine[int]:
|
|
|
468
468
|
|
|
469
469
|
# At the present time, we cannot express intersection of Protocol and SQLModel directly.
|
|
470
470
|
# Thus, we define union types here for the mixins.
|
|
471
|
-
SequenceModelMixin = SequenceModelMixinProtocol |
|
|
472
|
-
ChangingModelMixin = ChangingModelMixinProtocol |
|
|
473
|
-
SnapshotModelMixin = SnapshotModelMixinProtocol |
|
|
474
|
-
RevisionModelMixin = RevisionModelMixinProtocol |
|
|
471
|
+
SequenceModelMixin = SequenceModelMixinProtocol | pdt.BaseModel
|
|
472
|
+
ChangingModelMixin = ChangingModelMixinProtocol | pdt.BaseModel
|
|
473
|
+
SnapshotModelMixin = SnapshotModelMixinProtocol | pdt.BaseModel
|
|
474
|
+
RevisionModelMixin = RevisionModelMixinProtocol | pdt.BaseModel
|
|
475
475
|
|
|
476
476
|
|
|
477
477
|
def make_sequence_model_mixin(dialect: str | None = None) -> type[SequenceModelMixin]:
|
|
@@ -483,7 +483,7 @@ def make_sequence_model_mixin(dialect: str | None = None) -> type[SequenceModelM
|
|
|
483
483
|
:return: A mixin class that can be used with SQLModel models to add the ``sqn`` field.
|
|
484
484
|
"""
|
|
485
485
|
|
|
486
|
-
class ModelMixin(
|
|
486
|
+
class ModelMixin(pdt.BaseModel):
|
|
487
487
|
sqn: int | None = Field(
|
|
488
488
|
sa_column=sa.Column(model_sqn_type(dialect), primary_key=True, autoincrement=True),
|
|
489
489
|
default=None,
|
|
@@ -503,7 +503,7 @@ def make_changing_model_mixin(dialect: str | None = None) -> type[ChangingModelM
|
|
|
503
503
|
updatable records.
|
|
504
504
|
"""
|
|
505
505
|
|
|
506
|
-
class ModelMixin(
|
|
506
|
+
class ModelMixin(pdt.BaseModel):
|
|
507
507
|
sqn: int | None = Field(
|
|
508
508
|
sa_column=sa.Column(model_sqn_type(dialect), primary_key=True, autoincrement=True),
|
|
509
509
|
default=None,
|
|
@@ -573,7 +573,7 @@ def make_snapshot_model_mixin(dialect: str | None = None) -> type[SnapshotModelM
|
|
|
573
573
|
record snapshots.
|
|
574
574
|
"""
|
|
575
575
|
|
|
576
|
-
class ModelMixin(
|
|
576
|
+
class ModelMixin(pdt.BaseModel):
|
|
577
577
|
sqn: int | None = Field(
|
|
578
578
|
sa_column=sa.Column(model_sqn_type(dialect), primary_key=True, autoincrement=True),
|
|
579
579
|
default=None,
|
|
@@ -676,7 +676,7 @@ def make_revision_model_mixin(dialect: str | None = None) -> type[RevisionModelM
|
|
|
676
676
|
record revisions.
|
|
677
677
|
"""
|
|
678
678
|
|
|
679
|
-
class ModelMixin(
|
|
679
|
+
class ModelMixin(pdt.BaseModel):
|
|
680
680
|
sqn: int | None = Field(
|
|
681
681
|
sa_column=sa.Column(model_sqn_type(dialect), primary_key=True, autoincrement=True),
|
|
682
682
|
default=None,
|
{plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/utils/tagutils.py
RENAMED
|
@@ -27,7 +27,7 @@ from iker.common.utils.iterutils import dicttree_children, dicttree_lineage, dic
|
|
|
27
27
|
from iker.common.utils.jsonutils import JsonObject, JsonType
|
|
28
28
|
from iker.common.utils.randutils import randomizer
|
|
29
29
|
from iker.common.utils.strutils import is_blank
|
|
30
|
-
from sqlmodel import Field
|
|
30
|
+
from sqlmodel import Field
|
|
31
31
|
|
|
32
32
|
from plexus.common.resources.tags import predefined_tagset_specs
|
|
33
33
|
from plexus.common.utils.datautils import validate_colon_tag, validate_snake_case, validate_vehicle_name
|
|
@@ -46,6 +46,8 @@ __all__ = [
|
|
|
46
46
|
"populate_tagset",
|
|
47
47
|
"predefined_tagsets",
|
|
48
48
|
"render_tagset_markdown_readme",
|
|
49
|
+
"make_tag_target_model_mixin",
|
|
50
|
+
"make_tag_record_model_mixin",
|
|
49
51
|
"TagTarget",
|
|
50
52
|
"TagRecord",
|
|
51
53
|
"TagTargetTable",
|
|
@@ -376,173 +378,187 @@ def render_tagset_markdown_readme(tagset: Tagset) -> str:
|
|
|
376
378
|
return env.from_string(template_str).render(tagset=tagset)
|
|
377
379
|
|
|
378
380
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
description="End datetime of the target range associated with the tag record",
|
|
406
|
-
)
|
|
407
|
-
|
|
408
|
-
@pdt.field_validator("identifier", mode="after")
|
|
409
|
-
@classmethod
|
|
410
|
-
def validate_identifier(cls, v: str) -> str:
|
|
411
|
-
validate_slash_tag(v)
|
|
412
|
-
return v
|
|
413
|
-
|
|
414
|
-
@pdt.field_validator("tagger_name", mode="after")
|
|
415
|
-
@classmethod
|
|
416
|
-
def validate_tagger_name(cls, v: str) -> str:
|
|
417
|
-
validate_snake_case(v)
|
|
418
|
-
return v
|
|
419
|
-
|
|
420
|
-
@pdt.field_validator("tagger_version", mode="after")
|
|
421
|
-
@classmethod
|
|
422
|
-
def validate_tagger_version(cls, v: str) -> str:
|
|
423
|
-
validate_semver(v)
|
|
424
|
-
return v
|
|
425
|
-
|
|
426
|
-
@pdt.field_validator("vehicle_name", mode="after")
|
|
427
|
-
@classmethod
|
|
428
|
-
def validate_vehicle_name(cls, v: str) -> str:
|
|
429
|
-
validate_vehicle_name(v)
|
|
430
|
-
return v
|
|
431
|
-
|
|
432
|
-
@pdt.field_validator("begin_dt", mode="after")
|
|
433
|
-
@classmethod
|
|
434
|
-
def validate_begin_dt(cls, v: datetime.datetime) -> datetime.datetime:
|
|
435
|
-
validate_dt_timezone(v)
|
|
436
|
-
return v
|
|
437
|
-
|
|
438
|
-
@pdt.field_validator("end_dt", mode="after")
|
|
439
|
-
@classmethod
|
|
440
|
-
def validate_end_dt(cls, v: datetime.datetime) -> datetime.datetime:
|
|
441
|
-
validate_dt_timezone(v)
|
|
442
|
-
return v
|
|
443
|
-
|
|
444
|
-
@pdt.model_validator(mode="after")
|
|
445
|
-
def validate_begin_dt_end_dt(self) -> Self:
|
|
446
|
-
if self.begin_dt > self.end_dt:
|
|
447
|
-
raise ValueError(f"begin_dt '{self.begin_dt}' is greater than end_dt '{self.end_dt}'")
|
|
448
|
-
return self
|
|
381
|
+
def make_tag_target_model_mixin() -> type[pdt.BaseModel]:
|
|
382
|
+
class ModelMixin(pdt.BaseModel):
|
|
383
|
+
identifier: str = Field(
|
|
384
|
+
sa_column=sa.Column(sa_sqlite.VARCHAR(256), nullable=False, unique=True),
|
|
385
|
+
description="Identifier of the tag target",
|
|
386
|
+
)
|
|
387
|
+
tagger_name: str = Field(
|
|
388
|
+
sa_column=sa.Column(sa_sqlite.VARCHAR(128), nullable=False),
|
|
389
|
+
description="Name of the tagger that generates the tag records for the target",
|
|
390
|
+
)
|
|
391
|
+
tagger_version: str = Field(
|
|
392
|
+
sa_column=sa.Column(sa_sqlite.VARCHAR(32), nullable=False),
|
|
393
|
+
description="Version of the tagger that generates the tag records for the target",
|
|
394
|
+
)
|
|
395
|
+
vehicle_name: str = Field(
|
|
396
|
+
sa_column=sa.Column(sa_sqlite.VARCHAR(128), nullable=False),
|
|
397
|
+
description="Vehicle name associated with the tag record",
|
|
398
|
+
)
|
|
399
|
+
begin_dt: datetime.datetime = Field(
|
|
400
|
+
sa_column=sa.Column(SQLiteDateTime, nullable=False),
|
|
401
|
+
description="Begin datetime of the target range associated with the tag record",
|
|
402
|
+
)
|
|
403
|
+
end_dt: datetime.datetime = Field(
|
|
404
|
+
sa_column=sa.Column(SQLiteDateTime, nullable=False),
|
|
405
|
+
description="End datetime of the target range associated with the tag record",
|
|
406
|
+
)
|
|
449
407
|
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
408
|
+
@pdt.field_validator("identifier", mode="after")
|
|
409
|
+
@classmethod
|
|
410
|
+
def validate_identifier(cls, v: str) -> str:
|
|
411
|
+
validate_slash_tag(v)
|
|
412
|
+
return v
|
|
453
413
|
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
414
|
+
@pdt.field_validator("tagger_name", mode="after")
|
|
415
|
+
@classmethod
|
|
416
|
+
def validate_tagger_name(cls, v: str) -> str:
|
|
417
|
+
validate_snake_case(v)
|
|
418
|
+
return v
|
|
457
419
|
|
|
420
|
+
@pdt.field_validator("tagger_version", mode="after")
|
|
421
|
+
@classmethod
|
|
422
|
+
def validate_tagger_version(cls, v: str) -> str:
|
|
423
|
+
validate_semver(v)
|
|
424
|
+
return v
|
|
425
|
+
|
|
426
|
+
@pdt.field_validator("vehicle_name", mode="after")
|
|
427
|
+
@classmethod
|
|
428
|
+
def validate_vehicle_name(cls, v: str) -> str:
|
|
429
|
+
validate_vehicle_name(v)
|
|
430
|
+
return v
|
|
431
|
+
|
|
432
|
+
@pdt.field_validator("begin_dt", mode="after")
|
|
433
|
+
@classmethod
|
|
434
|
+
def validate_begin_dt(cls, v: datetime.datetime) -> datetime.datetime:
|
|
435
|
+
validate_dt_timezone(v)
|
|
436
|
+
return v
|
|
437
|
+
|
|
438
|
+
@pdt.field_validator("end_dt", mode="after")
|
|
439
|
+
@classmethod
|
|
440
|
+
def validate_end_dt(cls, v: datetime.datetime) -> datetime.datetime:
|
|
441
|
+
validate_dt_timezone(v)
|
|
442
|
+
return v
|
|
443
|
+
|
|
444
|
+
@pdt.model_validator(mode="after")
|
|
445
|
+
def validate_begin_dt_end_dt(self) -> Self:
|
|
446
|
+
if self.begin_dt > self.end_dt:
|
|
447
|
+
raise ValueError(f"begin_dt '{self.begin_dt}' is greater than end_dt '{self.end_dt}'")
|
|
448
|
+
return self
|
|
449
|
+
|
|
450
|
+
@pdt.field_serializer("begin_dt", mode="plain")
|
|
451
|
+
def serialize_begin_dt(self, v: datetime.datetime) -> str:
|
|
452
|
+
return json_datetime_encoder(v)
|
|
453
|
+
|
|
454
|
+
@pdt.field_serializer("end_dt", mode="plain")
|
|
455
|
+
def serialize_end_dt(self, v: datetime.datetime) -> str:
|
|
456
|
+
return json_datetime_encoder(v)
|
|
457
|
+
|
|
458
|
+
return ModelMixin
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
def make_tag_record_model_mixin() -> type[pdt.BaseModel]:
|
|
462
|
+
class ModelMixin(pdt.BaseModel):
|
|
463
|
+
target_sqn: int = Field(
|
|
464
|
+
sa_column=sa.Column(sa_sqlite.INTEGER, nullable=False),
|
|
465
|
+
description="Sequence number of the tag record's target",
|
|
466
|
+
)
|
|
467
|
+
begin_dt: datetime.datetime = Field(
|
|
468
|
+
sa_column=sa.Column(SQLiteDateTime, nullable=False),
|
|
469
|
+
description="Begin datetime of the tag record",
|
|
470
|
+
)
|
|
471
|
+
end_dt: datetime.datetime = Field(
|
|
472
|
+
sa_column=sa.Column(SQLiteDateTime, nullable=False),
|
|
473
|
+
description="End datetime of the tag record",
|
|
474
|
+
)
|
|
475
|
+
tagset_namespace: str | None = Field(
|
|
476
|
+
sa_column=sa.Column(sa_sqlite.VARCHAR(64), nullable=True),
|
|
477
|
+
default=None,
|
|
478
|
+
description="Namespace of the tagset that the tag belongs to",
|
|
479
|
+
)
|
|
480
|
+
tagset_version: str | None = Field(
|
|
481
|
+
sa_column=sa.Column(sa_sqlite.VARCHAR(32), nullable=True),
|
|
482
|
+
default=None,
|
|
483
|
+
description="Version of the tagset that the tag belongs to",
|
|
484
|
+
)
|
|
485
|
+
tag: str = Field(
|
|
486
|
+
sa_column=sa.Column(sa_sqlite.VARCHAR(256), nullable=False),
|
|
487
|
+
description="Tag name",
|
|
488
|
+
)
|
|
489
|
+
props: JsonType | None = Field(
|
|
490
|
+
sa_column=sa.Column(sa_sqlite.JSON, nullable=True),
|
|
491
|
+
default=None,
|
|
492
|
+
description="Additional properties of the tag record in JSON format",
|
|
493
|
+
)
|
|
494
|
+
flags: int = Field(
|
|
495
|
+
sa_column=sa.Column(sa_sqlite.INTEGER),
|
|
496
|
+
default=0,
|
|
497
|
+
description="Integer bitmask storing status or metadata flags for this tag record",
|
|
498
|
+
)
|
|
458
499
|
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
500
|
+
@pdt.field_validator("begin_dt", mode="after")
|
|
501
|
+
@classmethod
|
|
502
|
+
def validate_begin_dt(cls, v: datetime.datetime) -> datetime.datetime:
|
|
503
|
+
validate_dt_timezone(v)
|
|
504
|
+
return v
|
|
505
|
+
|
|
506
|
+
@pdt.field_validator("end_dt", mode="after")
|
|
507
|
+
@classmethod
|
|
508
|
+
def validate_end_dt(cls, v: datetime.datetime) -> datetime.datetime:
|
|
509
|
+
validate_dt_timezone(v)
|
|
510
|
+
return v
|
|
511
|
+
|
|
512
|
+
@pdt.field_validator("tagset_namespace", mode="after")
|
|
513
|
+
@classmethod
|
|
514
|
+
def validate_tagset_namespace(cls, v: str | None) -> str | None:
|
|
515
|
+
if v is not None:
|
|
516
|
+
validate_snake_case(v)
|
|
517
|
+
return v
|
|
518
|
+
|
|
519
|
+
@pdt.field_validator("tagset_version", mode="after")
|
|
520
|
+
@classmethod
|
|
521
|
+
def validate_tagset_version(cls, v: str | None) -> str | None:
|
|
522
|
+
if v is not None:
|
|
523
|
+
validate_semver(v)
|
|
524
|
+
return v
|
|
525
|
+
|
|
526
|
+
@pdt.model_validator(mode="after")
|
|
527
|
+
def validate_begin_dt_end_dt(self) -> Self:
|
|
528
|
+
if self.begin_dt > self.end_dt:
|
|
529
|
+
raise ValueError(f"begin_dt '{self.begin_dt}' is greater than end_dt '{self.end_dt}'")
|
|
530
|
+
return self
|
|
531
|
+
|
|
532
|
+
@pdt.field_validator("tag", mode="after")
|
|
533
|
+
@classmethod
|
|
534
|
+
def validate_tag(cls, v: str) -> str:
|
|
535
|
+
validate_colon_tag(v)
|
|
536
|
+
return v
|
|
537
|
+
|
|
538
|
+
@pdt.field_serializer("begin_dt", mode="plain")
|
|
539
|
+
def serialize_begin_dt(self, v: datetime.datetime) -> str:
|
|
540
|
+
return json_datetime_encoder(v)
|
|
541
|
+
|
|
542
|
+
@pdt.field_serializer("end_dt", mode="plain")
|
|
543
|
+
def serialize_end_dt(self, v: datetime.datetime) -> str:
|
|
544
|
+
return json_datetime_encoder(v)
|
|
545
|
+
|
|
546
|
+
return ModelMixin
|
|
496
547
|
|
|
497
|
-
@pdt.field_validator("begin_dt", mode="after")
|
|
498
|
-
@classmethod
|
|
499
|
-
def validate_begin_dt(cls, v: datetime.datetime) -> datetime.datetime:
|
|
500
|
-
validate_dt_timezone(v)
|
|
501
|
-
return v
|
|
502
|
-
|
|
503
|
-
@pdt.field_validator("end_dt", mode="after")
|
|
504
|
-
@classmethod
|
|
505
|
-
def validate_end_dt(cls, v: datetime.datetime) -> datetime.datetime:
|
|
506
|
-
validate_dt_timezone(v)
|
|
507
|
-
return v
|
|
508
|
-
|
|
509
|
-
@pdt.field_validator("tagset_namespace", mode="after")
|
|
510
|
-
@classmethod
|
|
511
|
-
def validate_tagset_namespace(cls, v: str | None) -> str | None:
|
|
512
|
-
if v is not None:
|
|
513
|
-
validate_snake_case(v)
|
|
514
|
-
return v
|
|
515
548
|
|
|
516
|
-
|
|
517
|
-
@classmethod
|
|
518
|
-
def validate_tagset_version(cls, v: str | None) -> str | None:
|
|
519
|
-
if v is not None:
|
|
520
|
-
validate_semver(v)
|
|
521
|
-
return v
|
|
549
|
+
BaseModel = make_base_model()
|
|
522
550
|
|
|
523
|
-
@pdt.model_validator(mode="after")
|
|
524
|
-
def validate_begin_dt_end_dt(self) -> Self:
|
|
525
|
-
if self.begin_dt > self.end_dt:
|
|
526
|
-
raise ValueError(f"begin_dt '{self.begin_dt}' is greater than end_dt '{self.end_dt}'")
|
|
527
|
-
return self
|
|
528
551
|
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
def validate_tag(cls, v: str) -> str:
|
|
532
|
-
validate_colon_tag(v)
|
|
533
|
-
return v
|
|
552
|
+
class TagTarget(BaseModel, make_tag_target_model_mixin()):
|
|
553
|
+
pass
|
|
534
554
|
|
|
535
|
-
@pdt.field_serializer("begin_dt", mode="plain")
|
|
536
|
-
def serialize_begin_dt(self, v: datetime.datetime) -> str:
|
|
537
|
-
return json_datetime_encoder(v)
|
|
538
555
|
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
return json_datetime_encoder(v)
|
|
556
|
+
class TagRecord(BaseModel, make_tag_record_model_mixin()):
|
|
557
|
+
pass
|
|
542
558
|
|
|
543
559
|
|
|
544
560
|
class TagTargetTable(TagTarget, make_sequence_model_mixin("sqlite"), table=True):
|
|
545
|
-
__tablename__ = "
|
|
561
|
+
__tablename__ = "tag_target"
|
|
546
562
|
|
|
547
563
|
|
|
548
564
|
class TagRecordTable(TagRecord, make_sequence_model_mixin("sqlite"), table=True):
|
|
@@ -550,7 +566,7 @@ class TagRecordTable(TagRecord, make_sequence_model_mixin("sqlite"), table=True)
|
|
|
550
566
|
|
|
551
567
|
|
|
552
568
|
if typing.TYPE_CHECKING:
|
|
553
|
-
class
|
|
569
|
+
class TagTarget(BaseModel):
|
|
554
570
|
identifier: sa_orm.Mapped[str] = ...
|
|
555
571
|
tagger_name: sa_orm.Mapped[str] = ...
|
|
556
572
|
tagger_version: sa_orm.Mapped[str] = ...
|
|
@@ -559,7 +575,11 @@ if typing.TYPE_CHECKING:
|
|
|
559
575
|
end_dt: sa_orm.Mapped[datetime.datetime] = ...
|
|
560
576
|
|
|
561
577
|
|
|
562
|
-
class
|
|
578
|
+
class TagTargetTable(TagTarget, SequenceModelMixinProtocol):
|
|
579
|
+
pass
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
class TagRecord(BaseModel):
|
|
563
583
|
target_sqn: sa_orm.Mapped[int] = ...
|
|
564
584
|
begin_dt: sa_orm.Mapped[datetime.datetime] = ...
|
|
565
585
|
end_dt: sa_orm.Mapped[datetime.datetime] = ...
|
|
@@ -570,6 +590,10 @@ if typing.TYPE_CHECKING:
|
|
|
570
590
|
flags: sa_orm.Mapped[int] = ...
|
|
571
591
|
|
|
572
592
|
|
|
593
|
+
class TagRecordTable(TagRecord, SequenceModelMixinProtocol):
|
|
594
|
+
pass
|
|
595
|
+
|
|
596
|
+
|
|
573
597
|
@singleton
|
|
574
598
|
def tag_cache_file_path() -> pathlib.Path:
|
|
575
599
|
return pathlib.Path.home() / ".local" / "plexus" / "tag_cache" / f"{randomizer().random_alphanumeric(7)}.db"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/pathutils/0-dummy
RENAMED
|
File without changes
|
{plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/pathutils/1-dummy
RENAMED
|
File without changes
|
{plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/pathutils/2-dummy
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/resources/unittest/pathutils/dummy.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/carto/OSMFile.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/carto/OSMNode.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/carto/OSMTags.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/carto/OSMWay.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/carto/__init__.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/resources/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/utils/__init__.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/utils/apiutils.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/utils/bagutils.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/utils/config.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/utils/datautils.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/utils/dockerutils.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/utils/gisutils.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/utils/jsonutils.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/utils/pathutils.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/utils/s3utils.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/utils/sqlutils.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/utils/strutils.py
RENAMED
|
File without changes
|
{plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/src/plexus/common/utils/testutils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{plexus_python_common-1.0.66 → plexus_python_common-1.0.67}/test/plexus_tests/common/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|