sysnet-pyutils 1.3.2__py3-none-any.whl → 1.3.4__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.
@@ -19,3 +19,6 @@ CONFIG_USERNAME = 'user'
19
19
  CONFIG_PASSWORD = 'password'
20
20
  CONFIG_REPID = 'repid'
21
21
  CONFIG_URL = 'url'
22
+ CONFIG_KEY = 'key'
23
+
24
+ CONFIG_CRZP = 'crzp'
@@ -1,12 +1,11 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import json
4
- import pprint
5
4
  from datetime import datetime
6
5
  from enum import Enum
7
- from typing import Optional, List, Tuple, Any, ClassVar, Dict
6
+ from typing import Optional, List, Tuple, Any
8
7
 
9
- from pydantic import BaseModel, Field, EmailStr, StrictStr, StrictBool
8
+ from pydantic import BaseModel, Field, EmailStr
10
9
  from typing_extensions import Self
11
10
 
12
11
  from sysnet_pyutils.utils import local_now, is_valid_unid, is_valid_pid, is_valid_uuid
@@ -153,14 +152,14 @@ class AclType(BaseModel):
153
152
  class MetadataEssentialType(BaseModel):
154
153
  """
155
154
  Hlavní metadata
156
- """ # noqa: E501
157
- identifier: Optional[StrictStr] = Field(default=None, description="identifikátor uuid")
155
+ """
156
+ identifier: Optional[str] = Field(default=None, description="identifikátor uuid")
158
157
  date_created: Optional[datetime] = Field(default=None, description="Datum a čas")
159
158
  date_modified: Optional[datetime] = Field(default=None, description="Datum a čas")
160
159
  date_deleted: Optional[datetime] = Field(default=None, description="Datum a čas")
161
- deleted: Optional[StrictBool] = Field(default=False, description="Dokument byl odstraněn")
162
- valid: Optional[StrictBool] = Field(default=True, description="Dokument je platný/neplatný")
163
- duplicates: Optional[StrictStr] = Field(default=None, description="Dokument je duplicitní k jinému dokumentu s daným identifikátorem")
160
+ deleted: Optional[bool] = Field(default=None, description="Dokument byl odstraněn")
161
+ valid: Optional[bool] = Field(default=None, description="Dokument je platný/neplatný")
162
+ duplicates: Optional[str] = Field(default=None, description="Dokument je duplicitní k jinému dokumentu s daným identifikátorem")
164
163
 
165
164
 
166
165
 
@@ -339,152 +338,15 @@ class WorkflowType(BaseModel):
339
338
  class PhoneNumberType(BaseModel):
340
339
  """
341
340
  Telefonní číslo
342
- """ # noqa: E501
343
- name: Optional[StrictStr] = Field(default=None, description="Název telefonního čísla (mobil, práce, domů)")
344
- prefix: Optional[StrictStr] = Field(default=None, description="Národní prefix")
345
- number: Optional[StrictStr] = Field(default=None, description="Vlastní telefonní číslo")
346
- __properties: ClassVar[List[str]] = ["name", "prefix", "number"]
347
-
348
- model_config = {
349
- "populate_by_name": True,
350
- "validate_assignment": True,
351
- "protected_namespaces": (),
352
- }
353
-
354
-
355
- def to_str(self) -> str:
356
- """Returns the string representation of the model using alias"""
357
- return pprint.pformat(self.model_dump(by_alias=True))
358
-
359
- def to_json(self) -> str:
360
- """Returns the JSON representation of the model using alias"""
361
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
362
- return json.dumps(self.to_dict())
363
-
364
- @classmethod
365
- def from_json(cls, json_str: str) -> Self:
366
- """Create an instance of PhoneNumberType from a JSON string"""
367
- return cls.from_dict(json.loads(json_str))
368
-
369
- def to_dict(self) -> Dict[str, Any]:
370
- """Return the dictionary representation of the model using alias.
371
-
372
- This has the following differences from calling pydantic's
373
- `self.model_dump(by_alias=True)`:
374
-
375
- * `None` is only added to the output dict for nullable fields that
376
- were set at model initialization. Other fields with value `None`
377
- are ignored.
378
- """
379
- _dict = self.model_dump(
380
- by_alias=True,
381
- exclude={
382
- },
383
- exclude_none=True,
384
- )
385
- # set to None if name (nullable) is None
386
- # and model_fields_set contains the field
387
- if self.name is None and "name" in self.model_fields_set:
388
- _dict['name'] = None
389
-
390
- # set to None if prefix (nullable) is None
391
- # and model_fields_set contains the field
392
- if self.prefix is None and "prefix" in self.model_fields_set:
393
- _dict['prefix'] = None
394
-
395
- # set to None if number (nullable) is None
396
- # and model_fields_set contains the field
397
- if self.number is None and "number" in self.model_fields_set:
398
- _dict['number'] = None
399
-
400
- return _dict
401
-
402
- @classmethod
403
- def from_dict(cls, obj: Dict) -> Self:
404
- """Create an instance of PhoneNumberType from a dict"""
405
- if obj is None:
406
- return None
407
-
408
- if not isinstance(obj, dict):
409
- return cls.model_validate(obj)
410
-
411
- _obj = cls.model_validate({
412
- "name": obj.get("name"),
413
- "prefix": obj.get("prefix"),
414
- "number": obj.get("number")
415
- })
416
- return _obj
341
+ """
342
+ name: Optional[str] = Field(default=None, description="Název telefonního čísla (mobil, práce, domů)")
343
+ prefix: Optional[str] = Field(default=None, description="Národní prefix")
344
+ number: Optional[str] = Field(default=None, description="Vlastní telefonní číslo")
417
345
 
418
346
 
419
347
  class MailAddressType(BaseModel):
420
348
  """
421
349
  Adresa elektronické pošty
422
- """ # noqa: E501
423
- name: Optional[StrictStr] = Field(default=None, description="Název adresa elektronické pošty (práce, domů)")
424
- email: Optional[StrictStr] = Field(default=None, description="Adresa elektronické pošty")
425
- __properties: ClassVar[List[str]] = ["name", "email"]
426
-
427
- model_config = {
428
- "populate_by_name": True,
429
- "validate_assignment": True,
430
- "protected_namespaces": (),
431
- }
432
-
433
-
434
- def to_str(self) -> str:
435
- """Returns the string representation of the model using alias"""
436
- return pprint.pformat(self.model_dump(by_alias=True))
437
-
438
- def to_json(self) -> str:
439
- """Returns the JSON representation of the model using alias"""
440
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
441
- return json.dumps(self.to_dict())
442
-
443
- @classmethod
444
- def from_json(cls, json_str: str) -> Self:
445
- """Create an instance of MailAddressType from a JSON string"""
446
- return cls.from_dict(json.loads(json_str))
447
-
448
- def to_dict(self) -> Dict[str, Any]:
449
- """Return the dictionary representation of the model using alias.
450
-
451
- This has the following differences from calling pydantic's
452
- `self.model_dump(by_alias=True)`:
453
-
454
- * `None` is only added to the output dict for nullable fields that
455
- were set at model initialization. Other fields with value `None`
456
- are ignored.
457
- """
458
- _dict = self.model_dump(
459
- by_alias=True,
460
- exclude={
461
- },
462
- exclude_none=True,
463
- )
464
- # set to None if name (nullable) is None
465
- # and model_fields_set contains the field
466
- if self.name is None and "name" in self.model_fields_set:
467
- _dict['name'] = None
468
-
469
- # set to None if email (nullable) is None
470
- # and model_fields_set contains the field
471
- if self.email is None and "email" in self.model_fields_set:
472
- _dict['email'] = None
473
-
474
- return _dict
475
-
476
- @classmethod
477
- def from_dict(cls, obj: Dict) -> Self:
478
- """Create an instance of MailAddressType from a dict"""
479
- if obj is None:
480
- return None
481
-
482
- if not isinstance(obj, dict):
483
- return cls.model_validate(obj)
484
-
485
- _obj = cls.model_validate({
486
- "name": obj.get("name"),
487
- "email": obj.get("email")
488
- })
489
- return _obj
490
-
350
+ """
351
+ name: Optional[str] = Field(default=None, description="Název adresa elektronické pošty (práce, domů)")
352
+ email: Optional[str] = Field(default=None, description="Adresa elektronické pošty")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sysnet-pyutils
3
- Version: 1.3.2
3
+ Version: 1.3.4
4
4
  Summary: Python Utilities
5
5
  Author-email: Data Developer <info@sysnet.cz>
6
6
  Project-URL: Homepage, https://github.com/SYSNET-CZ/pyutils
@@ -1,6 +1,6 @@
1
1
  sysnet_pyutils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  sysnet_pyutils/barcode.py,sha256=5dM1ISvVVP966JQxGiZBUYJoPx_jgzWEpEQ2uIOxTd4,2622
3
- sysnet_pyutils/constants.py,sha256=-58sU5gaIbRwP_WBJdRcdWFRb9saVRy8GG7nAYk5acI,591
3
+ sysnet_pyutils/constants.py,sha256=xh-StyDfKiWZC7utU_ckpNczQvNaXqw9UEBDPWKza7M,632
4
4
  sysnet_pyutils/data_utils.py,sha256=1OV89carnQCQgB7wahTEsfg-jR6bQcsz0-NKiiSlk00,11283
5
5
  sysnet_pyutils/domino.py,sha256=dGmg9d1PMPOyA_ysXBHVu_zabKGCJEuno3Yw3DexExQ,2671
6
6
  sysnet_pyutils/geo.py,sha256=smAkRfobvKqjr3_UIjU5huDbnkb3_edD_xmv4R0r5Q0,2938
@@ -10,9 +10,9 @@ sysnet_pyutils/ses.py,sha256=WJzs0y2QnF4XGDGjls_W0p0v6DJ4fZ4_97m3XbzpaFw,2713
10
10
  sysnet_pyutils/tools.py,sha256=ZioHvUIufrhuJyZLdPnuMUD8Li5LTljSMSCxqRnKIi4,377
11
11
  sysnet_pyutils/utils.py,sha256=FVUTCQRoPf-nTtqsVnlyFG6vsJsBHYr8jMDfG-A6tfM,25776
12
12
  sysnet_pyutils/models/__init__.py,sha256=oozOr_DKhenkM9BDaPOmtbLXhP5vtMUCjBPEjZDW4GQ,167
13
- sysnet_pyutils/models/general.py,sha256=6AE5RfLmvW4oq7V6Iqpbq7l-Lsqt2Kkh7yLaXu58fRc,23386
14
- sysnet_pyutils-1.3.2.dist-info/licenses/LICENSE,sha256=bx5iLIKjgAdYQ7sISn7DsfHRKkoCUm1154sJJKhgqnU,35184
15
- sysnet_pyutils-1.3.2.dist-info/METADATA,sha256=nX5pyUDi4bQC4eBA9XlS6SdiAQaOEyj7mH_bLyvVio0,16004
16
- sysnet_pyutils-1.3.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
- sysnet_pyutils-1.3.2.dist-info/top_level.txt,sha256=ZKTltQWbLlWBXw4oovo1w7ui-JQ1WoyECqMSWdBj6XE,15
18
- sysnet_pyutils-1.3.2.dist-info/RECORD,,
13
+ sysnet_pyutils/models/general.py,sha256=PbQwBHkizSFBsBeEYo5JUcBQGWqkpR0Vy6t2P-VBphk,18665
14
+ sysnet_pyutils-1.3.4.dist-info/licenses/LICENSE,sha256=bx5iLIKjgAdYQ7sISn7DsfHRKkoCUm1154sJJKhgqnU,35184
15
+ sysnet_pyutils-1.3.4.dist-info/METADATA,sha256=h94AeicoesdCaRetStdahy786roVqii2GzW-2JH22lc,16004
16
+ sysnet_pyutils-1.3.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
+ sysnet_pyutils-1.3.4.dist-info/top_level.txt,sha256=ZKTltQWbLlWBXw4oovo1w7ui-JQ1WoyECqMSWdBj6XE,15
18
+ sysnet_pyutils-1.3.4.dist-info/RECORD,,