libdev 0.80__tar.gz → 0.82__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 (39) hide show
  1. {libdev-0.80 → libdev-0.82}/PKG-INFO +7 -5
  2. {libdev-0.80 → libdev-0.82}/README.md +1 -0
  3. {libdev-0.80 → libdev-0.82}/libdev/__init__.py +1 -1
  4. libdev-0.82/libdev/log.py +55 -0
  5. {libdev-0.80 → libdev-0.82}/libdev/req.py +1 -1
  6. {libdev-0.80 → libdev-0.82}/libdev.egg-info/PKG-INFO +7 -5
  7. {libdev-0.80 → libdev-0.82}/libdev.egg-info/SOURCES.txt +2 -0
  8. libdev-0.82/libdev.egg-info/requires.txt +5 -0
  9. {libdev-0.80 → libdev-0.82}/setup.py +7 -5
  10. {libdev-0.80 → libdev-0.82}/tests/test_doc.py +2 -0
  11. libdev-0.82/tests/test_log.py +5 -0
  12. libdev-0.80/libdev.egg-info/requires.txt +0 -4
  13. {libdev-0.80 → libdev-0.82}/LICENSE +0 -0
  14. {libdev-0.80 → libdev-0.82}/libdev/cfg.py +0 -0
  15. {libdev-0.80 → libdev-0.82}/libdev/check.py +0 -0
  16. {libdev-0.80 → libdev-0.82}/libdev/codes.py +0 -0
  17. {libdev-0.80 → libdev-0.82}/libdev/dev.py +0 -0
  18. {libdev-0.80 → libdev-0.82}/libdev/doc.py +0 -0
  19. {libdev-0.80 → libdev-0.82}/libdev/fin.py +0 -0
  20. {libdev-0.80 → libdev-0.82}/libdev/gen.py +0 -0
  21. {libdev-0.80 → libdev-0.82}/libdev/img.py +0 -0
  22. {libdev-0.80 → libdev-0.82}/libdev/lang.py +0 -0
  23. {libdev-0.80 → libdev-0.82}/libdev/num.py +0 -0
  24. {libdev-0.80 → libdev-0.82}/libdev/s3.py +0 -0
  25. {libdev-0.80 → libdev-0.82}/libdev/time.py +0 -0
  26. {libdev-0.80 → libdev-0.82}/libdev.egg-info/dependency_links.txt +0 -0
  27. {libdev-0.80 → libdev-0.82}/libdev.egg-info/top_level.txt +0 -0
  28. {libdev-0.80 → libdev-0.82}/setup.cfg +0 -0
  29. {libdev-0.80 → libdev-0.82}/tests/test_cfg.py +0 -0
  30. {libdev-0.80 → libdev-0.82}/tests/test_check.py +0 -0
  31. {libdev-0.80 → libdev-0.82}/tests/test_codes.py +0 -0
  32. {libdev-0.80 → libdev-0.82}/tests/test_dev.py +0 -0
  33. {libdev-0.80 → libdev-0.82}/tests/test_gen.py +0 -0
  34. {libdev-0.80 → libdev-0.82}/tests/test_img.py +0 -0
  35. {libdev-0.80 → libdev-0.82}/tests/test_lang.py +0 -0
  36. {libdev-0.80 → libdev-0.82}/tests/test_num.py +0 -0
  37. {libdev-0.80 → libdev-0.82}/tests/test_req.py +0 -0
  38. {libdev-0.80 → libdev-0.82}/tests/test_s3.py +0 -0
  39. {libdev-0.80 → libdev-0.82}/tests/test_time.py +0 -0
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: libdev
3
- Version: 0.80
3
+ Version: 0.82
4
4
  Summary: Set of standard functions for development
5
5
  Home-page: https://github.com/kosyachniy/lib
6
- Author: Alexey Poloz
6
+ Author: Alex Poloz
7
7
  Author-email: alexypoloz@gmail.com
8
8
  License: MIT
9
9
  Project-URL: Source, https://github.com/kosyachniy/lib
@@ -19,9 +19,10 @@ Requires-Python: >=3.7, <4
19
19
  Description-Content-Type: text/markdown
20
20
  License-File: LICENSE
21
21
  Requires-Dist: aiohttp
22
- Requires-Dist: python-dotenv==1.0.1
23
- Requires-Dist: boto3==1.34.136
24
- Requires-Dist: Pillow==10.3.0
22
+ Requires-Dist: python-dotenv
23
+ Requires-Dist: boto3
24
+ Requires-Dist: Pillow
25
+ Requires-Dist: loguru
25
26
 
26
27
  # LibDev
27
28
  Development library — Set of standard functions for development
@@ -34,6 +35,7 @@ Stream | Submodule | Description
34
35
  ---|---|---
35
36
  System | ` libdev.cfg ` | Configuration getting
36
37
  &nbsp; | ` libdev.req ` | AsyncIO requests (AIOHTTP wrapper)
38
+ &nbsp; | ` libdev.log ` | Logger (Loguru wrapper)
37
39
  Data Format | ` libdev.num ` | Numeric conversions & handlers
38
40
  &nbsp; | ` libdev.time ` | Time processing
39
41
  Transforms | ` libdev.gen ` | Code & token generators
@@ -9,6 +9,7 @@ Stream | Submodule | Description
9
9
  ---|---|---
10
10
  System | ` libdev.cfg ` | Configuration getting
11
11
  &nbsp; | ` libdev.req ` | AsyncIO requests (AIOHTTP wrapper)
12
+ &nbsp; | ` libdev.log ` | Logger (Loguru wrapper)
12
13
  Data Format | ` libdev.num ` | Numeric conversions & handlers
13
14
  &nbsp; | ` libdev.time ` | Time processing
14
15
  Transforms | ` libdev.gen ` | Code & token generators
@@ -2,6 +2,6 @@
2
2
  Initializing the Python package
3
3
  """
4
4
 
5
- __version__ = "0.80"
5
+ __version__ = "0.82"
6
6
 
7
7
  __all__ = ("__version__",)
@@ -0,0 +1,55 @@
1
+ """
2
+ Custom logger module
3
+ --------------------
4
+
5
+ Provides an extension to the Loguru logger with a custom methods
6
+
7
+ Usage:
8
+ from libdev.log import log
9
+ log.json({"event": "startup", "status": "success"})
10
+ """
11
+
12
+ import sys
13
+ import atexit as _atexit
14
+
15
+ from loguru import _defaults
16
+ from loguru._logger import (
17
+ Core as _Core,
18
+ Logger as _Logger,
19
+ )
20
+
21
+ from .doc import to_json
22
+
23
+
24
+ class Logger(_Logger):
25
+ """
26
+ Extends the Loguru logger to include a method for logging JSON formatted messages
27
+ """
28
+
29
+ def json(self, data):
30
+ """Log a message in JSON format"""
31
+ self.info(to_json(data))
32
+
33
+
34
+ log = Logger(
35
+ core=_Core(),
36
+ exception=None,
37
+ depth=0,
38
+ record=False,
39
+ lazy=False,
40
+ colors=False,
41
+ raw=False,
42
+ capture=True,
43
+ patchers=[],
44
+ extra={},
45
+ )
46
+
47
+ if _defaults.LOGURU_AUTOINIT and sys.stderr:
48
+ log.add(sys.stderr)
49
+ _atexit.register(log.remove)
50
+
51
+
52
+ __all__ = (
53
+ "log",
54
+ "Logger",
55
+ )
@@ -1,5 +1,5 @@
1
1
  """
2
- This module provides an asynchronous function to fetch data from a URL using aiohttp.
2
+ Provides an asynchronous function to fetch data from a URL using aiohttp
3
3
  """
4
4
 
5
5
  import aiohttp
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: libdev
3
- Version: 0.80
3
+ Version: 0.82
4
4
  Summary: Set of standard functions for development
5
5
  Home-page: https://github.com/kosyachniy/lib
6
- Author: Alexey Poloz
6
+ Author: Alex Poloz
7
7
  Author-email: alexypoloz@gmail.com
8
8
  License: MIT
9
9
  Project-URL: Source, https://github.com/kosyachniy/lib
@@ -19,9 +19,10 @@ Requires-Python: >=3.7, <4
19
19
  Description-Content-Type: text/markdown
20
20
  License-File: LICENSE
21
21
  Requires-Dist: aiohttp
22
- Requires-Dist: python-dotenv==1.0.1
23
- Requires-Dist: boto3==1.34.136
24
- Requires-Dist: Pillow==10.3.0
22
+ Requires-Dist: python-dotenv
23
+ Requires-Dist: boto3
24
+ Requires-Dist: Pillow
25
+ Requires-Dist: loguru
25
26
 
26
27
  # LibDev
27
28
  Development library — Set of standard functions for development
@@ -34,6 +35,7 @@ Stream | Submodule | Description
34
35
  ---|---|---
35
36
  System | ` libdev.cfg ` | Configuration getting
36
37
  &nbsp; | ` libdev.req ` | AsyncIO requests (AIOHTTP wrapper)
38
+ &nbsp; | ` libdev.log ` | Logger (Loguru wrapper)
37
39
  Data Format | ` libdev.num ` | Numeric conversions & handlers
38
40
  &nbsp; | ` libdev.time ` | Time processing
39
41
  Transforms | ` libdev.gen ` | Code & token generators
@@ -11,6 +11,7 @@ libdev/fin.py
11
11
  libdev/gen.py
12
12
  libdev/img.py
13
13
  libdev/lang.py
14
+ libdev/log.py
14
15
  libdev/num.py
15
16
  libdev/req.py
16
17
  libdev/s3.py
@@ -28,6 +29,7 @@ tests/test_doc.py
28
29
  tests/test_gen.py
29
30
  tests/test_img.py
30
31
  tests/test_lang.py
32
+ tests/test_log.py
31
33
  tests/test_num.py
32
34
  tests/test_req.py
33
35
  tests/test_s3.py
@@ -0,0 +1,5 @@
1
+ aiohttp
2
+ python-dotenv
3
+ boto3
4
+ Pillow
5
+ loguru
@@ -31,7 +31,7 @@ setup(
31
31
  long_description=long_description,
32
32
  long_description_content_type="text/markdown",
33
33
  url="https://github.com/kosyachniy/lib",
34
- author="Alexey Poloz",
34
+ author="Alex Poloz",
35
35
  author_email="alexypoloz@gmail.com",
36
36
  classifiers=[
37
37
  "Development Status :: 4 - Beta",
@@ -50,10 +50,12 @@ setup(
50
50
  packages=find_packages(exclude=("tests",)),
51
51
  python_requires=">=3.7, <4",
52
52
  install_requires=[
53
- "aiohttp", # NOTE: Because of conflicts with main repo
54
- "python-dotenv==1.0.1",
55
- "boto3==1.34.136",
56
- "Pillow==10.3.0",
53
+ # NOTE: Without lib versions because of conflicts with main repo
54
+ "aiohttp",
55
+ "python-dotenv",
56
+ "boto3",
57
+ "Pillow",
58
+ "loguru",
57
59
  ],
58
60
  project_urls={
59
61
  "Source": "https://github.com/kosyachniy/lib",
@@ -11,3 +11,5 @@ def test_to_base64():
11
11
 
12
12
  def test_to_json():
13
13
  assert to_json([{"хола": "☺️"}]) == '[\n {\n "хола": "☺️"\n }\n]'
14
+ assert to_json(None) == "null"
15
+ assert to_json({1: 2}) == '{\n\t"1": 2\n}'
@@ -0,0 +1,5 @@
1
+ from libdev.log import log
2
+
3
+
4
+ def test_log():
5
+ assert log.json([{"хола": "☺️"}]) == None
@@ -1,4 +0,0 @@
1
- aiohttp
2
- python-dotenv==1.0.1
3
- boto3==1.34.136
4
- Pillow==10.3.0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes