purem 2.1.6__py3-none-any.whl → 3.0.2__py3-none-any.whl
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.
- purem/__init__.py +1 -2
- purem/core.py +180 -69
- purem/env_config.py +1 -1
- purem/file_structure.py +1 -1
- purem/loader.py +60 -1
- purem/logger.py +3 -3
- purem/utils.py +1 -1
- {purem-2.1.6.dist-info → purem-3.0.2.dist-info}/METADATA +3 -2
- purem-3.0.2.dist-info/RECORD +12 -0
- {purem-2.1.6.dist-info → purem-3.0.2.dist-info}/WHEEL +1 -1
- purem-2.1.6.dist-info/RECORD +0 -12
- {purem-2.1.6.dist-info → purem-3.0.2.dist-info}/licenses/LICENSE +0 -0
- {purem-2.1.6.dist-info → purem-3.0.2.dist-info}/top_level.txt +0 -0
purem/__init__.py
CHANGED
purem/core.py
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
Business Source License 1.1
|
3
3
|
|
4
4
|
Copyright (C) 2025 Raman Marozau, raman@worktif.com
|
5
|
-
Use of this software is governed by the Business Source License included in the LICENSE
|
5
|
+
Use of this software is governed by the Business Source License included in the LICENSE file and at www.mariadb.com/bsl11.
|
6
6
|
|
7
7
|
Change Date: Never
|
8
8
|
On the date above, in accordance with the Business Source License, use of this software will be governed by the open source license specified in the LICENSE file.
|
@@ -11,7 +11,6 @@ Additional Use Grant: Free for personal and non-commercial research use only.
|
|
11
11
|
SPDX-License-Identifier: BUSL-1.1
|
12
12
|
"""
|
13
13
|
|
14
|
-
import base64
|
15
14
|
import ctypes
|
16
15
|
import json
|
17
16
|
import os
|
@@ -19,83 +18,102 @@ import shutil
|
|
19
18
|
import ssl
|
20
19
|
import urllib.request
|
21
20
|
import zipfile
|
22
|
-
from
|
21
|
+
from pathlib import Path
|
22
|
+
from typing import Optional, Dict
|
23
23
|
|
24
24
|
import certifi as certifi
|
25
|
-
import numpy as np
|
26
25
|
from numpy import ndarray
|
27
26
|
|
28
|
-
from purem.env_config import load_env_config
|
27
|
+
from purem.env_config import load_env_config, EnvConfig
|
29
28
|
from purem.file_structure import FileStructure
|
30
29
|
from purem.loader import Loader
|
31
30
|
from purem.logger import Logger
|
32
|
-
from purem.utils import _compute_shifted_jit
|
33
31
|
|
34
32
|
|
35
33
|
class Purem:
|
36
34
|
"""
|
37
|
-
|
35
|
+
Represents the functionality of the Purem system, including initialization, configuration,
|
36
|
+
and operations using a shared library binary. The class provides methods for setting up
|
37
|
+
license keys, managing binary paths, loading configurations from a Content Delivery Network (CDN),
|
38
|
+
and executing specific computations such as the softmax function. It handles both high-level
|
39
|
+
configuration details and low-level interactions with binary libraries.
|
38
40
|
|
39
|
-
The
|
40
|
-
operation of the Purem environment and its associated runtime, including license management,
|
41
|
-
binary handling, and API configuration. It centralizes the setup of the Purem runtime,
|
42
|
-
ensuring that all necessary binaries, license checks, and configurations are in place.
|
43
|
-
|
44
|
-
The class supports downloading and extracting binaries, setting up runtime libraries, and providing utility
|
45
|
-
methods such as softmax computation, license validation, and URL construction to interact with remote
|
46
|
-
and local systems.
|
47
|
-
|
48
|
-
:ivar _license_key: The license key used for Purem initialization and validation.
|
41
|
+
:ivar _license_key: The license key used to initialize the system.
|
49
42
|
:type _license_key: Optional[str]
|
50
|
-
:ivar _lib:
|
51
|
-
:type _lib: ctypes.CDLL
|
52
|
-
:ivar _download_binary_url:
|
43
|
+
:ivar _lib: Represents the dynamically loaded shared library for performing operations.
|
44
|
+
:type _lib: Optional[ctypes.CDLL]
|
45
|
+
:ivar _download_binary_url: URL for downloading the binary configuration.
|
53
46
|
:type _download_binary_url: Optional[str]
|
54
|
-
:ivar _ctx: SSL context
|
47
|
+
:ivar _ctx: SSL context for establishing secure connections.
|
55
48
|
:type _ctx: ssl.SSLContext
|
56
|
-
:ivar _file_structure:
|
49
|
+
:ivar _file_structure: The handler for managing binary-related paths and file structure.
|
57
50
|
:type _file_structure: FileStructure
|
58
|
-
:ivar _binary_path:
|
59
|
-
:type _binary_path:
|
60
|
-
:ivar _binary_project_root_path:
|
61
|
-
:type _binary_project_root_path:
|
62
|
-
:ivar _binary_archive_path:
|
63
|
-
:type _binary_archive_path:
|
64
|
-
:ivar _binary_archive_path_tmp:
|
65
|
-
:type _binary_archive_path_tmp:
|
66
|
-
:ivar _env:
|
51
|
+
:ivar _binary_path: Absolute path of the binary file used for execution.
|
52
|
+
:type _binary_path: str
|
53
|
+
:ivar _binary_project_root_path: Path to the binary located in the project root.
|
54
|
+
:type _binary_project_root_path: str
|
55
|
+
:ivar _binary_archive_path: Path where binary archives are stored.
|
56
|
+
:type _binary_archive_path: str
|
57
|
+
:ivar _binary_archive_path_tmp: Temporary path for binary archive operations.
|
58
|
+
:type _binary_archive_path_tmp: str
|
59
|
+
:ivar _env: Object holding environment configurations and variables.
|
67
60
|
:type _env: Any
|
68
|
-
:ivar _config_url: URL for retrieving Purem configuration
|
61
|
+
:ivar _config_url: URL for retrieving Purem's configuration from a remote server.
|
69
62
|
:type _config_url: str
|
70
|
-
:ivar _loader: Loader
|
63
|
+
:ivar _loader: Loader instance for displaying runtime messages during setup and initialization.
|
71
64
|
:type _loader: Loader
|
72
|
-
:ivar _log: Logger
|
65
|
+
:ivar _log: Logger instance for recording system messages and error details.
|
73
66
|
:type _log: Logger
|
74
67
|
"""
|
75
68
|
|
76
|
-
def __init__(self
|
77
|
-
|
78
|
-
|
79
|
-
|
69
|
+
def __init__(self):
|
70
|
+
"""
|
71
|
+
Represents the initialization and configuration of an environment, license key,
|
72
|
+
and file structure required for the system's binary operations.
|
73
|
+
|
74
|
+
:param licenced_key: Optional license key string for initializing the system.
|
75
|
+
:type licenced_key: Optional[str]
|
76
|
+
"""
|
77
|
+
self._lib: Optional[ctypes.CDLL] = None
|
78
|
+
self._download_binary_url: Optional[str] = None
|
80
79
|
self._ctx = ssl.create_default_context(cafile=certifi.where())
|
81
80
|
self._file_structure = FileStructure()
|
82
|
-
self._binary_path = self._file_structure.get_binary_path()
|
83
|
-
self._binary_project_root_path = (
|
81
|
+
self._binary_path: Path = self._file_structure.get_binary_path()
|
82
|
+
self._binary_project_root_path: Path = (
|
84
83
|
self._file_structure.get_binary_project_root_path()
|
85
84
|
)
|
86
|
-
self._binary_archive_path = self._file_structure.get_binary_archive_path()
|
87
|
-
self._binary_archive_path_tmp = (
|
85
|
+
self._binary_archive_path: Path = self._file_structure.get_binary_archive_path()
|
86
|
+
self._binary_archive_path_tmp: Path = (
|
88
87
|
self._file_structure.get_binary_archive_path_tmp()
|
89
88
|
)
|
90
|
-
self._env = load_env_config()
|
91
|
-
self.
|
89
|
+
self._env: EnvConfig = load_env_config()
|
90
|
+
self._license_key: Optional[str] = self._env.PUREM_LICENSE_KEY or None
|
91
|
+
self._config_url: str = (
|
92
92
|
self._env.PUREM_CONFIG_URL
|
93
93
|
or "https://api.worktif.com/v2/portal/products/purem/config"
|
94
94
|
)
|
95
|
-
self._loader = Loader()
|
96
|
-
self._log = Logger()
|
95
|
+
self._loader: Loader = Loader()
|
96
|
+
self._log: Logger = Logger()
|
97
|
+
print('self._license_key: ', self._license_key)
|
98
|
+
|
99
|
+
if self._license_key is not None:
|
100
|
+
self.configure(license_key=self._license_key)
|
97
101
|
|
98
102
|
def configure(self, license_key: Optional[str] = None) -> None:
|
103
|
+
"""
|
104
|
+
Configures the system with a given license key.
|
105
|
+
|
106
|
+
This method sets up the license key required for initializing the system. If no
|
107
|
+
license key is provided during configuration, the method checks if it was
|
108
|
+
already initialized. If the license key remains unset, it raises a ValueError
|
109
|
+
to indicate that a valid license key is mandatory for the setup.
|
110
|
+
|
111
|
+
:raises ValueError: Raised when no valid license key is provided during
|
112
|
+
configuration.
|
113
|
+
|
114
|
+
:param license_key: An optional string representing the license key.
|
115
|
+
:return: None
|
116
|
+
"""
|
99
117
|
if self._license_key is None and license_key is not None:
|
100
118
|
self._license_key = license_key
|
101
119
|
if self._license_key is None:
|
@@ -109,30 +127,50 @@ class Purem:
|
|
109
127
|
self._set_binary()
|
110
128
|
|
111
129
|
def softmax(self, array: ndarray) -> ndarray:
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
130
|
+
try:
|
131
|
+
ptr = array.ctypes.data_as(ctypes.POINTER(ctypes.c_float))
|
132
|
+
self._lib.purem(ptr, array.size)
|
133
|
+
return array
|
134
|
+
except Exception as e:
|
135
|
+
raise ValueError(
|
136
|
+
self._log.info(
|
137
|
+
"Purem requires a valid license key to initialize.\n"
|
138
|
+
"You can obtain your key at https://worktif.com or through your enterprise deployment.",
|
139
|
+
verbose=True
|
140
|
+
)
|
141
|
+
)
|
117
142
|
|
118
|
-
def softmax_pure(self,
|
143
|
+
def softmax_pure(self, ptr, size) -> None:
|
119
144
|
"""
|
120
|
-
|
145
|
+
Computes the softmax function on the provided array using pure library implementation.
|
121
146
|
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
employs a pure implementation by calling a pre-defined library function.
|
147
|
+
This function applies the softmax transformation to the data pointed to by the
|
148
|
+
pointer and modifies it in-place. The underlying implementation is handled
|
149
|
+
by a pure library function call.
|
126
150
|
|
127
|
-
:param
|
128
|
-
|
129
|
-
:param size: The
|
130
|
-
:
|
131
|
-
|
151
|
+
:param ptr: Pointer to the data array that the softmax is to be applied on.
|
152
|
+
:type ptr: Any
|
153
|
+
:param size: The number of elements in the data array to be processed.
|
154
|
+
:type size: int
|
155
|
+
:return: None
|
132
156
|
"""
|
133
|
-
|
157
|
+
self._lib.purem(ptr, size)
|
134
158
|
|
135
159
|
def _build_url(self, config: dict) -> Optional[str]:
|
160
|
+
"""
|
161
|
+
Constructs a URL based on the provided configuration dictionary. The method
|
162
|
+
combines protocol, base URL, path, and appends a license key to generate
|
163
|
+
a complete binary URL. If the provided configuration is None, the method
|
164
|
+
returns None immediately.
|
165
|
+
|
166
|
+
:param config: A dictionary containing the parts needed to construct the
|
167
|
+
URL. The keys usually include:
|
168
|
+
- `base_url`: The base of the URL (e.g., domain).
|
169
|
+
- `protocol`: The URL protocol (e.g., "http" or "https").
|
170
|
+
- `pathname`: The path to append to the base URL.
|
171
|
+
:return: Returns the complete binary URL as a string if the configuration
|
172
|
+
is valid. If the given configuration is None, it returns None.
|
173
|
+
"""
|
136
174
|
if config is None:
|
137
175
|
return None
|
138
176
|
base = config.get("base_url", "").rstrip("/")
|
@@ -141,17 +179,52 @@ class Purem:
|
|
141
179
|
binary_url = f"{protocol}://{base}/{path}{self._license_key}"
|
142
180
|
return binary_url
|
143
181
|
|
144
|
-
def _tune_binary(self):
|
182
|
+
def _tune_binary(self) -> None:
|
183
|
+
"""
|
184
|
+
Tunes the binary by loading the specified binary file as a shared library
|
185
|
+
and setting up its function signatures for further use.
|
186
|
+
|
187
|
+
This method initializes the shared library from the specified `_binary_path`
|
188
|
+
and configures the expected argument types and return type for the `purem` function
|
189
|
+
provided by the library.
|
190
|
+
|
191
|
+
:raises OSError: If the library at `_binary_path` cannot be loaded by `ctypes.CDLL`.
|
192
|
+
|
193
|
+
:rtype: None
|
194
|
+
"""
|
145
195
|
self._lib = ctypes.CDLL(str(self._binary_path))
|
146
196
|
self._lib.purem.argtypes = [ctypes.POINTER(ctypes.c_float), ctypes.c_size_t]
|
147
197
|
self._lib.purem.restype = None
|
148
198
|
|
149
|
-
def _tune_project_root_binary(self):
|
199
|
+
def _tune_project_root_binary(self) -> None:
|
200
|
+
"""
|
201
|
+
Tuning the project root binary configuration.
|
202
|
+
|
203
|
+
This private method initializes a connection to the binary library
|
204
|
+
located at the project's root path. It achieves this by loading the
|
205
|
+
binary through the use of the `ctypes.CDLL` method. The method also
|
206
|
+
sets expected argument types and a return type for a specific function
|
207
|
+
available in the shared library.
|
208
|
+
|
209
|
+
:return: None
|
210
|
+
"""
|
150
211
|
self._lib = ctypes.CDLL(str(self._binary_project_root_path))
|
151
212
|
self._lib.purem.argtypes = [ctypes.POINTER(ctypes.c_float), ctypes.c_size_t]
|
152
213
|
self._lib.purem.restype = None
|
153
214
|
|
154
215
|
def _load_from_latest_cdn_index(self) -> Optional[Dict]:
|
216
|
+
"""
|
217
|
+
Attempts to load the latest configuration from a CDN index, if a config URL is provided.
|
218
|
+
The method sends a request to the configured URL, reads its response, and parses it into
|
219
|
+
a dictionary. If there is no configured URL or an exception occurs during the process, it
|
220
|
+
returns None.
|
221
|
+
|
222
|
+
:raises Exception: If an error occurs during the request or while reading the response.
|
223
|
+
|
224
|
+
:return: A dictionary containing the parsed configuration data if the operation is
|
225
|
+
successful, or None if no config URL is provided or an error occurs.
|
226
|
+
:rtype: Optional[Dict]
|
227
|
+
"""
|
155
228
|
try:
|
156
229
|
if self._config_url is not None:
|
157
230
|
req = urllib.request.Request(
|
@@ -166,7 +239,22 @@ class Purem:
|
|
166
239
|
except Exception:
|
167
240
|
return None
|
168
241
|
|
169
|
-
def _set_binary(self):
|
242
|
+
def _set_binary(self) -> None:
|
243
|
+
"""
|
244
|
+
Sets and initializes the binary for the Purem runtime environment. The method ensures that a valid binary
|
245
|
+
is available and properly configured. If a valid license key or binary is not found, the method will attempt
|
246
|
+
to download, validate, and extract the required binary files. If initialization fails at any stage,
|
247
|
+
appropriate errors are raised with detailed logging for debugging and support purposes.
|
248
|
+
|
249
|
+
:param self: Represents the instance of the class.
|
250
|
+
:type self: PuremRuntime
|
251
|
+
|
252
|
+
:raises ValueError: Raised if a valid license key is missing and cannot proceed with initialization.
|
253
|
+
:raises RuntimeError: Raised if the purem binary fails to load or cannot be initialized due to local issues,
|
254
|
+
license mismatch, or any other unexpected errors.
|
255
|
+
|
256
|
+
:return: None
|
257
|
+
"""
|
170
258
|
if os.path.exists(self._binary_path):
|
171
259
|
self._tune_binary()
|
172
260
|
elif os.path.exists(self._binary_project_root_path):
|
@@ -211,10 +299,20 @@ class Purem:
|
|
211
299
|
)
|
212
300
|
)
|
213
301
|
|
214
|
-
def _download_and_extract_binary(self):
|
302
|
+
def _download_and_extract_binary(self) -> None:
|
303
|
+
"""
|
304
|
+
Downloads a binary file from a given URL, saves it temporarily, and extracts its
|
305
|
+
contents to a specific directory. Handles errors related to incomplete or
|
306
|
+
corrupted downloads and archives.
|
307
|
+
|
308
|
+
Raises runtime errors with detailed context if an issue occurs during download
|
309
|
+
or extraction. Ensures successful extraction and logs the output location.
|
310
|
+
|
311
|
+
:raises RuntimeError: If the download or extraction process fails due to
|
312
|
+
corrupted archive or any other unexpected issue.
|
313
|
+
"""
|
215
314
|
req = urllib.request.Request(
|
216
|
-
self._download_binary_url,
|
217
|
-
headers={"User-Agent": "Mozilla/5.0"}
|
315
|
+
self._download_binary_url, headers={"User-Agent": "Mozilla/5.0"}
|
218
316
|
)
|
219
317
|
|
220
318
|
try:
|
@@ -250,3 +348,16 @@ class Purem:
|
|
250
348
|
)
|
251
349
|
|
252
350
|
self._binary_archive_path.unlink()
|
351
|
+
|
352
|
+
def has_license_key(self) -> bool:
|
353
|
+
"""
|
354
|
+
Checks if an object has a valid license key.
|
355
|
+
|
356
|
+
This method evaluates whether the `_license_key` attribute of
|
357
|
+
the object is not `None`, implying the presence of a license key.
|
358
|
+
|
359
|
+
:return: Returns `True` if the `_license_key` attribute is not
|
360
|
+
`None`, otherwise returns `False`.
|
361
|
+
:rtype: bool
|
362
|
+
"""
|
363
|
+
return self._license_key is not None
|
purem/env_config.py
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
Business Source License 1.1
|
3
3
|
|
4
4
|
Copyright (C) 2025 Raman Marozau, raman@worktif.com
|
5
|
-
Use of this software is governed by the Business Source License included in the LICENSE
|
5
|
+
Use of this software is governed by the Business Source License included in the LICENSE file and at www.mariadb.com/bsl11.
|
6
6
|
|
7
7
|
Change Date: Never
|
8
8
|
On the date above, in accordance with the Business Source License, use of this software will be governed by the open source license specified in the LICENSE file.
|
purem/file_structure.py
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
Business Source License 1.1
|
3
3
|
|
4
4
|
Copyright (C) 2025 Raman Marozau, raman@worktif.com
|
5
|
-
Use of this software is governed by the Business Source License included in the LICENSE
|
5
|
+
Use of this software is governed by the Business Source License included in the LICENSE file and at www.mariadb.com/bsl11.
|
6
6
|
|
7
7
|
Change Date: Never
|
8
8
|
On the date above, in accordance with the Business Source License, use of this software will be governed by the open source license specified in the LICENSE file.
|
purem/loader.py
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
Business Source License 1.1
|
3
3
|
|
4
4
|
Copyright (C) 2025 Raman Marozau, raman@worktif.com
|
5
|
-
Use of this software is governed by the Business Source License included in the LICENSE
|
5
|
+
Use of this software is governed by the Business Source License included in the LICENSE file and at www.mariadb.com/bsl11.
|
6
6
|
|
7
7
|
Change Date: Never
|
8
8
|
On the date above, in accordance with the Business Source License, use of this software will be governed by the open source license specified in the LICENSE file.
|
@@ -18,21 +18,80 @@ import time
|
|
18
18
|
|
19
19
|
class Loader:
|
20
20
|
def __init__(self, message="Downloading"):
|
21
|
+
"""
|
22
|
+
Represents a CLI-based animation that indicates a background task.
|
23
|
+
|
24
|
+
This class is designed to show a simple animation in the terminal
|
25
|
+
to convey the progress of an ongoing background task. The animation
|
26
|
+
runs in a separate thread to ensure that it does not block the main
|
27
|
+
thread's operations.
|
28
|
+
|
29
|
+
Attributes
|
30
|
+
----------
|
31
|
+
_message : str
|
32
|
+
The text message displayed along with the animation.
|
33
|
+
_thread : threading.Thread
|
34
|
+
The thread responsible for running the animation in the background.
|
35
|
+
done : bool
|
36
|
+
A control flag to stop the animation when set to True.
|
37
|
+
|
38
|
+
:param message: The message to display alongside the animation. Defaults to
|
39
|
+
"Downloading".
|
40
|
+
"""
|
21
41
|
self._message = message
|
22
42
|
self._thread = threading.Thread(target=self._animate, daemon=True)
|
23
43
|
self.done = False
|
24
44
|
|
25
45
|
def set_message(self, message: str):
|
46
|
+
"""
|
47
|
+
Sets the message attribute of the instance.
|
48
|
+
|
49
|
+
:param message: A string representing the message to be assigned.
|
50
|
+
:type message: str
|
51
|
+
"""
|
26
52
|
self._message = message
|
27
53
|
|
28
54
|
def start(self):
|
55
|
+
"""
|
56
|
+
Starts the thread associated with this instance.
|
57
|
+
|
58
|
+
This method initiates the thread's execution by invoking the `start`
|
59
|
+
method on the `self._thread` object. It assumes that the `self._thread`
|
60
|
+
attribute has been properly initialized and is a valid thread instance.
|
61
|
+
|
62
|
+
:return: None
|
63
|
+
"""
|
29
64
|
self._thread.start()
|
30
65
|
|
31
66
|
def stop(self):
|
67
|
+
"""
|
68
|
+
Represents a mechanism to stop a thread execution gracefully.
|
69
|
+
|
70
|
+
This class or function provides a controlled way to stop a running thread
|
71
|
+
by marking it as done and waiting for the thread to conclude its execution.
|
72
|
+
It ensures the thread completes its ongoing tasks correctly before stopping.
|
73
|
+
|
74
|
+
:attributes:
|
75
|
+
done: Indicates whether the thread execution is flagged to stop.
|
76
|
+
_thread: The thread instance being managed.
|
77
|
+
|
78
|
+
:return: None
|
79
|
+
"""
|
32
80
|
self.done = True
|
33
81
|
self._thread.join()
|
34
82
|
|
35
83
|
def _animate(self):
|
84
|
+
"""
|
85
|
+
Handles the animation of a loading spinner for a CLI-based task. The animation
|
86
|
+
displays a series of symbols in rotation while the task is ongoing. It
|
87
|
+
continues until the flag `self.done` is set to True. Once the task is complete,
|
88
|
+
a "done" message is displayed.
|
89
|
+
|
90
|
+
This method is designed to provide a simple user feedback mechanism during
|
91
|
+
long-running or background operations in command-line applications.
|
92
|
+
|
93
|
+
:return: None
|
94
|
+
"""
|
36
95
|
symbols = ["|", "/", "-", "\\"]
|
37
96
|
i = 0
|
38
97
|
while not self.done:
|
purem/logger.py
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
Business Source License 1.1
|
3
3
|
|
4
4
|
Copyright (C) 2025 Raman Marozau, raman@worktif.com
|
5
|
-
Use of this software is governed by the Business Source License included in the LICENSE
|
5
|
+
Use of this software is governed by the Business Source License included in the LICENSE file and at www.mariadb.com/bsl11.
|
6
6
|
|
7
7
|
Change Date: Never
|
8
8
|
On the date above, in accordance with the Business Source License, use of this software will be governed by the open source license specified in the LICENSE file.
|
@@ -19,8 +19,8 @@ class Logger:
|
|
19
19
|
self._env = load_env_config()
|
20
20
|
self._default_info_message = f"Something went wrong"
|
21
21
|
|
22
|
-
def info(self, message: str) -> str:
|
23
|
-
if self._env.PUREM_VERBOSE is True:
|
22
|
+
def info(self, message: str, verbose: bool = False) -> str:
|
23
|
+
if self._env.PUREM_VERBOSE is True or verbose is True:
|
24
24
|
return f"[purem]: {message}\n"
|
25
25
|
else:
|
26
26
|
return f"[purem]: {self._default_info_message}\n"
|
purem/utils.py
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
Business Source License 1.1
|
3
3
|
|
4
4
|
Copyright (C) 2025 Raman Marozau, raman@worktif.com
|
5
|
-
Use of this software is governed by the Business Source License included in the LICENSE
|
5
|
+
Use of this software is governed by the Business Source License included in the LICENSE file and at www.mariadb.com/bsl11.
|
6
6
|
|
7
7
|
Change Date: Never
|
8
8
|
On the date above, in accordance with the Business Source License, use of this software will be governed by the open source license specified in the LICENSE file.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: purem
|
3
|
-
Version:
|
3
|
+
Version: 3.0.2
|
4
4
|
Summary: The official high-performance mapping function for mixed-type arrays powered by Work TIF Ltd.
|
5
5
|
Author-email: Raman Marozau <raman@worktif.com>
|
6
6
|
License-Expression: BUSL-1.1
|
@@ -25,7 +25,6 @@ Requires-Python: >=3.11
|
|
25
25
|
Description-Content-Type: text/x-rst
|
26
26
|
License-File: LICENSE
|
27
27
|
Requires-Dist: numpy~=2.1.3
|
28
|
-
Requires-Dist: pytest~=8.3.5
|
29
28
|
Requires-Dist: numba~=0.61.0
|
30
29
|
Requires-Dist: certifi~=2025.1.31
|
31
30
|
Requires-Dist: pydantic~=2.10.6
|
@@ -33,6 +32,8 @@ Requires-Dist: dotenv~=0.9.9
|
|
33
32
|
Requires-Dist: python-dotenv~=1.1.0
|
34
33
|
Requires-Dist: setuptools~=65.5.1
|
35
34
|
Requires-Dist: requests~=2.32.3
|
35
|
+
Requires-Dist: pytest~=8.3.5
|
36
|
+
Requires-Dist: pytest-env~=1.1.5
|
36
37
|
Provides-Extra: dev
|
37
38
|
Requires-Dist: pytest; extra == "dev"
|
38
39
|
Requires-Dist: flake8; extra == "dev"
|
@@ -0,0 +1,12 @@
|
|
1
|
+
purem/__init__.py,sha256=of-z4lRvk7cmLLsCbiXHIPXVjP0FHBCByndtPgINfT0,92
|
2
|
+
purem/core.py,sha256=kGhCPlSwyTlmjsv970H_DSCBrvMCL6TA2-EHmwsgQ3c,15830
|
3
|
+
purem/env_config.py,sha256=o1VujOYEH0XXVHbM0j84BEbO2FqlWVQ088DxlSfsvRU,2663
|
4
|
+
purem/file_structure.py,sha256=nYTSj74gDsnVAYAwkb5NGE1QHXvlkaYuaafB_FIAMaI,3337
|
5
|
+
purem/loader.py,sha256=GDeuiqZcKvZQEDaUg2TO5rC-WwVcjIgKqNEpF602mmg,3610
|
6
|
+
purem/logger.py,sha256=vZHUGwL-MXJPNBoHIxqLf26KOF9qk4xj2qdgUhRas8c,1281
|
7
|
+
purem/utils.py,sha256=wjLHukHROX3GKJoEwXCR9X6CfqT70M1Mj6FcLtFUxJ8,923
|
8
|
+
purem-3.0.2.dist-info/licenses/LICENSE,sha256=5WFXHK6Xc_wj2EtvzVtd9TIC4cWEZJS8ECNTuvutsiE,1636
|
9
|
+
purem-3.0.2.dist-info/METADATA,sha256=fuDQr3LQrympk6wCLUqEbqb-Raxb5qxrAmrnH1BQZJg,5677
|
10
|
+
purem-3.0.2.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
|
11
|
+
purem-3.0.2.dist-info/top_level.txt,sha256=EjS75KEpZUEKSV2TFGW6w5aLqY9nUyO6Gq2ATz-KeZM,6
|
12
|
+
purem-3.0.2.dist-info/RECORD,,
|
purem-2.1.6.dist-info/RECORD
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
purem/__init__.py,sha256=zF_hOKYn8X3jeoBxQ9X1irDi6HCPQ-HRcMP5fcocaNw,141
|
2
|
-
purem/core.py,sha256=urg3JSdg2A-iVjYHJYPLnvNDPwUP5PElECAtSK1HRQY,10677
|
3
|
-
purem/env_config.py,sha256=q1zOaiQLgqACfpU9d21kh004RSLjomORC8ZIvqFdnZE,2667
|
4
|
-
purem/file_structure.py,sha256=8PRP9uk6PApOHwKF5Pfyg7CbZfgqTVwzV4NrYLJkTjY,3341
|
5
|
-
purem/loader.py,sha256=F-4dFzBtmxnB8r4Y620WJhJ6-yAiBjmvZYCi8Z1ykkU,1274
|
6
|
-
purem/logger.py,sha256=bs7jtx1cHmyuM6Irdcq60gTMURCai2pi5MIUB3TQcSQ,1243
|
7
|
-
purem/utils.py,sha256=Kv0DPvt8SpSfKp4ar03ZP26Aj60dxW5Gf8B9FKKUrDc,927
|
8
|
-
purem-2.1.6.dist-info/licenses/LICENSE,sha256=5WFXHK6Xc_wj2EtvzVtd9TIC4cWEZJS8ECNTuvutsiE,1636
|
9
|
-
purem-2.1.6.dist-info/METADATA,sha256=wLqdwfxAnJi0FLLocMn7zFf4ayKwUpvA2OMjN6E1Y78,5644
|
10
|
-
purem-2.1.6.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
|
11
|
-
purem-2.1.6.dist-info/top_level.txt,sha256=EjS75KEpZUEKSV2TFGW6w5aLqY9nUyO6Gq2ATz-KeZM,6
|
12
|
-
purem-2.1.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|