basic-open-agent-tools 0.4.2__tar.gz → 0.4.3__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.
- {basic_open_agent_tools-0.4.2/src/basic_open_agent_tools.egg-info → basic_open_agent_tools-0.4.3}/PKG-INFO +1 -1
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/pyproject.toml +1 -1
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools/data/archive_processing.py +81 -32
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools/data/binary_processing.py +1 -1
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools/data/config_processing.py +2 -2
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3/src/basic_open_agent_tools.egg-info}/PKG-INFO +1 -1
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/LICENSE +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/README.md +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/setup.cfg +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/setup.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools/__init__.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools/crypto/__init__.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools/data/__init__.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools/data/csv_tools.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools/data/json_tools.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools/data/object_serialization.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools/data/structures.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools/data/transform.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools/data/validation.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools/exceptions.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools/file_system/__init__.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools/file_system/info.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools/file_system/operations.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools/file_system/tree.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools/file_system/validation.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools/helpers.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools/network/__init__.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools/system/__init__.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools/text/__init__.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools/text/processing.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools/types.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools/utilities/__init__.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools.egg-info/SOURCES.txt +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools.egg-info/dependency_links.txt +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools.egg-info/requires.txt +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools.egg-info/top_level.txt +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/tests/test_data_archive_processing.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/tests/test_data_binary_processing.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/tests/test_data_config_processing.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/tests/test_data_csv_tools.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/tests/test_data_json_tools.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/tests/test_data_object_serialization.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/tests/test_data_structures.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/tests/test_data_transform.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/tests/test_data_validation.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/tests/test_file_system_tools.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/tests/test_helpers.py +0 -0
- {basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/tests/test_text_processing.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: basic-open-agent-tools
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.3
|
|
4
4
|
Summary: An open foundational toolkit providing essential components for building AI agents with minimal dependencies for local (non-HTTP/API) actions.
|
|
5
5
|
Home-page: https://github.com/open-agent-tools/basic-open-agent-tools
|
|
6
6
|
Author: Open Agent Tools
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta:__legacy__"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "basic-open-agent-tools"
|
|
7
|
-
version = "0.4.
|
|
7
|
+
version = "0.4.3" # Fix MyPy type errors and improve CI workflow reliability
|
|
8
8
|
description = "An open foundational toolkit providing essential components for building AI agents with minimal dependencies for local (non-HTTP/API) actions."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.8"
|
|
@@ -7,7 +7,7 @@ archive files (ZIP, TAR) with a focus on safety and ease of use.
|
|
|
7
7
|
import os
|
|
8
8
|
import tarfile
|
|
9
9
|
import zipfile
|
|
10
|
-
from typing import Dict, List, Optional, Union
|
|
10
|
+
from typing import Any, Dict, List, Optional, Union
|
|
11
11
|
|
|
12
12
|
from ..exceptions import DataError
|
|
13
13
|
|
|
@@ -120,7 +120,7 @@ def extract_zip_archive(
|
|
|
120
120
|
raise DataError(f"Failed to extract ZIP archive: {str(e)}")
|
|
121
121
|
|
|
122
122
|
|
|
123
|
-
def list_archive_contents(archive_path: str) -> List[Dict[str,
|
|
123
|
+
def list_archive_contents(archive_path: str) -> List[Dict[str, Any]]:
|
|
124
124
|
"""List the contents of an archive file (ZIP or TAR).
|
|
125
125
|
|
|
126
126
|
Args:
|
|
@@ -238,18 +238,54 @@ def add_to_archive(
|
|
|
238
238
|
temp_path = archive_path + ".tmp"
|
|
239
239
|
|
|
240
240
|
# Copy the original archive and add the new file
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
241
|
+
if mode == "gz":
|
|
242
|
+
with tarfile.open(archive_path, "r:gz") as src_tar, tarfile.open(
|
|
243
|
+
temp_path, "w:gz"
|
|
244
|
+
) as dest_tar:
|
|
245
|
+
# Copy existing files
|
|
246
|
+
for member in src_tar.getmembers():
|
|
247
|
+
dest_tar.addfile(
|
|
248
|
+
member,
|
|
249
|
+
src_tar.extractfile(member) if not member.isdir() else None,
|
|
250
|
+
)
|
|
251
|
+
# Add the new file
|
|
252
|
+
dest_tar.add(file_path, arcname=archive_name)
|
|
253
|
+
elif mode == "bz2":
|
|
254
|
+
with tarfile.open(archive_path, "r:bz2") as src_tar, tarfile.open(
|
|
255
|
+
temp_path, "w:bz2"
|
|
256
|
+
) as dest_tar:
|
|
257
|
+
# Copy existing files
|
|
258
|
+
for member in src_tar.getmembers():
|
|
259
|
+
dest_tar.addfile(
|
|
260
|
+
member,
|
|
261
|
+
src_tar.extractfile(member) if not member.isdir() else None,
|
|
262
|
+
)
|
|
263
|
+
# Add the new file
|
|
264
|
+
dest_tar.add(file_path, arcname=archive_name)
|
|
265
|
+
elif mode == "xz":
|
|
266
|
+
with tarfile.open(archive_path, "r:xz") as src_tar, tarfile.open(
|
|
267
|
+
temp_path, "w:xz"
|
|
268
|
+
) as dest_tar:
|
|
269
|
+
# Copy existing files
|
|
270
|
+
for member in src_tar.getmembers():
|
|
271
|
+
dest_tar.addfile(
|
|
272
|
+
member,
|
|
273
|
+
src_tar.extractfile(member) if not member.isdir() else None,
|
|
274
|
+
)
|
|
275
|
+
# Add the new file
|
|
276
|
+
dest_tar.add(file_path, arcname=archive_name)
|
|
277
|
+
else:
|
|
278
|
+
with tarfile.open(archive_path, "r") as src_tar, tarfile.open(
|
|
279
|
+
temp_path, "w"
|
|
280
|
+
) as dest_tar:
|
|
281
|
+
# Copy existing files
|
|
282
|
+
for member in src_tar.getmembers():
|
|
283
|
+
dest_tar.addfile(
|
|
284
|
+
member,
|
|
285
|
+
src_tar.extractfile(member) if not member.isdir() else None,
|
|
286
|
+
)
|
|
287
|
+
# Add the new file
|
|
288
|
+
dest_tar.add(file_path, arcname=archive_name)
|
|
253
289
|
|
|
254
290
|
# Replace the original archive with the new one
|
|
255
291
|
os.replace(temp_path, archive_path)
|
|
@@ -294,28 +330,23 @@ def create_tar_archive(
|
|
|
294
330
|
f"Must be one of: {', '.join(str(c) for c in valid_compressions)}"
|
|
295
331
|
)
|
|
296
332
|
|
|
297
|
-
# Determine the mode based on compression
|
|
298
|
-
mode = f"w:{compression if compression else ''}"
|
|
299
|
-
|
|
300
333
|
try:
|
|
301
334
|
# Create directory if it doesn't exist
|
|
302
335
|
os.makedirs(os.path.dirname(os.path.abspath(archive_path)), exist_ok=True)
|
|
303
336
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
tar_file.add(src_path, arcname=archive_name)
|
|
337
|
+
# Use explicit mode strings to satisfy MyPy type checking
|
|
338
|
+
if compression == "gz":
|
|
339
|
+
with tarfile.open(archive_path, "w:gz") as tar_file:
|
|
340
|
+
_add_files_to_tar(tar_file, files)
|
|
341
|
+
elif compression == "bz2":
|
|
342
|
+
with tarfile.open(archive_path, "w:bz2") as tar_file:
|
|
343
|
+
_add_files_to_tar(tar_file, files)
|
|
344
|
+
elif compression == "xz":
|
|
345
|
+
with tarfile.open(archive_path, "w:xz") as tar_file:
|
|
346
|
+
_add_files_to_tar(tar_file, files)
|
|
347
|
+
else:
|
|
348
|
+
with tarfile.open(archive_path, "w") as tar_file:
|
|
349
|
+
_add_files_to_tar(tar_file, files)
|
|
319
350
|
|
|
320
351
|
except tarfile.TarError as e:
|
|
321
352
|
raise DataError(f"Failed to create TAR archive: {str(e)}")
|
|
@@ -427,6 +458,24 @@ def validate_archive_integrity(archive_path: str) -> bool:
|
|
|
427
458
|
return False
|
|
428
459
|
|
|
429
460
|
|
|
461
|
+
def _add_files_to_tar(
|
|
462
|
+
tar_file: tarfile.TarFile, files: Union[List[str], Dict[str, str]]
|
|
463
|
+
) -> None:
|
|
464
|
+
"""Helper function to add files to a tar archive."""
|
|
465
|
+
if isinstance(files, list):
|
|
466
|
+
# List of files - use original filenames
|
|
467
|
+
for file_path in files:
|
|
468
|
+
if not os.path.isfile(file_path):
|
|
469
|
+
raise FileNotFoundError(f"File not found: {file_path}")
|
|
470
|
+
tar_file.add(file_path, arcname=os.path.basename(file_path))
|
|
471
|
+
else:
|
|
472
|
+
# Dictionary mapping source paths to archive paths
|
|
473
|
+
for src_path, archive_name in files.items():
|
|
474
|
+
if not os.path.isfile(src_path):
|
|
475
|
+
raise FileNotFoundError(f"File not found: {src_path}")
|
|
476
|
+
tar_file.add(src_path, arcname=archive_name)
|
|
477
|
+
|
|
478
|
+
|
|
430
479
|
def _get_tar_mode(extension: str) -> str:
|
|
431
480
|
"""Get the appropriate mode for tarfile operations based on file extension.
|
|
432
481
|
|
|
@@ -229,7 +229,7 @@ def extract_binary_metadata(file_path: str) -> Dict[str, Any]:
|
|
|
229
229
|
# Basic file metadata
|
|
230
230
|
stat_info = os.stat(file_path)
|
|
231
231
|
|
|
232
|
-
metadata = {
|
|
232
|
+
metadata: Dict[str, Any] = {
|
|
233
233
|
"size": stat_info.st_size,
|
|
234
234
|
"created": stat_info.st_ctime,
|
|
235
235
|
"modified": stat_info.st_mtime,
|
|
@@ -33,7 +33,7 @@ if sys.version_info >= (3, 11):
|
|
|
33
33
|
TOML_AVAILABLE = False
|
|
34
34
|
else:
|
|
35
35
|
try:
|
|
36
|
-
import tomli
|
|
36
|
+
import tomli
|
|
37
37
|
|
|
38
38
|
TOML_AVAILABLE = True
|
|
39
39
|
except ImportError:
|
|
@@ -166,7 +166,7 @@ def write_toml_file(data: Dict[str, Any], file_path: str) -> None:
|
|
|
166
166
|
>>> write_toml_file(data, "config.toml")
|
|
167
167
|
"""
|
|
168
168
|
try:
|
|
169
|
-
import tomli_w
|
|
169
|
+
import tomli_w
|
|
170
170
|
except ImportError:
|
|
171
171
|
raise DataError(
|
|
172
172
|
"tomli_w is required for writing TOML files. "
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: basic-open-agent-tools
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.3
|
|
4
4
|
Summary: An open foundational toolkit providing essential components for building AI agents with minimal dependencies for local (non-HTTP/API) actions.
|
|
5
5
|
Home-page: https://github.com/open-agent-tools/basic-open-agent-tools
|
|
6
6
|
Author: Open Agent Tools
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools/__init__.py
RENAMED
|
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
|
{basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools/helpers.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/src/basic_open_agent_tools/types.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/tests/test_data_archive_processing.py
RENAMED
|
File without changes
|
{basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/tests/test_data_binary_processing.py
RENAMED
|
File without changes
|
{basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/tests/test_data_config_processing.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{basic_open_agent_tools-0.4.2 → basic_open_agent_tools-0.4.3}/tests/test_file_system_tools.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|