ramifice 0.8.45__py3-none-any.whl → 0.8.46__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.
ramifice/utils/tools.py CHANGED
@@ -13,6 +13,7 @@ __all__ = (
13
13
  "is_phone",
14
14
  "is_mongo_id",
15
15
  "hash_to_obj_id",
16
+ "is_number",
16
17
  )
17
18
 
18
19
  import ipaddress
@@ -24,6 +25,7 @@ from urllib.parse import urlparse
24
25
  import phonenumbers
25
26
  from bson.objectid import ObjectId
26
27
  from email_validator import EmailNotValidError, validate_email
28
+ from xloft.itis import is_number
27
29
 
28
30
  from ramifice.utils.constants import REGEX
29
31
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ramifice
3
- Version: 0.8.45
3
+ Version: 0.8.46
4
4
  Summary: ORM-pseudo-like API MongoDB for Python language.
5
5
  Project-URL: Homepage, https://github.com/kebasyaty/ramifice
6
6
  Project-URL: Documentation, https://kebasyaty.github.io/ramifice/
@@ -500,6 +500,7 @@ from ramifice.utils.tools import (
500
500
  is_phone,
501
501
  is_url,
502
502
  normal_email,
503
+ is_number,
503
504
  )
504
505
 
505
506
  # Validate Password.
@@ -539,12 +540,16 @@ if is_mongo_id("666f6f2d6261722d71757578"):
539
540
  from bson.objectid import ObjectId
540
541
  _id: ObjectId | None = hash_to_obj_id("666f6f2d6261722d71757578")
541
542
 
542
- # Convert number of bytes to readable format.
543
+ # Convert the number of bytes into a human-readable format.
543
544
  size: str = to_human_size(2097152) # => 2 MB
544
545
 
545
546
  # Get file size in bytes.
546
547
  path = "public/media/default/no_doc.odt"
547
548
  size: int = get_file_size(path) # => 9843
549
+
550
+ # Check if a string is a number.
551
+ if is_number("5"):
552
+ ...
548
553
  ```
549
554
 
550
555
  ## Changelog
@@ -74,10 +74,10 @@ ramifice/utils/errors.py,sha256=n2Fs7qZHP3w7t8Kyb1uRnNHLjuDhjD37iZe60-UM70s,2846
74
74
  ramifice/utils/fixtures.py,sha256=nkrnkIEPeuswouY-cuve7uBh8-kc_J9T167UI_ZZcOQ,3496
75
75
  ramifice/utils/migration.py,sha256=0yL9LwWqTentY_G57QLqQ1lOxzxqBPUvrpQNEyAjlyA,11422
76
76
  ramifice/utils/mixins.py,sha256=5G3x8hK3igM7JBgCiCnVDdb_0K_D1gV1tw0QKpDlm-A,1161
77
- ramifice/utils/tools.py,sha256=WOazw24pvL96-0yNBy7YRGErN3vAQ4F6GS9TLvWFqrs,2747
77
+ ramifice/utils/tools.py,sha256=EiiTH-PNKu7wSw6q_4pAc6yF6JA7p4f_U0MVuveBrN4,2799
78
78
  ramifice/utils/translations.py,sha256=YItvCWv-13FS2x8VYsAOH-Nx_qQOitOX7-bRGX3mc3A,4718
79
79
  ramifice/utils/unit.py,sha256=zHfvkyEU4sxHOc-QMuntEcvyfQqH75AK1zx8E25kM9Y,2535
80
- ramifice-0.8.45.dist-info/METADATA,sha256=BP_QaIlwdovrMtKs_69atBK6TLuwhZxE6WWK4pMM9AY,18899
81
- ramifice-0.8.45.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
82
- ramifice-0.8.45.dist-info/licenses/LICENSE,sha256=LrEL0aTZx90HDwFUQCJutORiDjJL9AnuVvCtspXIqt4,1095
83
- ramifice-0.8.45.dist-info/RECORD,,
80
+ ramifice-0.8.46.dist-info/METADATA,sha256=MbBc16MhOYA17BhO5VJQnUse5iYVq60s1S1sxJlzy3g,18989
81
+ ramifice-0.8.46.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
82
+ ramifice-0.8.46.dist-info/licenses/LICENSE,sha256=LrEL0aTZx90HDwFUQCJutORiDjJL9AnuVvCtspXIqt4,1095
83
+ ramifice-0.8.46.dist-info/RECORD,,