ezKit 3.0.63__tar.gz → 3.0.64__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ezKit
3
- Version: 3.0.63
3
+ Version: 3.0.64
4
4
  Summary: Easy Kit
5
5
  Author: septvean
6
6
  Author-email: septvean@gmail.com
@@ -5,11 +5,13 @@ import subprocess
5
5
  import time
6
6
  import tomllib
7
7
  from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
8
+ from copy import deepcopy
8
9
  from datetime import date, datetime, time as datetime_time, tzinfo
9
10
  from decimal import Decimal
10
11
  from functools import wraps
11
12
  from ipaddress import IPv4Address, IPv6Address
12
13
  from itertools import islice
14
+ from operator import itemgetter
13
15
  from os import environ
14
16
  from pathlib import Path
15
17
  from secrets import choice
@@ -702,3 +704,16 @@ def split_dict(data: dict, keys: list) -> tuple[dict[Any, Any], dict[Any, Any]]
702
704
  logger.error(e)
703
705
 
704
706
  return None
707
+
708
+
709
+ def sort_dicts(dicts: list[dict], key: str, *, reverse: bool = False) -> list[dict] | None:
710
+ """字典列表排序"""
711
+ try:
712
+ new_dicts = deepcopy(dicts)
713
+ return sorted(new_dicts, key=itemgetter(key), reverse=reverse)
714
+ except Exception as e:
715
+ if DEBUG:
716
+ logger.exception(e)
717
+ else:
718
+ logger.error(e)
719
+ return None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ezKit
3
- Version: 3.0.63
3
+ Version: 3.0.64
4
4
  Summary: Easy Kit
5
5
  Author: septvean
6
6
  Author-email: septvean@gmail.com
@@ -4,7 +4,7 @@ from setuptools import find_packages, setup
4
4
 
5
5
  setup(
6
6
  name="ezKit",
7
- version="3.0.63",
7
+ version="3.0.64",
8
8
  author="septvean",
9
9
  author_email="septvean@gmail.com",
10
10
  description="Easy Kit",
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