Jedutils 0.2.5__tar.gz → 0.2.6__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.
Files changed (31) hide show
  1. {Jedutils-0.2.5 → Jedutils-0.2.6}/Jedutils.egg-info/PKG-INFO +1 -1
  2. {Jedutils-0.2.5 → Jedutils-0.2.6}/Jedutils.egg-info/SOURCES.txt +1 -0
  3. {Jedutils-0.2.5 → Jedutils-0.2.6}/PKG-INFO +1 -1
  4. {Jedutils-0.2.5 → Jedutils-0.2.6}/jedutils/__init__.py +1 -1
  5. Jedutils-0.2.6/jedutils/strings/_numerals.py +46 -0
  6. {Jedutils-0.2.5 → Jedutils-0.2.6}/Jedutils.egg-info/dependency_links.txt +0 -0
  7. {Jedutils-0.2.5 → Jedutils-0.2.6}/Jedutils.egg-info/requires.txt +0 -0
  8. {Jedutils-0.2.5 → Jedutils-0.2.6}/Jedutils.egg-info/top_level.txt +0 -0
  9. {Jedutils-0.2.5 → Jedutils-0.2.6}/LICENSE +0 -0
  10. {Jedutils-0.2.5 → Jedutils-0.2.6}/MANIFEST.in +0 -0
  11. {Jedutils-0.2.5 → Jedutils-0.2.6}/README.md +0 -0
  12. {Jedutils-0.2.5 → Jedutils-0.2.6}/jedutils/asyncio/__init__.py +0 -0
  13. {Jedutils-0.2.5 → Jedutils-0.2.6}/jedutils/asyncio/_async_redis_pipe.py +0 -0
  14. {Jedutils-0.2.5 → Jedutils-0.2.6}/jedutils/asyncio/_concurrency_manager.py +0 -0
  15. {Jedutils-0.2.5 → Jedutils-0.2.6}/jedutils/asyncio/_run_async.py +0 -0
  16. {Jedutils-0.2.5 → Jedutils-0.2.6}/jedutils/asyncio/_rwlock.py +0 -0
  17. {Jedutils-0.2.5 → Jedutils-0.2.6}/jedutils/asyncio/network/__init__.py +0 -0
  18. {Jedutils-0.2.5 → Jedutils-0.2.6}/jedutils/asyncio/network/_dl.py +0 -0
  19. {Jedutils-0.2.5 → Jedutils-0.2.6}/jedutils/base62/__init__.py +0 -0
  20. {Jedutils-0.2.5 → Jedutils-0.2.6}/jedutils/base62/b62.py +0 -0
  21. {Jedutils-0.2.5 → Jedutils-0.2.6}/jedutils/databases/__init__.py +0 -0
  22. {Jedutils-0.2.5 → Jedutils-0.2.6}/jedutils/databases/_in_memory.py +0 -0
  23. {Jedutils-0.2.5 → Jedutils-0.2.6}/jedutils/math/__init__.py +0 -0
  24. {Jedutils-0.2.5 → Jedutils-0.2.6}/jedutils/math/_number_formatter.py +0 -0
  25. {Jedutils-0.2.5 → Jedutils-0.2.6}/jedutils/strings/__init__.py +0 -0
  26. {Jedutils-0.2.5 → Jedutils-0.2.6}/jedutils/strings/_chunked_text.py +0 -0
  27. {Jedutils-0.2.5 → Jedutils-0.2.6}/jedutils/strings/_random_string.py +0 -0
  28. {Jedutils-0.2.5 → Jedutils-0.2.6}/jedutils/tdlib/__init__.py +0 -0
  29. {Jedutils-0.2.5 → Jedutils-0.2.6}/jedutils/tdlib/arithmetic.py +0 -0
  30. {Jedutils-0.2.5 → Jedutils-0.2.6}/setup.cfg +0 -0
  31. {Jedutils-0.2.5 → Jedutils-0.2.6}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: Jedutils
3
- Version: 0.2.5
3
+ Version: 0.2.6
4
4
  Summary: Jedutils is a Python utilities package that provides a collection of useful helper functions.
5
5
  Home-page: https://github.com/AYMENJD/jedutils
6
6
  Author: AYMEN Mohammed
@@ -23,6 +23,7 @@ jedutils/math/__init__.py
23
23
  jedutils/math/_number_formatter.py
24
24
  jedutils/strings/__init__.py
25
25
  jedutils/strings/_chunked_text.py
26
+ jedutils/strings/_numerals.py
26
27
  jedutils/strings/_random_string.py
27
28
  jedutils/tdlib/__init__.py
28
29
  jedutils/tdlib/arithmetic.py
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: Jedutils
3
- Version: 0.2.5
3
+ Version: 0.2.6
4
4
  Summary: Jedutils is a Python utilities package that provides a collection of useful helper functions.
5
5
  Home-page: https://github.com/AYMENJD/jedutils
6
6
  Author: AYMEN Mohammed
@@ -1,3 +1,3 @@
1
- __version__ = "0.2.5"
1
+ __version__ = "0.2.6"
2
2
  __copyright__ = "Copyright (c) 2023-2024 AYMEN Mohammed ~ https://github.com/AYMENJD"
3
3
  __license__ = "MIT License"
@@ -0,0 +1,46 @@
1
+ arabic_indic_digits = str.maketrans(
2
+ "0123456789", "\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669"
3
+ )
4
+ english_digits = str.maketrans(
5
+ "\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669", "0123456789"
6
+ )
7
+
8
+
9
+ def to_arabic_nums(string: str):
10
+ """
11
+ Convert a string with english numerals to Arabic numerals
12
+
13
+ Example:
14
+ .. code-block:: python
15
+ >>> to_arabic_nums("1234")
16
+ '١٢٣٤'
17
+
18
+ Parameters:
19
+ string (``str`` || ``int``):
20
+ The string or integer containing English numerals to convert to Arabic numerals
21
+
22
+ Returns:
23
+ ``str``: The string with digits converted to Arabic numerals
24
+ """
25
+
26
+ return str(string).translate(arabic_indic_digits)
27
+
28
+
29
+ def to_english_nums(string: str):
30
+ """
31
+ Convert a string with Arabic numerals to English numerals
32
+
33
+ Example:
34
+ .. code-block:: python
35
+ >>> to_english_nums("١٢٣٤")
36
+ '1234'
37
+
38
+ Parameters:
39
+ string (``str`` || ``int``):
40
+ The string or integer containing Arabic numerals to convert to English numerals
41
+
42
+ Returns:
43
+ ``str``: The string with Arabic numerals converted to English numerals
44
+ """
45
+
46
+ return str(string).translate(english_digits)
File without changes
File without changes
File without changes
File without changes
File without changes