python-base-toolkit 1.0.4__tar.gz → 1.0.5__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.
- {python_base_toolkit-1.0.4/python_base_toolkit.egg-info → python_base_toolkit-1.0.5}/PKG-INFO +1 -1
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/pyproject.toml +1 -1
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/decorators/timer.py +6 -5
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5/python_base_toolkit.egg-info}/PKG-INFO +1 -1
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/LICENSE +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/MANIFEST.in +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/README.md +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/Taskfile.yml +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/__init__.py +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/base_structures/__init__.py +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/base_structures/base_enum.py +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/base_structures/base_pydantic_model.py +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/ci/task_files/default.yml +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/ci/task_files/dependencies.yml +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/ci/task_files/deploy.yml +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/ci/task_files/docker.yml +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/ci/task_files/includes.yml +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/ci/task_files/install.yml +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/ci/task_files/lint.yml +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/ci/task_files/vars.yml +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/consts/__init__.py +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/consts/operating_system.py +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/consts/units/__init__.py +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/consts/units/binary_units.py +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/consts/units/time_units.py +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/decorators/__init__.py +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/decorators/telemetry.py +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/instances/__init__.py +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/instances/instance_manager.py +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/scripts/__init__.py +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/scripts/remove_build_files.py +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/utils/__init__.py +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/utils/data_serialization.py +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/utils/date_time.py +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/utils/execute.py +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/utils/file_utils.py +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/utils/generate_id.py +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/utils/logo.py +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/utils/network.py +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/utils/path_utils.py +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/utils/pretty_print.py +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/utils/pycache.py +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/utils/random_utils.py +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/utils/shorten_url.py +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/utils/venv_details.py +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit.egg-info/SOURCES.txt +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit.egg-info/dependency_links.txt +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit.egg-info/not-zip-safe +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit.egg-info/requires.txt +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit.egg-info/top_level.txt +0 -0
- {python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/setup.cfg +0 -0
{python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/decorators/timer.py
RENAMED
|
@@ -9,27 +9,28 @@ logger = get_logger(__name__)
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class Timer:
|
|
12
|
-
def __init__(self) -> None:
|
|
12
|
+
def __init__(self, name: str | None = None) -> None:
|
|
13
|
+
self.name = name
|
|
13
14
|
self.start_time = None
|
|
14
15
|
self.end_time = None
|
|
15
16
|
self.elapsed_time = None
|
|
16
17
|
|
|
17
18
|
def __enter__(self) -> "Timer":
|
|
18
19
|
self.start_time = time.perf_counter()
|
|
19
|
-
logger.info("Timer started.")
|
|
20
|
+
logger.info(f"Timer started for function: {self.name}")
|
|
20
21
|
return self
|
|
21
22
|
|
|
22
23
|
def __exit__(self, exc_type: type, exc_value: Exception, exc_traceback: object) -> None:
|
|
23
|
-
# logger.info(exc_type, exc_value, exc_traceback)
|
|
24
24
|
self.end_time = time.perf_counter()
|
|
25
25
|
self.elapsed_time = self.end_time - self.start_time
|
|
26
|
-
logger.info(f"Timer stopped
|
|
26
|
+
logger.info(f"Timer stopped for function: {self.name}")
|
|
27
|
+
logger.info(f"Elapsed time for function: {self.name}: {self.elapsed_time}")
|
|
27
28
|
|
|
28
29
|
|
|
29
30
|
def timer(func: Callable[..., Any]) -> Callable[..., Any]:
|
|
30
31
|
@wraps(func)
|
|
31
32
|
def wrapper(*args: Any, **kwargs: Any) -> Any:
|
|
32
|
-
with Timer():
|
|
33
|
+
with Timer(func.__name__):
|
|
33
34
|
return func(*args, **kwargs)
|
|
34
35
|
|
|
35
36
|
return wrapper
|
|
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
|
{python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/ci/task_files/deploy.yml
RENAMED
|
File without changes
|
{python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/ci/task_files/docker.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/ci/task_files/lint.yml
RENAMED
|
File without changes
|
{python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/ci/task_files/vars.yml
RENAMED
|
File without changes
|
{python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/consts/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/consts/units/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/decorators/__init__.py
RENAMED
|
File without changes
|
{python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/decorators/telemetry.py
RENAMED
|
File without changes
|
{python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/instances/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/scripts/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/utils/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/utils/date_time.py
RENAMED
|
File without changes
|
{python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/utils/execute.py
RENAMED
|
File without changes
|
{python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/utils/file_utils.py
RENAMED
|
File without changes
|
{python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/utils/generate_id.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/utils/network.py
RENAMED
|
File without changes
|
{python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/utils/path_utils.py
RENAMED
|
File without changes
|
{python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/utils/pretty_print.py
RENAMED
|
File without changes
|
{python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/utils/pycache.py
RENAMED
|
File without changes
|
{python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/utils/random_utils.py
RENAMED
|
File without changes
|
{python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/utils/shorten_url.py
RENAMED
|
File without changes
|
{python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit/utils/venv_details.py
RENAMED
|
File without changes
|
{python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit.egg-info/not-zip-safe
RENAMED
|
File without changes
|
{python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit.egg-info/requires.txt
RENAMED
|
File without changes
|
{python_base_toolkit-1.0.4 → python_base_toolkit-1.0.5}/python_base_toolkit.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|