Jedutils 0.2.0__tar.gz → 0.2.1__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 (26) hide show
  1. {Jedutils-0.2.0 → Jedutils-0.2.1}/Jedutils.egg-info/PKG-INFO +1 -1
  2. {Jedutils-0.2.0 → Jedutils-0.2.1}/PKG-INFO +1 -1
  3. {Jedutils-0.2.0 → Jedutils-0.2.1}/jedutils/__init__.py +1 -1
  4. {Jedutils-0.2.0 → Jedutils-0.2.1}/jedutils/asyncio/_async_redis_pipe.py +9 -1
  5. {Jedutils-0.2.0 → Jedutils-0.2.1}/jedutils/asyncio/network/_dl.py +11 -2
  6. {Jedutils-0.2.0 → Jedutils-0.2.1}/Jedutils.egg-info/SOURCES.txt +0 -0
  7. {Jedutils-0.2.0 → Jedutils-0.2.1}/Jedutils.egg-info/dependency_links.txt +0 -0
  8. {Jedutils-0.2.0 → Jedutils-0.2.1}/Jedutils.egg-info/requires.txt +0 -0
  9. {Jedutils-0.2.0 → Jedutils-0.2.1}/Jedutils.egg-info/top_level.txt +0 -0
  10. {Jedutils-0.2.0 → Jedutils-0.2.1}/LICENSE +0 -0
  11. {Jedutils-0.2.0 → Jedutils-0.2.1}/MANIFEST.in +0 -0
  12. {Jedutils-0.2.0 → Jedutils-0.2.1}/README.md +0 -0
  13. {Jedutils-0.2.0 → Jedutils-0.2.1}/jedutils/asyncio/__init__.py +0 -0
  14. {Jedutils-0.2.0 → Jedutils-0.2.1}/jedutils/asyncio/_concurrency_manager.py +0 -0
  15. {Jedutils-0.2.0 → Jedutils-0.2.1}/jedutils/asyncio/_run_async.py +0 -0
  16. {Jedutils-0.2.0 → Jedutils-0.2.1}/jedutils/asyncio/_rwlock.py +0 -0
  17. {Jedutils-0.2.0 → Jedutils-0.2.1}/jedutils/asyncio/network/__init__.py +0 -0
  18. {Jedutils-0.2.0 → Jedutils-0.2.1}/jedutils/databases/__init__.py +0 -0
  19. {Jedutils-0.2.0 → Jedutils-0.2.1}/jedutils/databases/_in_memory.py +0 -0
  20. {Jedutils-0.2.0 → Jedutils-0.2.1}/jedutils/math/__init__.py +0 -0
  21. {Jedutils-0.2.0 → Jedutils-0.2.1}/jedutils/math/_number_formatter.py +0 -0
  22. {Jedutils-0.2.0 → Jedutils-0.2.1}/jedutils/strings/__init__.py +0 -0
  23. {Jedutils-0.2.0 → Jedutils-0.2.1}/jedutils/strings/_chunked_text.py +0 -0
  24. {Jedutils-0.2.0 → Jedutils-0.2.1}/jedutils/strings/_random_string.py +0 -0
  25. {Jedutils-0.2.0 → Jedutils-0.2.1}/setup.cfg +0 -0
  26. {Jedutils-0.2.0 → Jedutils-0.2.1}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: Jedutils
3
- Version: 0.2.0
3
+ Version: 0.2.1
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,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: Jedutils
3
- Version: 0.2.0
3
+ Version: 0.2.1
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.0"
1
+ __version__ = "0.2.1"
2
2
  __copyright__ = "Copyright (c) 2023 AYMEN Mohammed ~ https://github.com/AYMENJD"
3
3
  __license__ = "MIT License"
@@ -1,5 +1,9 @@
1
1
  import asyncio
2
- from redis import Redis
2
+
3
+ try:
4
+ from redis import Redis
5
+ except ImportError:
6
+ Redis = None
3
7
 
4
8
 
5
9
  class AsyncRedisPipe:
@@ -39,6 +43,10 @@ class AsyncRedisPipe:
39
43
  loop (:py:class:`asyncio.AbstractEventLoop`, *optional*):
40
44
  The event loop to use. Defaults to :py:class:`asyncio.get_event_loop()`.
41
45
  """
46
+
47
+ if not Redis:
48
+ raise RuntimeError("Redis is not installed. Try pip install redis")
49
+
42
50
  self.redis = redis
43
51
  self.pipe_max_size = pipe_max_size
44
52
  self.__queue = asyncio.Queue()
@@ -1,5 +1,10 @@
1
1
  import asyncio
2
- import aiohttp
2
+
3
+ try:
4
+ import aiohttp
5
+ except ImportError:
6
+ aiohttp = None
7
+
3
8
  import os
4
9
 
5
10
 
@@ -10,7 +15,7 @@ async def download_file(
10
15
  ignore_status: bool = False,
11
16
  progress_callback: callable = None,
12
17
  thread_pool=None,
13
- **kwargs
18
+ **kwargs,
14
19
  ) -> None:
15
20
  """
16
21
  Asynchronously download a file from the given URL and saves it to the specified filename using chunked downloading
@@ -52,6 +57,10 @@ async def download_file(
52
57
  Raises:
53
58
  :py:class:`aiohttp.ClientResponseError`
54
59
  """
60
+
61
+ if not aiohttp:
62
+ raise RuntimeError("aiohttp is not installed. Try pip install aiohttp")
63
+
55
64
  async with aiohttp.ClientSession() as session:
56
65
  async with session.get(url, **kwargs) as response:
57
66
  if not ignore_status:
File without changes
File without changes
File without changes
File without changes
File without changes