Jedutils 0.2.7.dev1__tar.gz → 0.2.8__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 (33) hide show
  1. {jedutils-0.2.7.dev1 → jedutils-0.2.8}/Jedutils.egg-info/PKG-INFO +16 -6
  2. {jedutils-0.2.7.dev1 → jedutils-0.2.8}/Jedutils.egg-info/SOURCES.txt +1 -2
  3. {jedutils-0.2.7.dev1 → jedutils-0.2.8}/LICENSE +1 -1
  4. {jedutils-0.2.7.dev1 → jedutils-0.2.8}/PKG-INFO +16 -6
  5. jedutils-0.2.8/jedutils/__init__.py +3 -0
  6. {jedutils-0.2.7.dev1 → jedutils-0.2.8}/jedutils/asyncio/_async_redis_pipe.py +20 -13
  7. jedutils-0.2.8/pyproject.toml +52 -0
  8. jedutils-0.2.7.dev1/MANIFEST.in +0 -2
  9. jedutils-0.2.7.dev1/jedutils/__init__.py +0 -3
  10. jedutils-0.2.7.dev1/setup.py +0 -38
  11. {jedutils-0.2.7.dev1 → jedutils-0.2.8}/Jedutils.egg-info/dependency_links.txt +0 -0
  12. {jedutils-0.2.7.dev1 → jedutils-0.2.8}/Jedutils.egg-info/requires.txt +0 -0
  13. {jedutils-0.2.7.dev1 → jedutils-0.2.8}/Jedutils.egg-info/top_level.txt +0 -0
  14. {jedutils-0.2.7.dev1 → jedutils-0.2.8}/README.md +0 -0
  15. {jedutils-0.2.7.dev1 → jedutils-0.2.8}/jedutils/asyncio/__init__.py +0 -0
  16. {jedutils-0.2.7.dev1 → jedutils-0.2.8}/jedutils/asyncio/_concurrency_manager.py +0 -0
  17. {jedutils-0.2.7.dev1 → jedutils-0.2.8}/jedutils/asyncio/_run_async.py +0 -0
  18. {jedutils-0.2.7.dev1 → jedutils-0.2.8}/jedutils/asyncio/_rwlock.py +0 -0
  19. {jedutils-0.2.7.dev1 → jedutils-0.2.8}/jedutils/asyncio/network/__init__.py +0 -0
  20. {jedutils-0.2.7.dev1 → jedutils-0.2.8}/jedutils/asyncio/network/_dl.py +0 -0
  21. {jedutils-0.2.7.dev1 → jedutils-0.2.8}/jedutils/base62/__init__.py +0 -0
  22. {jedutils-0.2.7.dev1 → jedutils-0.2.8}/jedutils/base62/b62.py +0 -0
  23. {jedutils-0.2.7.dev1 → jedutils-0.2.8}/jedutils/databases/__init__.py +0 -0
  24. {jedutils-0.2.7.dev1 → jedutils-0.2.8}/jedutils/databases/_in_memory.py +0 -0
  25. {jedutils-0.2.7.dev1 → jedutils-0.2.8}/jedutils/math/__init__.py +0 -0
  26. {jedutils-0.2.7.dev1 → jedutils-0.2.8}/jedutils/math/_number_formatter.py +0 -0
  27. {jedutils-0.2.7.dev1 → jedutils-0.2.8}/jedutils/strings/__init__.py +0 -0
  28. {jedutils-0.2.7.dev1 → jedutils-0.2.8}/jedutils/strings/_chunked_text.py +0 -0
  29. {jedutils-0.2.7.dev1 → jedutils-0.2.8}/jedutils/strings/_numerals.py +0 -0
  30. {jedutils-0.2.7.dev1 → jedutils-0.2.8}/jedutils/strings/_random_string.py +0 -0
  31. {jedutils-0.2.7.dev1 → jedutils-0.2.8}/jedutils/tdlib/__init__.py +0 -0
  32. {jedutils-0.2.7.dev1 → jedutils-0.2.8}/jedutils/tdlib/arithmetic.py +0 -0
  33. {jedutils-0.2.7.dev1 → jedutils-0.2.8}/setup.cfg +0 -0
@@ -1,19 +1,29 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: Jedutils
3
- Version: 0.2.7.dev1
3
+ Version: 0.2.8
4
4
  Summary: Jedutils is a Python utilities package that provides a collection of useful helper functions.
5
- Home-page: https://github.com/AYMENJD/jedutils
6
- Author: AYMEN Mohammed
7
- Author-email: let.me.code.safe@gmail.com
8
- License: MIT
5
+ Author-email: AYMEN A <let.me.code.safe@gmail.com>
6
+ License-Expression: MIT
9
7
  Project-URL: Source, https://github.com/AYMENJD/jedutils
10
8
  Project-URL: Tracker, https://github.com/AYMENJD/jedutils/issues
11
9
  Keywords: utilities,tools,library,helper,functions,development
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Programming Language :: Python :: 3.15
19
+ Classifier: Topic :: Software Development :: Libraries
20
+ Requires-Python: >=3.10
12
21
  Description-Content-Type: text/markdown
13
22
  License-File: LICENSE
14
23
  Provides-Extra: all
15
24
  Requires-Dist: redis; extra == "all"
16
25
  Requires-Dist: aiohttp; extra == "all"
26
+ Dynamic: license-file
17
27
 
18
28
  # Jedutils [![Version](https://img.shields.io/pypi/v/jedutils?style=flat&logo=pypi)](https://pypi.org/project/jedutils) [![Downloads](https://static.pepy.tech/personalized-badge/jedutils?period=month&units=none&left_color=grey&right_color=brightgreen&left_text=Downloads)](https://pepy.tech/project/jedutils)
19
29
 
@@ -1,7 +1,6 @@
1
1
  LICENSE
2
- MANIFEST.in
3
2
  README.md
4
- setup.py
3
+ pyproject.toml
5
4
  Jedutils.egg-info/PKG-INFO
6
5
  Jedutils.egg-info/SOURCES.txt
7
6
  Jedutils.egg-info/dependency_links.txt
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 AYMEN Mohammed
3
+ Copyright (c) 2023-2026 AYMENJD
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,19 +1,29 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: Jedutils
3
- Version: 0.2.7.dev1
3
+ Version: 0.2.8
4
4
  Summary: Jedutils is a Python utilities package that provides a collection of useful helper functions.
5
- Home-page: https://github.com/AYMENJD/jedutils
6
- Author: AYMEN Mohammed
7
- Author-email: let.me.code.safe@gmail.com
8
- License: MIT
5
+ Author-email: AYMEN A <let.me.code.safe@gmail.com>
6
+ License-Expression: MIT
9
7
  Project-URL: Source, https://github.com/AYMENJD/jedutils
10
8
  Project-URL: Tracker, https://github.com/AYMENJD/jedutils/issues
11
9
  Keywords: utilities,tools,library,helper,functions,development
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Programming Language :: Python :: 3.15
19
+ Classifier: Topic :: Software Development :: Libraries
20
+ Requires-Python: >=3.10
12
21
  Description-Content-Type: text/markdown
13
22
  License-File: LICENSE
14
23
  Provides-Extra: all
15
24
  Requires-Dist: redis; extra == "all"
16
25
  Requires-Dist: aiohttp; extra == "all"
26
+ Dynamic: license-file
17
27
 
18
28
  # Jedutils [![Version](https://img.shields.io/pypi/v/jedutils?style=flat&logo=pypi)](https://pypi.org/project/jedutils) [![Downloads](https://static.pepy.tech/personalized-badge/jedutils?period=month&units=none&left_color=grey&right_color=brightgreen&left_text=Downloads)](https://pepy.tech/project/jedutils)
19
29
 
@@ -0,0 +1,3 @@
1
+ __version__ = "0.2.8"
2
+ __copyright__ = "Copyright (c) 2023-2026 AYMENJD ~ https://github.com/AYMENJD"
3
+ __license__ = "MIT License"
@@ -21,6 +21,8 @@ class AsyncRedisPipe:
21
21
  >>> redis_calls = [pipe.get("key") for i in range(100000)]
22
22
  >>> await asyncio.gather(*redis_calls) # 100K Concurrent redis calls
23
23
 
24
+ Disclaimer:
25
+ This class is intended to be used with basic redis commands, other non redis commands (a.k.a client side commands) are not supported (eg. `redis.lock`) and such call can have unexpected behavior.
24
26
  """
25
27
 
26
28
  def __init__(
@@ -94,15 +96,19 @@ class AsyncRedisPipe:
94
96
  if self.debug:
95
97
  self.logger.debug(f"Executing command: {data[1]}")
96
98
 
97
- pipe.execute_command(*data[1])
99
+ try:
100
+ getattr(pipe, data[1])(*data[2], **data[3])
101
+ except Exception as e:
102
+ data[0].set_exception(e)
103
+ continue
104
+
98
105
  futures.append(data[0])
99
106
  count += 1
100
107
 
101
- self.__loop.create_task(self.__handle_pipe_line(futures, pipe))
108
+ await self.__handle_pipe_line(futures, pipe)
102
109
 
103
110
  async def __handle_pipe_line(self, futures: list, pipe):
104
- results = await pipe.execute(False)
105
- for x, result in enumerate(results):
111
+ for x, result in enumerate((await pipe.execute(False))):
106
112
  if self.debug:
107
113
  self.logger.debug(f"Result: {result}")
108
114
 
@@ -112,15 +118,16 @@ class AsyncRedisPipe:
112
118
  futures[x].set_result(result)
113
119
 
114
120
  def __getattr__(self, name):
115
- if name == "delete":
116
- name = "del"
117
-
118
- def wrapper(*args):
119
- fut = asyncio.Future()
120
- args = (name,) + args
121
- self.__queue.put_nowait((fut, args))
122
- return fut
123
-
121
+ wrapper = self.__dict__.get(name)
122
+ if wrapper is None:
123
+ def wrapper(*args, **kwargs):
124
+ fut = asyncio.Future()
125
+ self.__queue.put_nowait((fut, name, args, kwargs))
126
+ return fut
127
+
128
+ # cache in the instance dict so later calls skip __getattr__
129
+ # and the per-call closure allocation
130
+ self.__dict__[name] = wrapper
124
131
  return wrapper
125
132
 
126
133
  def close(self):
@@ -0,0 +1,52 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "Jedutils"
7
+ dynamic = ["version"]
8
+ description = "Jedutils is a Python utilities package that provides a collection of useful helper functions."
9
+ readme = { file = "README.md", content-type = "text/markdown" }
10
+ requires-python = ">=3.10"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ authors = [{ name = "AYMEN A", email = "let.me.code.safe@gmail.com" }]
14
+ dependencies = []
15
+ keywords = [
16
+ "utilities",
17
+ "tools",
18
+ "library",
19
+ "helper",
20
+ "functions",
21
+ "development",
22
+ ]
23
+ classifiers = [
24
+ "Development Status :: 4 - Beta",
25
+ "Intended Audience :: Developers",
26
+ "Programming Language :: Python :: 3",
27
+ "Programming Language :: Python :: 3.10",
28
+ "Programming Language :: Python :: 3.11",
29
+ "Programming Language :: Python :: 3.12",
30
+ "Programming Language :: Python :: 3.13",
31
+ "Programming Language :: Python :: 3.14",
32
+ "Programming Language :: Python :: 3.15",
33
+ "Topic :: Software Development :: Libraries",
34
+ ]
35
+
36
+ [project.urls]
37
+ Source = "https://github.com/AYMENJD/jedutils"
38
+ Tracker = "https://github.com/AYMENJD/jedutils/issues"
39
+
40
+ [project.optional-dependencies]
41
+ all = ["redis", "aiohttp"]
42
+
43
+ [tool.setuptools]
44
+ include-package-data = false
45
+
46
+ [tool.setuptools.packages.find]
47
+ where = ["."]
48
+ include = ["jedutils", "jedutils.*"]
49
+ namespaces = false
50
+
51
+ [tool.setuptools.dynamic]
52
+ version = { attr = "jedutils.__version__" }
@@ -1,2 +0,0 @@
1
- include README.md LICENSE
2
- recursive-include jedutils *.py
@@ -1,3 +0,0 @@
1
- __version__ = "0.2.7dev1"
2
- __copyright__ = "Copyright (c) 2023-2024 AYMEN Mohammed ~ https://github.com/AYMENJD"
3
- __license__ = "MIT License"
@@ -1,38 +0,0 @@
1
- from re import findall
2
- from setuptools import setup, find_packages
3
-
4
-
5
- with open("jedutils/__init__.py", "r") as f:
6
- version = findall(r"__version__ = \"(.+)\"", f.read())[0]
7
-
8
- with open("README.md", "r") as f:
9
- readme = f.read()
10
-
11
-
12
- setup(
13
- name="Jedutils",
14
- version=version,
15
- description="Jedutils is a Python utilities package that provides a collection of useful helper functions.",
16
- long_description=readme,
17
- long_description_content_type="text/markdown",
18
- author="AYMEN Mohammed",
19
- author_email="let.me.code.safe@gmail.com",
20
- url="https://github.com/AYMENJD/jedutils",
21
- license="MIT",
22
- project_urls={
23
- "Source": "https://github.com/AYMENJD/jedutils",
24
- "Tracker": "https://github.com/AYMENJD/jedutils/issues",
25
- },
26
- packages=find_packages(),
27
- extras_require={
28
- "all": ["redis", "aiohttp"],
29
- },
30
- keywords=[
31
- "utilities",
32
- "tools",
33
- "library",
34
- "helper",
35
- "functions",
36
- "development",
37
- ],
38
- )
File without changes
File without changes