ramifice 0.8.46__py3-none-any.whl → 0.8.47__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 +0 -2
- {ramifice-0.8.46.dist-info → ramifice-0.8.47.dist-info}/METADATA +18 -15
- {ramifice-0.8.46.dist-info → ramifice-0.8.47.dist-info}/RECORD +5 -5
- {ramifice-0.8.46.dist-info → ramifice-0.8.47.dist-info}/WHEEL +0 -0
- {ramifice-0.8.46.dist-info → ramifice-0.8.47.dist-info}/licenses/LICENSE +0 -0
ramifice/utils/tools.py
CHANGED
@@ -13,7 +13,6 @@ __all__ = (
|
|
13
13
|
"is_phone",
|
14
14
|
"is_mongo_id",
|
15
15
|
"hash_to_obj_id",
|
16
|
-
"is_number",
|
17
16
|
)
|
18
17
|
|
19
18
|
import ipaddress
|
@@ -25,7 +24,6 @@ from urllib.parse import urlparse
|
|
25
24
|
import phonenumbers
|
26
25
|
from bson.objectid import ObjectId
|
27
26
|
from email_validator import EmailNotValidError, validate_email
|
28
|
-
from xloft.itis import is_number
|
29
27
|
|
30
28
|
from ramifice.utils.constants import REGEX
|
31
29
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ramifice
|
3
|
-
Version: 0.8.
|
3
|
+
Version: 0.8.47
|
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/
|
@@ -331,9 +331,9 @@ class User:
|
|
331
331
|
)
|
332
332
|
```
|
333
333
|
|
334
|
-
## Class
|
334
|
+
## Class Methods
|
335
335
|
|
336
|
-
|
336
|
+
_Examples of frequently used methods:_
|
337
337
|
|
338
338
|
```python
|
339
339
|
# Gets an estimate of the count of documents in a collection using collection metadata.
|
@@ -452,9 +452,9 @@ unit = Unit(
|
|
452
452
|
await User.unit_manager(unit)
|
453
453
|
```
|
454
454
|
|
455
|
-
## Instance
|
455
|
+
## Instance Methods
|
456
456
|
|
457
|
-
|
457
|
+
_Examples of frequently used methods:_
|
458
458
|
|
459
459
|
```python
|
460
460
|
# Check data validity.
|
@@ -488,7 +488,8 @@ await user.update_password( # + verify_password
|
|
488
488
|
## General auxiliary methods
|
489
489
|
|
490
490
|
```python
|
491
|
-
from
|
491
|
+
from xloft.converters import to_human_size
|
492
|
+
from xloft.itis import is_number
|
492
493
|
from ramifice.utils.tools import (
|
493
494
|
get_file_size,
|
494
495
|
hash_to_obj_id,
|
@@ -500,9 +501,17 @@ from ramifice.utils.tools import (
|
|
500
501
|
is_phone,
|
501
502
|
is_url,
|
502
503
|
normal_email,
|
503
|
-
is_number,
|
504
504
|
)
|
505
505
|
|
506
|
+
|
507
|
+
# Convert the number of bytes into a human-readable format.
|
508
|
+
size: str = to_human_size(2097152)
|
509
|
+
print(size) # => 2 MB
|
510
|
+
|
511
|
+
# Check if a string is a number.
|
512
|
+
if is_number("5"):
|
513
|
+
...
|
514
|
+
|
506
515
|
# Validate Password.
|
507
516
|
if is_password("12345678"):
|
508
517
|
...
|
@@ -540,16 +549,10 @@ if is_mongo_id("666f6f2d6261722d71757578"):
|
|
540
549
|
from bson.objectid import ObjectId
|
541
550
|
_id: ObjectId | None = hash_to_obj_id("666f6f2d6261722d71757578")
|
542
551
|
|
543
|
-
# Convert the number of bytes into a human-readable format.
|
544
|
-
size: str = to_human_size(2097152) # => 2 MB
|
545
|
-
|
546
552
|
# Get file size in bytes.
|
547
553
|
path = "public/media/default/no_doc.odt"
|
548
|
-
size: int = get_file_size(path)
|
549
|
-
|
550
|
-
# Check if a string is a number.
|
551
|
-
if is_number("5"):
|
552
|
-
...
|
554
|
+
size: int = get_file_size(path)
|
555
|
+
print(size) # => 9843
|
553
556
|
```
|
554
557
|
|
555
558
|
## 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=
|
77
|
+
ramifice/utils/tools.py,sha256=WOazw24pvL96-0yNBy7YRGErN3vAQ4F6GS9TLvWFqrs,2747
|
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.
|
81
|
-
ramifice-0.8.
|
82
|
-
ramifice-0.8.
|
83
|
-
ramifice-0.8.
|
80
|
+
ramifice-0.8.47.dist-info/METADATA,sha256=i_tQHS-uk__X8bzAXfv_1BVBNA6KkNZaw5h7hXxvX7A,19048
|
81
|
+
ramifice-0.8.47.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
82
|
+
ramifice-0.8.47.dist-info/licenses/LICENSE,sha256=LrEL0aTZx90HDwFUQCJutORiDjJL9AnuVvCtspXIqt4,1095
|
83
|
+
ramifice-0.8.47.dist-info/RECORD,,
|
File without changes
|
File without changes
|