ramifice 0.8.34__py3-none-any.whl → 0.8.37__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/__init__.py CHANGED
@@ -35,7 +35,7 @@ __all__ = (
35
35
  import logging
36
36
 
37
37
  from xloft import NamedTuple
38
- from xloft.humanism import to_human_size
38
+ from xloft.human import to_human_size
39
39
 
40
40
  from ramifice.models.decorator import model
41
41
  from ramifice.utils import translations
@@ -9,7 +9,7 @@ __all__ = ("FileGroupMixin",)
9
9
 
10
10
  from typing import Any
11
11
 
12
- from xloft.humanism import to_human_size
12
+ from xloft.human import to_human_size
13
13
 
14
14
  from ramifice.paladins.tools import (
15
15
  accumulate_error,
@@ -11,7 +11,7 @@ from asyncio import to_thread
11
11
  from typing import Any
12
12
 
13
13
  from PIL import Image
14
- from xloft.humanism import to_human_size
14
+ from xloft.human import to_human_size
15
15
 
16
16
  from ramifice.paladins.tools import accumulate_error, panic_type_error
17
17
  from ramifice.utils import translations
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ramifice
3
- Version: 0.8.34
3
+ Version: 0.8.37
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/
@@ -250,15 +250,6 @@ async def main():
250
250
  else:
251
251
  print("No User!")
252
252
 
253
- # Remove User.
254
- # (if necessary)
255
- # await user.delete()
256
- # await user.delete(remove_files=False)
257
-
258
- # Remove collection.
259
- # (if necessary)
260
- # await User.collection().drop()
261
-
262
253
  # Close connection.
263
254
  await client.close()
264
255
 
@@ -267,65 +258,8 @@ if __name__ == "__main__":
267
258
  asyncio.run(main())
268
259
  ```
269
260
 
270
- ### How to create custom translations ?
271
-
272
- ```python
273
- from ramifice import translations
274
-
275
- translations.add_languages(
276
- default_locale="en", # For Ramifice by default = "en"
277
- languages=frozenset(("en", "ru")), # For Ramifice by default = ["en", "ru"]
278
- )
279
- ```
280
-
281
- ```shell
282
- cd project_name
283
- # Add your custom translations:
284
- uv run pybabel extract -o config/translations/custom.pot src
285
- uv run pybabel init -i config/translations/custom.pot -d config/translations/custom -l en
286
- uv run pybabel init -i config/translations/custom.pot -d config/translations/custom -l ru
287
- ...
288
- # Hint: Do not forget to add translations for new languages.
289
- uv run pybabel compile -d config/translations/custom
290
-
291
- # Update your custom translations:
292
- uv run pybabel extract -o config/translations/custom.pot src
293
- uv run pybabel update -i config/translations/custom.pot -d config/translations/custom
294
- # Hint: Do not forget to check the translations for existing languages.
295
- uv run pybabel compile -d config/translations/custom
296
- ```
297
-
298
- ### How to add new languages ​​to Ramifice ?
299
-
300
- ```python
301
- from ramifice import translations
302
-
303
- translations.add_languages(
304
- default_locale="en", # For Ramifice by default = "en"
305
- languages=frozenset(("en", "ru", "de", "de_ch")), # For Ramifice by default = ["en", "ru"]
306
- )
307
- ```
308
-
309
- ```shell
310
- cd project_name
311
- # Example:
312
- uv run pybabel init -i config/translations/ramifice.pot -d config/translations/ramifice -l de
313
- uv run pybabel init -i config/translations/ramifice.pot -d config/translations/ramifice -l de_ch
314
- ...
315
- # Hint: Do not forget to add translations for new languages.
316
- uv run pybabel compile -d config/translations/ramifice
317
-
318
- # Update translations to Ramifice:
319
- uv run pybabel extract -o config/translations/ramifice.pot ramifice
320
- uv run pybabel update -i config/translations/ramifice.pot -d config/translations/ramifice
321
- # Hint: Do not forget to check the translations for existing languages.
322
- uv run pybabel compile -d config/translations/ramifice
323
- ```
324
-
325
261
  ## Model Parameters
326
262
 
327
- [See the documentation here.](https://kebasyaty.github.io/ramifice/ "See the documentation here.")
328
-
329
263
  ( only `service_name` is a required parameter )
330
264
 
331
265
  <div>
@@ -554,6 +488,7 @@ await user.update_password( # + verify_password
554
488
  ## General auxiliary methods
555
489
 
556
490
  ```python
491
+ from ramifice import to_human_size
557
492
  from ramifice.utils.tools import (
558
493
  get_file_size,
559
494
  hash_to_obj_id,
@@ -565,7 +500,6 @@ from ramifice.utils.tools import (
565
500
  is_phone,
566
501
  is_url,
567
502
  normal_email,
568
- to_human_size,
569
503
  )
570
504
 
571
505
  # Validate Password.
@@ -606,7 +540,7 @@ from bson.objectid import ObjectId
606
540
  _id: ObjectId | None = hash_to_obj_id("666f6f2d6261722d71757578")
607
541
 
608
542
  # Convert number of bytes to readable format.
609
- size: str = to_human_size(2097152) # => 2.0 MB
543
+ size: str = to_human_size(2097152) # => 2 MB
610
544
 
611
545
  # Get file size in bytes.
612
546
  path = "public/media/default/no_doc.odt"
@@ -1,4 +1,4 @@
1
- ramifice/__init__.py,sha256=VWqmauH79bM0bPlbHJURZKwcOHJSEf97tpHpz5l7A8c,1622
1
+ ramifice/__init__.py,sha256=Ms9drE4wSvoUyzAtAa-VRykD7ufz6L_GtHx-YQRePDI,1619
2
2
  ramifice/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  ramifice/commons/__init__.py,sha256=RR_cVDF0H8xa56q2PXGKUSmYOPF-AUNKRY9u7DHD_KU,583
4
4
  ramifice/commons/general.py,sha256=zaWBzSLEaUC6Jl3uXwVKlteaGmh1Y3m1TKbRQ9YpNw0,5471
@@ -61,9 +61,9 @@ ramifice/paladins/groups/__init__.py,sha256=MmScWKa2cfEfowr2fUxH41VIVOkOpgz5ELTd
61
61
  ramifice/paladins/groups/bool_group.py,sha256=yHdjC1MknQCQ-PssQRkxhQObE7U6XjlBTk40sa54a3M,879
62
62
  ramifice/paladins/groups/choice_group.py,sha256=PRuxCkDrWtoCyEhCn-WTPjub7RfoWEdSHJRyza3Nsc8,1886
63
63
  ramifice/paladins/groups/date_group.py,sha256=Y2fFEX2elmE5QphDEOf-xhvmR6ryR34S9tSBpMspZY4,3846
64
- ramifice/paladins/groups/file_group.py,sha256=2bjTiyOIb92VhHTlhhRbJv5sdZvcaCNzXoZifmJZdLU,3028
64
+ ramifice/paladins/groups/file_group.py,sha256=8TI0CozyLar-uEQX7STxmrm3fqYDieQMyquydbyx-I4,3025
65
65
  ramifice/paladins/groups/id_group.py,sha256=PnWfH1LkpduMxU9Qpm6XhC1zeKb_KQNgGAFSASQm9q0,1359
66
- ramifice/paladins/groups/img_group.py,sha256=zy_X0uWkCwTR_3E1yMh7W970cuHfMDbfQQkYcWfI62g,6182
66
+ ramifice/paladins/groups/img_group.py,sha256=CygCrv-hzzFzmvI2U-CnuluB70oGIs05QYFHjr_GO8g,6179
67
67
  ramifice/paladins/groups/num_group.py,sha256=-dQeE9IpeoLZ4hWw5YjeKdhPfV8U_TIwKAiFEjYzVzA,2401
68
68
  ramifice/paladins/groups/pass_group.py,sha256=jRU2tQGEJjFnOJnW1uKlgib-ffA2aVncgNjlCS_rxfM,1964
69
69
  ramifice/paladins/groups/slug_group.py,sha256=zq1C-4XvL7vnM12FhzXYgDhgAgydrU1PlG70pP0pQnA,2543
@@ -77,7 +77,7 @@ ramifice/utils/mixins.py,sha256=5G3x8hK3igM7JBgCiCnVDdb_0K_D1gV1tw0QKpDlm-A,1161
77
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.34.dist-info/METADATA,sha256=MdcRJAzMDAo_E3nlJ4TebPPy3pIZg_dZhMGfhsWJIA0,21112
81
- ramifice-0.8.34.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
82
- ramifice-0.8.34.dist-info/licenses/LICENSE,sha256=LrEL0aTZx90HDwFUQCJutORiDjJL9AnuVvCtspXIqt4,1095
83
- ramifice-0.8.34.dist-info/RECORD,,
80
+ ramifice-0.8.37.dist-info/METADATA,sha256=OYLLYaGwQ_osIOemXFs8pR5_t_T7mIwRpZLDF1q_EfY,18883
81
+ ramifice-0.8.37.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
82
+ ramifice-0.8.37.dist-info/licenses/LICENSE,sha256=LrEL0aTZx90HDwFUQCJutORiDjJL9AnuVvCtspXIqt4,1095
83
+ ramifice-0.8.37.dist-info/RECORD,,