libdev 0.96__tar.gz → 0.98__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.
- libdev-0.98/PKG-INFO +95 -0
- {libdev-0.96 → libdev-0.98}/README.md +7 -0
- libdev-0.98/env/bin/jp.py +54 -0
- {libdev-0.96 → libdev-0.98}/libdev/__init__.py +1 -1
- {libdev-0.96 → libdev-0.98}/libdev/img.py +63 -5
- libdev-0.98/libdev.egg-info/PKG-INFO +95 -0
- {libdev-0.96 → libdev-0.98}/libdev.egg-info/SOURCES.txt +2 -0
- libdev-0.98/libdev.egg-info/requires.txt +14 -0
- libdev-0.98/libdev.egg-info/top_level.txt +4 -0
- libdev-0.98/pyproject.toml +76 -0
- {libdev-0.96 → libdev-0.98}/setup.py +22 -17
- {libdev-0.96 → libdev-0.98}/tests/test_time.py +2 -2
- libdev-0.96/PKG-INFO +0 -50
- libdev-0.96/libdev.egg-info/PKG-INFO +0 -50
- libdev-0.96/libdev.egg-info/requires.txt +0 -5
- libdev-0.96/libdev.egg-info/top_level.txt +0 -1
- {libdev-0.96 → libdev-0.98}/LICENSE +0 -0
- {libdev-0.96 → libdev-0.98}/libdev/cfg.py +0 -0
- {libdev-0.96 → libdev-0.98}/libdev/check.py +0 -0
- {libdev-0.96 → libdev-0.98}/libdev/codes.py +0 -0
- {libdev-0.96 → libdev-0.98}/libdev/crypt.py +0 -0
- {libdev-0.96 → libdev-0.98}/libdev/dev.py +0 -0
- {libdev-0.96 → libdev-0.98}/libdev/doc.py +0 -0
- {libdev-0.96 → libdev-0.98}/libdev/fin.py +0 -0
- {libdev-0.96 → libdev-0.98}/libdev/gen.py +0 -0
- {libdev-0.96 → libdev-0.98}/libdev/lang.py +0 -0
- {libdev-0.96 → libdev-0.98}/libdev/log.py +0 -0
- {libdev-0.96 → libdev-0.98}/libdev/num.py +0 -0
- {libdev-0.96 → libdev-0.98}/libdev/req.py +0 -0
- {libdev-0.96 → libdev-0.98}/libdev/s3.py +0 -0
- {libdev-0.96 → libdev-0.98}/libdev/time.py +0 -0
- {libdev-0.96 → libdev-0.98}/libdev.egg-info/dependency_links.txt +0 -0
- {libdev-0.96 → libdev-0.98}/setup.cfg +0 -0
- {libdev-0.96 → libdev-0.98}/tests/test_cfg.py +0 -0
- {libdev-0.96 → libdev-0.98}/tests/test_check.py +0 -0
- {libdev-0.96 → libdev-0.98}/tests/test_codes.py +0 -0
- {libdev-0.96 → libdev-0.98}/tests/test_crypt.py +0 -0
- {libdev-0.96 → libdev-0.98}/tests/test_dev.py +0 -0
- {libdev-0.96 → libdev-0.98}/tests/test_doc.py +0 -0
- {libdev-0.96 → libdev-0.98}/tests/test_gen.py +0 -0
- {libdev-0.96 → libdev-0.98}/tests/test_img.py +0 -0
- {libdev-0.96 → libdev-0.98}/tests/test_lang.py +0 -0
- {libdev-0.96 → libdev-0.98}/tests/test_log.py +0 -0
- {libdev-0.96 → libdev-0.98}/tests/test_num.py +0 -0
- {libdev-0.96 → libdev-0.98}/tests/test_req.py +0 -0
- {libdev-0.96 → libdev-0.98}/tests/test_s3.py +0 -0
libdev-0.98/PKG-INFO
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: libdev
|
|
3
|
+
Version: 0.98
|
|
4
|
+
Summary: Set of standard functions for development
|
|
5
|
+
Home-page: https://github.com/chilleco/lib
|
|
6
|
+
Author: Alex Poloz
|
|
7
|
+
Author-email: Alex Poloz <alexypoloz@gmail.com>
|
|
8
|
+
License: MIT License
|
|
9
|
+
|
|
10
|
+
Copyright (c) 2021 Alexey Poloz
|
|
11
|
+
|
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
in the Software without restriction, including without limitation the rights
|
|
15
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
furnished to do so, subject to the following conditions:
|
|
18
|
+
|
|
19
|
+
The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
copies or substantial portions of the Software.
|
|
21
|
+
|
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
SOFTWARE.
|
|
29
|
+
|
|
30
|
+
Project-URL: Source, https://github.com/chilleco/lib
|
|
31
|
+
Keywords: standard,lib,dev,development,cfg,config,generate,codes,tokens,ids,passwords,generator,ciphers,time,formatter,nlp,natural language,aws,s3,upload file,file server
|
|
32
|
+
Classifier: Development Status :: 4 - Beta
|
|
33
|
+
Classifier: Environment :: Console
|
|
34
|
+
Classifier: Intended Audience :: Developers
|
|
35
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
36
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
37
|
+
Classifier: Programming Language :: Python :: 3
|
|
38
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
41
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
42
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
43
|
+
Classifier: Operating System :: OS Independent
|
|
44
|
+
Requires-Python: >=3.10, <4
|
|
45
|
+
Description-Content-Type: text/markdown
|
|
46
|
+
License-File: LICENSE
|
|
47
|
+
Requires-Dist: aiohttp>=3.13.2
|
|
48
|
+
Requires-Dist: python-dotenv>=1.2.1
|
|
49
|
+
Requires-Dist: boto3>=1.42.0
|
|
50
|
+
Requires-Dist: Pillow>=12.0.0
|
|
51
|
+
Requires-Dist: pillow-heif>=1.0.0
|
|
52
|
+
Requires-Dist: loguru>=0.7.3
|
|
53
|
+
Provides-Extra: dev
|
|
54
|
+
Requires-Dist: build>=1.3.0; extra == "dev"
|
|
55
|
+
Requires-Dist: setuptools>=80.9.0; extra == "dev"
|
|
56
|
+
Requires-Dist: twine>=6.2.0; extra == "dev"
|
|
57
|
+
Requires-Dist: pylint>=4.0.4; extra == "dev"
|
|
58
|
+
Requires-Dist: pytest>=9.0.1; extra == "dev"
|
|
59
|
+
Requires-Dist: pytest-asyncio>=1.3.0; extra == "dev"
|
|
60
|
+
Dynamic: author
|
|
61
|
+
Dynamic: home-page
|
|
62
|
+
Dynamic: license-file
|
|
63
|
+
Dynamic: requires-python
|
|
64
|
+
|
|
65
|
+
# LibDev
|
|
66
|
+
Development library — Set of standard functions for development
|
|
67
|
+
|
|
68
|
+
[GitHub](https://github.com/chilleco/lib)
|
|
69
|
+
| [PyPI](https://pypi.org/project/libdev/)
|
|
70
|
+
|
|
71
|
+
## Requirements
|
|
72
|
+
- Python 3.10+ (dependencies are 3.14-ready)
|
|
73
|
+
|
|
74
|
+
## Installation
|
|
75
|
+
- Runtime: `pip install .`
|
|
76
|
+
- Dev / tests: `pip install .[dev]` or `make setup-dev`
|
|
77
|
+
|
|
78
|
+
## Submodules
|
|
79
|
+
Stream | Submodule | Description
|
|
80
|
+
---|---|---
|
|
81
|
+
System | ` libdev.cfg ` | Configuration getting
|
|
82
|
+
| ` libdev.req ` | AsyncIO requests (AIOHTTP wrapper)
|
|
83
|
+
| ` libdev.log ` | Logger (Loguru wrapper)
|
|
84
|
+
Data Format | ` libdev.num ` | Numeric conversions & handlers
|
|
85
|
+
| ` libdev.time ` | Time processing
|
|
86
|
+
Transforms | ` libdev.gen ` | Code & token generators
|
|
87
|
+
| ` libdev.codes ` | Ciphers: langs & flags / networks / user statuses
|
|
88
|
+
| ` libdev.check ` | Validation functions
|
|
89
|
+
| ` libdev.crypt ` | Encryption and decryption functions
|
|
90
|
+
Fields | ` libdev.dev ` | Development tools
|
|
91
|
+
| ` libdev.fin ` | Financial codes and tools
|
|
92
|
+
| ` libdev.lang ` | Natural language formatters
|
|
93
|
+
Files | ` libdev.doc ` | Base64 / JSON handlers
|
|
94
|
+
| ` libdev.s3 ` | S3 file server functions
|
|
95
|
+
| ` libdev.img ` | Image processing
|
|
@@ -4,6 +4,13 @@ Development library — Set of standard functions for development
|
|
|
4
4
|
[GitHub](https://github.com/chilleco/lib)
|
|
5
5
|
| [PyPI](https://pypi.org/project/libdev/)
|
|
6
6
|
|
|
7
|
+
## Requirements
|
|
8
|
+
- Python 3.10+ (dependencies are 3.14-ready)
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
- Runtime: `pip install .`
|
|
12
|
+
- Dev / tests: `pip install .[dev]` or `make setup-dev`
|
|
13
|
+
|
|
7
14
|
## Submodules
|
|
8
15
|
Stream | Submodule | Description
|
|
9
16
|
---|---|---
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/Users/kosyachniy/Desktop/chill/lib/env/bin/python
|
|
2
|
+
|
|
3
|
+
import sys
|
|
4
|
+
import json
|
|
5
|
+
import argparse
|
|
6
|
+
from pprint import pformat
|
|
7
|
+
|
|
8
|
+
import jmespath
|
|
9
|
+
from jmespath import exceptions
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def main():
|
|
13
|
+
parser = argparse.ArgumentParser()
|
|
14
|
+
parser.add_argument('expression')
|
|
15
|
+
parser.add_argument('-f', '--filename',
|
|
16
|
+
help=('The filename containing the input data. '
|
|
17
|
+
'If a filename is not given then data is '
|
|
18
|
+
'read from stdin.'))
|
|
19
|
+
parser.add_argument('--ast', action='store_true',
|
|
20
|
+
help=('Pretty print the AST, do not search the data.'))
|
|
21
|
+
args = parser.parse_args()
|
|
22
|
+
expression = args.expression
|
|
23
|
+
if args.ast:
|
|
24
|
+
# Only print the AST
|
|
25
|
+
expression = jmespath.compile(args.expression)
|
|
26
|
+
sys.stdout.write(pformat(expression.parsed))
|
|
27
|
+
sys.stdout.write('\n')
|
|
28
|
+
return 0
|
|
29
|
+
if args.filename:
|
|
30
|
+
with open(args.filename, 'r') as f:
|
|
31
|
+
data = json.load(f)
|
|
32
|
+
else:
|
|
33
|
+
data = sys.stdin.read()
|
|
34
|
+
data = json.loads(data)
|
|
35
|
+
try:
|
|
36
|
+
sys.stdout.write(json.dumps(
|
|
37
|
+
jmespath.search(expression, data), indent=4, ensure_ascii=False))
|
|
38
|
+
sys.stdout.write('\n')
|
|
39
|
+
except exceptions.ArityError as e:
|
|
40
|
+
sys.stderr.write("invalid-arity: %s\n" % e)
|
|
41
|
+
return 1
|
|
42
|
+
except exceptions.JMESPathTypeError as e:
|
|
43
|
+
sys.stderr.write("invalid-type: %s\n" % e)
|
|
44
|
+
return 1
|
|
45
|
+
except exceptions.UnknownFunctionError as e:
|
|
46
|
+
sys.stderr.write("unknown-function: %s\n" % e)
|
|
47
|
+
return 1
|
|
48
|
+
except exceptions.ParseError as e:
|
|
49
|
+
sys.stderr.write("syntax-error: %s\n" % e)
|
|
50
|
+
return 1
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
if __name__ == '__main__':
|
|
54
|
+
sys.exit(main())
|
|
@@ -2,11 +2,28 @@
|
|
|
2
2
|
Functionality of Amazon Web Services
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
import io
|
|
6
5
|
import base64
|
|
6
|
+
import io
|
|
7
7
|
|
|
8
8
|
import aiohttp
|
|
9
|
-
from PIL import Image,
|
|
9
|
+
from PIL import ExifTags, Image, UnidentifiedImageError
|
|
10
|
+
|
|
11
|
+
try:
|
|
12
|
+
from pillow_heif import register_heif_opener
|
|
13
|
+
except ImportError:
|
|
14
|
+
register_heif_opener = None
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
HEIC_SIGNATURES = (
|
|
18
|
+
b"ftypheic",
|
|
19
|
+
b"ftypheix",
|
|
20
|
+
b"ftyphevc",
|
|
21
|
+
b"ftyphevx",
|
|
22
|
+
b"ftypmif1",
|
|
23
|
+
b"ftypmsf1",
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
_HEIF_REGISTERED = False
|
|
10
27
|
|
|
11
28
|
|
|
12
29
|
def fix_rotation(image):
|
|
@@ -47,12 +64,39 @@ async def fetch_content(url):
|
|
|
47
64
|
return await response.read()
|
|
48
65
|
|
|
49
66
|
|
|
67
|
+
def _register_heif_plugins():
|
|
68
|
+
"""Enable HEIC/HEIF support if pillow_heif is installed."""
|
|
69
|
+
|
|
70
|
+
global _HEIF_REGISTERED
|
|
71
|
+
|
|
72
|
+
if _HEIF_REGISTERED or not register_heif_opener:
|
|
73
|
+
return
|
|
74
|
+
|
|
75
|
+
register_heif_opener()
|
|
76
|
+
_HEIF_REGISTERED = True
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def _looks_like_heic(data):
|
|
80
|
+
return any(signature in data[:32] for signature in HEIC_SIGNATURES)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def _normalize_image_type(image_type):
|
|
84
|
+
if image_type and image_type.lower() in ("heic", "heif"):
|
|
85
|
+
return "HEIF"
|
|
86
|
+
|
|
87
|
+
return image_type.upper() if image_type else image_type
|
|
88
|
+
|
|
89
|
+
|
|
50
90
|
async def convert(image, image_type="webp"):
|
|
51
91
|
"""Convert image format"""
|
|
52
92
|
|
|
53
93
|
if not image:
|
|
54
94
|
return None
|
|
55
95
|
|
|
96
|
+
_register_heif_plugins()
|
|
97
|
+
target_format = _normalize_image_type(image_type)
|
|
98
|
+
raw_image = None
|
|
99
|
+
|
|
56
100
|
if isinstance(image, str):
|
|
57
101
|
if image[:4] == "http":
|
|
58
102
|
image = await fetch_content(image)
|
|
@@ -62,13 +106,27 @@ async def convert(image, image_type="webp"):
|
|
|
62
106
|
image = base64.b64decode(image)
|
|
63
107
|
|
|
64
108
|
if isinstance(image, bytes):
|
|
65
|
-
|
|
66
|
-
|
|
109
|
+
raw_image = image
|
|
110
|
+
image = io.BytesIO(image)
|
|
111
|
+
|
|
112
|
+
try:
|
|
67
113
|
image = Image.open(image)
|
|
114
|
+
except UnidentifiedImageError as exc:
|
|
115
|
+
if raw_image and _looks_like_heic(raw_image) and not register_heif_opener:
|
|
116
|
+
raise ValueError(
|
|
117
|
+
"HEIC images require pillow-heif. Install pillow-heif to enable HEIC conversion."
|
|
118
|
+
) from exc
|
|
119
|
+
|
|
120
|
+
raise
|
|
121
|
+
|
|
122
|
+
if target_format == "HEIF" and not register_heif_opener:
|
|
123
|
+
raise ValueError(
|
|
124
|
+
"Saving as HEIC requires pillow-heif. Install pillow-heif to enable HEIC conversion."
|
|
125
|
+
)
|
|
68
126
|
|
|
69
127
|
image = fix_rotation(image)
|
|
70
128
|
image = image.convert("RGB")
|
|
71
129
|
data = io.BytesIO()
|
|
72
|
-
image.save(data, format=
|
|
130
|
+
image.save(data, format=target_format)
|
|
73
131
|
|
|
74
132
|
return data.getvalue()
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: libdev
|
|
3
|
+
Version: 0.98
|
|
4
|
+
Summary: Set of standard functions for development
|
|
5
|
+
Home-page: https://github.com/chilleco/lib
|
|
6
|
+
Author: Alex Poloz
|
|
7
|
+
Author-email: Alex Poloz <alexypoloz@gmail.com>
|
|
8
|
+
License: MIT License
|
|
9
|
+
|
|
10
|
+
Copyright (c) 2021 Alexey Poloz
|
|
11
|
+
|
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
in the Software without restriction, including without limitation the rights
|
|
15
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
furnished to do so, subject to the following conditions:
|
|
18
|
+
|
|
19
|
+
The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
copies or substantial portions of the Software.
|
|
21
|
+
|
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
SOFTWARE.
|
|
29
|
+
|
|
30
|
+
Project-URL: Source, https://github.com/chilleco/lib
|
|
31
|
+
Keywords: standard,lib,dev,development,cfg,config,generate,codes,tokens,ids,passwords,generator,ciphers,time,formatter,nlp,natural language,aws,s3,upload file,file server
|
|
32
|
+
Classifier: Development Status :: 4 - Beta
|
|
33
|
+
Classifier: Environment :: Console
|
|
34
|
+
Classifier: Intended Audience :: Developers
|
|
35
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
36
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
37
|
+
Classifier: Programming Language :: Python :: 3
|
|
38
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
41
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
42
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
43
|
+
Classifier: Operating System :: OS Independent
|
|
44
|
+
Requires-Python: >=3.10, <4
|
|
45
|
+
Description-Content-Type: text/markdown
|
|
46
|
+
License-File: LICENSE
|
|
47
|
+
Requires-Dist: aiohttp>=3.13.2
|
|
48
|
+
Requires-Dist: python-dotenv>=1.2.1
|
|
49
|
+
Requires-Dist: boto3>=1.42.0
|
|
50
|
+
Requires-Dist: Pillow>=12.0.0
|
|
51
|
+
Requires-Dist: pillow-heif>=1.0.0
|
|
52
|
+
Requires-Dist: loguru>=0.7.3
|
|
53
|
+
Provides-Extra: dev
|
|
54
|
+
Requires-Dist: build>=1.3.0; extra == "dev"
|
|
55
|
+
Requires-Dist: setuptools>=80.9.0; extra == "dev"
|
|
56
|
+
Requires-Dist: twine>=6.2.0; extra == "dev"
|
|
57
|
+
Requires-Dist: pylint>=4.0.4; extra == "dev"
|
|
58
|
+
Requires-Dist: pytest>=9.0.1; extra == "dev"
|
|
59
|
+
Requires-Dist: pytest-asyncio>=1.3.0; extra == "dev"
|
|
60
|
+
Dynamic: author
|
|
61
|
+
Dynamic: home-page
|
|
62
|
+
Dynamic: license-file
|
|
63
|
+
Dynamic: requires-python
|
|
64
|
+
|
|
65
|
+
# LibDev
|
|
66
|
+
Development library — Set of standard functions for development
|
|
67
|
+
|
|
68
|
+
[GitHub](https://github.com/chilleco/lib)
|
|
69
|
+
| [PyPI](https://pypi.org/project/libdev/)
|
|
70
|
+
|
|
71
|
+
## Requirements
|
|
72
|
+
- Python 3.10+ (dependencies are 3.14-ready)
|
|
73
|
+
|
|
74
|
+
## Installation
|
|
75
|
+
- Runtime: `pip install .`
|
|
76
|
+
- Dev / tests: `pip install .[dev]` or `make setup-dev`
|
|
77
|
+
|
|
78
|
+
## Submodules
|
|
79
|
+
Stream | Submodule | Description
|
|
80
|
+
---|---|---
|
|
81
|
+
System | ` libdev.cfg ` | Configuration getting
|
|
82
|
+
| ` libdev.req ` | AsyncIO requests (AIOHTTP wrapper)
|
|
83
|
+
| ` libdev.log ` | Logger (Loguru wrapper)
|
|
84
|
+
Data Format | ` libdev.num ` | Numeric conversions & handlers
|
|
85
|
+
| ` libdev.time ` | Time processing
|
|
86
|
+
Transforms | ` libdev.gen ` | Code & token generators
|
|
87
|
+
| ` libdev.codes ` | Ciphers: langs & flags / networks / user statuses
|
|
88
|
+
| ` libdev.check ` | Validation functions
|
|
89
|
+
| ` libdev.crypt ` | Encryption and decryption functions
|
|
90
|
+
Fields | ` libdev.dev ` | Development tools
|
|
91
|
+
| ` libdev.fin ` | Financial codes and tools
|
|
92
|
+
| ` libdev.lang ` | Natural language formatters
|
|
93
|
+
Files | ` libdev.doc ` | Base64 / JSON handlers
|
|
94
|
+
| ` libdev.s3 ` | S3 file server functions
|
|
95
|
+
| ` libdev.img ` | Image processing
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=80.9", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "libdev"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "Set of standard functions for development"
|
|
9
|
+
readme = { file = "README.md", content-type = "text/markdown" }
|
|
10
|
+
requires-python = ">=3.10, <4"
|
|
11
|
+
license = { file = "LICENSE" }
|
|
12
|
+
authors = [{ name = "Alex Poloz", email = "alexypoloz@gmail.com" }]
|
|
13
|
+
keywords = [
|
|
14
|
+
"standard",
|
|
15
|
+
"lib",
|
|
16
|
+
"dev",
|
|
17
|
+
"development",
|
|
18
|
+
"cfg",
|
|
19
|
+
"config",
|
|
20
|
+
"generate",
|
|
21
|
+
"codes",
|
|
22
|
+
"tokens",
|
|
23
|
+
"ids",
|
|
24
|
+
"passwords",
|
|
25
|
+
"generator",
|
|
26
|
+
"ciphers",
|
|
27
|
+
"time",
|
|
28
|
+
"formatter",
|
|
29
|
+
"nlp",
|
|
30
|
+
"natural language",
|
|
31
|
+
"aws",
|
|
32
|
+
"s3",
|
|
33
|
+
"upload file",
|
|
34
|
+
"file server",
|
|
35
|
+
]
|
|
36
|
+
classifiers = [
|
|
37
|
+
"Development Status :: 4 - Beta",
|
|
38
|
+
"Environment :: Console",
|
|
39
|
+
"Intended Audience :: Developers",
|
|
40
|
+
"Topic :: Software Development :: Libraries :: Application Frameworks",
|
|
41
|
+
"License :: OSI Approved :: MIT License",
|
|
42
|
+
"Programming Language :: Python :: 3",
|
|
43
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
44
|
+
"Programming Language :: Python :: 3.10",
|
|
45
|
+
"Programming Language :: Python :: 3.11",
|
|
46
|
+
"Programming Language :: Python :: 3.12",
|
|
47
|
+
"Programming Language :: Python :: 3.13",
|
|
48
|
+
"Operating System :: OS Independent",
|
|
49
|
+
]
|
|
50
|
+
dependencies = [
|
|
51
|
+
"aiohttp>=3.13.2",
|
|
52
|
+
"python-dotenv>=1.2.1",
|
|
53
|
+
"boto3>=1.42.0",
|
|
54
|
+
"Pillow>=12.0.0",
|
|
55
|
+
"pillow-heif>=1.0.0",
|
|
56
|
+
"loguru>=0.7.3",
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
[project.optional-dependencies]
|
|
60
|
+
dev = [
|
|
61
|
+
"build>=1.3.0",
|
|
62
|
+
"setuptools>=80.9.0",
|
|
63
|
+
"twine>=6.2.0",
|
|
64
|
+
"pylint>=4.0.4",
|
|
65
|
+
"pytest>=9.0.1",
|
|
66
|
+
"pytest-asyncio>=1.3.0",
|
|
67
|
+
]
|
|
68
|
+
|
|
69
|
+
[project.urls]
|
|
70
|
+
Source = "https://github.com/chilleco/lib"
|
|
71
|
+
|
|
72
|
+
[tool.setuptools.dynamic]
|
|
73
|
+
version = { attr = "libdev.__version__" }
|
|
74
|
+
|
|
75
|
+
[tool.setuptools.packages.find]
|
|
76
|
+
exclude = ["tests", "tests.*"]
|
|
@@ -4,31 +4,31 @@ Setup the Python package
|
|
|
4
4
|
|
|
5
5
|
import pathlib
|
|
6
6
|
import re
|
|
7
|
-
from setuptools import setup, find_packages
|
|
8
7
|
|
|
8
|
+
from setuptools import find_packages, setup
|
|
9
9
|
|
|
10
|
-
with open("README.md", "r", encoding="utf-8") as file:
|
|
11
|
-
long_description = file.read()
|
|
12
10
|
|
|
13
11
|
WORK_DIR = pathlib.Path(__file__).parent
|
|
14
12
|
|
|
13
|
+
with open(WORK_DIR / "README.md", "r", encoding="utf-8") as file:
|
|
14
|
+
LONG_DESCRIPTION = file.read()
|
|
15
|
+
|
|
15
16
|
|
|
16
17
|
def get_version():
|
|
17
|
-
"""
|
|
18
|
+
"""Extract version from package init."""
|
|
18
19
|
|
|
19
20
|
txt = (WORK_DIR / "libdev" / "__init__.py").read_text("utf-8")
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
raise RuntimeError("Unable to determine version") from e
|
|
21
|
+
match = re.search(r'^__version__ = "([^"]+)"', txt, re.M)
|
|
22
|
+
if not match:
|
|
23
|
+
raise RuntimeError("Unable to determine version")
|
|
24
|
+
return match.group(1)
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
setup(
|
|
28
28
|
name="libdev",
|
|
29
29
|
version=get_version(),
|
|
30
30
|
description="Set of standard functions for development",
|
|
31
|
-
long_description=
|
|
31
|
+
long_description=LONG_DESCRIPTION,
|
|
32
32
|
long_description_content_type="text/markdown",
|
|
33
33
|
url="https://github.com/chilleco/lib",
|
|
34
34
|
author="Alex Poloz",
|
|
@@ -40,6 +40,11 @@ setup(
|
|
|
40
40
|
"Topic :: Software Development :: Libraries :: Application Frameworks",
|
|
41
41
|
"License :: OSI Approved :: MIT License",
|
|
42
42
|
"Programming Language :: Python :: 3",
|
|
43
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
44
|
+
"Programming Language :: Python :: 3.10",
|
|
45
|
+
"Programming Language :: Python :: 3.11",
|
|
46
|
+
"Programming Language :: Python :: 3.12",
|
|
47
|
+
"Programming Language :: Python :: 3.13",
|
|
43
48
|
"Operating System :: OS Independent",
|
|
44
49
|
],
|
|
45
50
|
keywords=(
|
|
@@ -48,14 +53,14 @@ setup(
|
|
|
48
53
|
"natural language, aws, s3, upload file, file server"
|
|
49
54
|
),
|
|
50
55
|
packages=find_packages(exclude=("tests",)),
|
|
51
|
-
python_requires=">=3.
|
|
56
|
+
python_requires=">=3.10, <4",
|
|
52
57
|
install_requires=[
|
|
53
|
-
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"loguru",
|
|
58
|
+
"aiohttp>=3.13.2",
|
|
59
|
+
"python-dotenv>=1.2.1",
|
|
60
|
+
"boto3>=1.42.0",
|
|
61
|
+
"Pillow>=12.0.0",
|
|
62
|
+
"pillow-heif>=1.0.0",
|
|
63
|
+
"loguru>=0.7.3",
|
|
59
64
|
],
|
|
60
65
|
project_urls={
|
|
61
66
|
"Source": "https://github.com/chilleco/lib",
|
|
@@ -123,8 +123,8 @@ def test_get_month_start():
|
|
|
123
123
|
|
|
124
124
|
|
|
125
125
|
def test_get_previous_month():
|
|
126
|
-
assert get_previous_month() == 1759276800
|
|
127
|
-
assert get_previous_month(tz=3) == 1759266000
|
|
126
|
+
assert get_previous_month(1764497920.160952) == 1759276800
|
|
127
|
+
assert get_previous_month(1764497920, tz=3) == 1759266000
|
|
128
128
|
assert get_previous_month(1760648400, 1) == 1756681200
|
|
129
129
|
|
|
130
130
|
|
libdev-0.96/PKG-INFO
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: libdev
|
|
3
|
-
Version: 0.96
|
|
4
|
-
Summary: Set of standard functions for development
|
|
5
|
-
Home-page: https://github.com/chilleco/lib
|
|
6
|
-
Author: Alex Poloz
|
|
7
|
-
Author-email: alexypoloz@gmail.com
|
|
8
|
-
License: MIT
|
|
9
|
-
Project-URL: Source, https://github.com/chilleco/lib
|
|
10
|
-
Keywords: standard,lib,dev,development,cfg,config,generate,codes,tokens,ids,passwords,generator,ciphers,time,formatter,nlp,natural language,aws,s3,upload file,file server
|
|
11
|
-
Classifier: Development Status :: 4 - Beta
|
|
12
|
-
Classifier: Environment :: Console
|
|
13
|
-
Classifier: Intended Audience :: Developers
|
|
14
|
-
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
15
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
-
Classifier: Programming Language :: Python :: 3
|
|
17
|
-
Classifier: Operating System :: OS Independent
|
|
18
|
-
Requires-Python: >=3.7, <4
|
|
19
|
-
Description-Content-Type: text/markdown
|
|
20
|
-
License-File: LICENSE
|
|
21
|
-
Requires-Dist: aiohttp
|
|
22
|
-
Requires-Dist: python-dotenv
|
|
23
|
-
Requires-Dist: boto3
|
|
24
|
-
Requires-Dist: Pillow
|
|
25
|
-
Requires-Dist: loguru
|
|
26
|
-
|
|
27
|
-
# LibDev
|
|
28
|
-
Development library — Set of standard functions for development
|
|
29
|
-
|
|
30
|
-
[GitHub](https://github.com/chilleco/lib)
|
|
31
|
-
| [PyPI](https://pypi.org/project/libdev/)
|
|
32
|
-
|
|
33
|
-
## Submodules
|
|
34
|
-
Stream | Submodule | Description
|
|
35
|
-
---|---|---
|
|
36
|
-
System | ` libdev.cfg ` | Configuration getting
|
|
37
|
-
| ` libdev.req ` | AsyncIO requests (AIOHTTP wrapper)
|
|
38
|
-
| ` libdev.log ` | Logger (Loguru wrapper)
|
|
39
|
-
Data Format | ` libdev.num ` | Numeric conversions & handlers
|
|
40
|
-
| ` libdev.time ` | Time processing
|
|
41
|
-
Transforms | ` libdev.gen ` | Code & token generators
|
|
42
|
-
| ` libdev.codes ` | Ciphers: langs & flags / networks / user statuses
|
|
43
|
-
| ` libdev.check ` | Validation functions
|
|
44
|
-
| ` libdev.crypt ` | Encryption and decryption functions
|
|
45
|
-
Fields | ` libdev.dev ` | Development tools
|
|
46
|
-
| ` libdev.fin ` | Financial codes and tools
|
|
47
|
-
| ` libdev.lang ` | Natural language formatters
|
|
48
|
-
Files | ` libdev.doc ` | Base64 / JSON handlers
|
|
49
|
-
| ` libdev.s3 ` | S3 file server functions
|
|
50
|
-
| ` libdev.img ` | Image processing
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: libdev
|
|
3
|
-
Version: 0.96
|
|
4
|
-
Summary: Set of standard functions for development
|
|
5
|
-
Home-page: https://github.com/chilleco/lib
|
|
6
|
-
Author: Alex Poloz
|
|
7
|
-
Author-email: alexypoloz@gmail.com
|
|
8
|
-
License: MIT
|
|
9
|
-
Project-URL: Source, https://github.com/chilleco/lib
|
|
10
|
-
Keywords: standard,lib,dev,development,cfg,config,generate,codes,tokens,ids,passwords,generator,ciphers,time,formatter,nlp,natural language,aws,s3,upload file,file server
|
|
11
|
-
Classifier: Development Status :: 4 - Beta
|
|
12
|
-
Classifier: Environment :: Console
|
|
13
|
-
Classifier: Intended Audience :: Developers
|
|
14
|
-
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
15
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
-
Classifier: Programming Language :: Python :: 3
|
|
17
|
-
Classifier: Operating System :: OS Independent
|
|
18
|
-
Requires-Python: >=3.7, <4
|
|
19
|
-
Description-Content-Type: text/markdown
|
|
20
|
-
License-File: LICENSE
|
|
21
|
-
Requires-Dist: aiohttp
|
|
22
|
-
Requires-Dist: python-dotenv
|
|
23
|
-
Requires-Dist: boto3
|
|
24
|
-
Requires-Dist: Pillow
|
|
25
|
-
Requires-Dist: loguru
|
|
26
|
-
|
|
27
|
-
# LibDev
|
|
28
|
-
Development library — Set of standard functions for development
|
|
29
|
-
|
|
30
|
-
[GitHub](https://github.com/chilleco/lib)
|
|
31
|
-
| [PyPI](https://pypi.org/project/libdev/)
|
|
32
|
-
|
|
33
|
-
## Submodules
|
|
34
|
-
Stream | Submodule | Description
|
|
35
|
-
---|---|---
|
|
36
|
-
System | ` libdev.cfg ` | Configuration getting
|
|
37
|
-
| ` libdev.req ` | AsyncIO requests (AIOHTTP wrapper)
|
|
38
|
-
| ` libdev.log ` | Logger (Loguru wrapper)
|
|
39
|
-
Data Format | ` libdev.num ` | Numeric conversions & handlers
|
|
40
|
-
| ` libdev.time ` | Time processing
|
|
41
|
-
Transforms | ` libdev.gen ` | Code & token generators
|
|
42
|
-
| ` libdev.codes ` | Ciphers: langs & flags / networks / user statuses
|
|
43
|
-
| ` libdev.check ` | Validation functions
|
|
44
|
-
| ` libdev.crypt ` | Encryption and decryption functions
|
|
45
|
-
Fields | ` libdev.dev ` | Development tools
|
|
46
|
-
| ` libdev.fin ` | Financial codes and tools
|
|
47
|
-
| ` libdev.lang ` | Natural language formatters
|
|
48
|
-
Files | ` libdev.doc ` | Base64 / JSON handlers
|
|
49
|
-
| ` libdev.s3 ` | S3 file server functions
|
|
50
|
-
| ` libdev.img ` | Image processing
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
libdev
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|