swarmauri_storage_memory 0.1.0.dev29__tar.gz → 0.11.0.dev1__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,44 +1,44 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: swarmauri_storage_memory
3
- Version: 0.1.0.dev29
3
+ Version: 0.11.0.dev1
4
4
  Summary: In-memory storage adapter for SwarmauriSDK
5
5
  License-Expression: Apache-2.0
6
6
  License-File: LICENSE
7
7
  Keywords: swarmauri,sdk,standards,storage,memory,in-memory,adapter
8
8
  Author: Jacob Stewart
9
9
  Author-email: jacob@swarmauri.com
10
- Requires-Python: >=3.10,<3.13
10
+ Requires-Python: >=3.10,<3.15
11
11
  Classifier: Development Status :: 1 - Planning
12
12
  Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python
13
15
  Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3 :: Only
14
17
  Classifier: Programming Language :: Python :: 3.10
15
18
  Classifier: Programming Language :: Python :: 3.11
16
19
  Classifier: Programming Language :: Python :: 3.12
17
- Classifier: Operating System :: OS Independent
18
- Classifier: Programming Language :: Python
19
- Classifier: Programming Language :: Python :: 3 :: Only
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3.14
20
22
  Requires-Dist: swarmauri_base
21
23
  Requires-Dist: swarmauri_core
22
24
  Requires-Dist: swarmauri_standard
23
25
  Description-Content-Type: text/markdown
24
26
 
25
- ![Swarmauri Logo](https://github.com/swarmauri/swarmauri-sdk/blob/3d4d1cfa949399d7019ae9d8f296afba773dfb7f/assets/swarmauri.brand.theme.svg)
27
+ ![Swarmauri Logo](https://raw.githubusercontent.com/swarmauri/swarmauri-sdk/master/assets/swarmauri_sdk_brand.png)
26
28
 
27
29
  <p align="center">
28
- <a href="https://pypi.org/project/swarmauri_storage_memory/">
29
- <img src="https://img.shields.io/pypi/dm/swarmauri_storage_memory" alt="PyPI - Downloads"/></a>
30
+ <a href="https://pepy.tech/project/swarmauri_storage_memory/">
31
+ <img src="https://static.pepy.tech/badge/swarmauri_storage_memory/month" alt="PyPI - Downloads"/></a>
30
32
  <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_storage_memory/">
31
33
  <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_storage_memory.svg"/></a>
32
34
  <a href="https://pypi.org/project/swarmauri_storage_memory/">
33
- <img src="https://img.shields.io/pypi/pyversions/swarmauri_storage_memory" alt="PyPI - Python Version"/></a>
35
+ <img src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue" alt="PyPI - Python Version"/></a>
34
36
  <a href="https://pypi.org/project/swarmauri_storage_memory/">
35
37
  <img src="https://img.shields.io/pypi/l/swarmauri_storage_memory" alt="PyPI - License"/></a>
36
38
  <a href="https://pypi.org/project/swarmauri_storage_memory/">
37
39
  <img src="https://img.shields.io/pypi/v/swarmauri_storage_memory?label=swarmauri_storage_memory&color=green" alt="PyPI - swarmauri_storage_memory"/></a>
38
-
39
- </p>
40
-
41
- ---
40
+ <a href="https://discord.gg/N4UpBuQv8T">
41
+ <img src="https://img.shields.io/badge/Discord-Join%20Chat-5865F2?logo=discord&logoColor=white" alt="Discord"/></a></p>
42
42
 
43
43
  # Swarmauri Memory Storage Adapter
44
44
 
@@ -95,3 +95,5 @@ If you want to contribute to swarmauri-sdk, read up on our
95
95
  [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md)
96
96
  that will help you get started.
97
97
 
98
+
99
+
@@ -1,20 +1,18 @@
1
- ![Swarmauri Logo](https://github.com/swarmauri/swarmauri-sdk/blob/3d4d1cfa949399d7019ae9d8f296afba773dfb7f/assets/swarmauri.brand.theme.svg)
1
+ ![Swarmauri Logo](https://raw.githubusercontent.com/swarmauri/swarmauri-sdk/master/assets/swarmauri_sdk_brand.png)
2
2
 
3
3
  <p align="center">
4
- <a href="https://pypi.org/project/swarmauri_storage_memory/">
5
- <img src="https://img.shields.io/pypi/dm/swarmauri_storage_memory" alt="PyPI - Downloads"/></a>
4
+ <a href="https://pepy.tech/project/swarmauri_storage_memory/">
5
+ <img src="https://static.pepy.tech/badge/swarmauri_storage_memory/month" alt="PyPI - Downloads"/></a>
6
6
  <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_storage_memory/">
7
7
  <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_storage_memory.svg"/></a>
8
8
  <a href="https://pypi.org/project/swarmauri_storage_memory/">
9
- <img src="https://img.shields.io/pypi/pyversions/swarmauri_storage_memory" alt="PyPI - Python Version"/></a>
9
+ <img src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue" alt="PyPI - Python Version"/></a>
10
10
  <a href="https://pypi.org/project/swarmauri_storage_memory/">
11
11
  <img src="https://img.shields.io/pypi/l/swarmauri_storage_memory" alt="PyPI - License"/></a>
12
12
  <a href="https://pypi.org/project/swarmauri_storage_memory/">
13
13
  <img src="https://img.shields.io/pypi/v/swarmauri_storage_memory?label=swarmauri_storage_memory&color=green" alt="PyPI - swarmauri_storage_memory"/></a>
14
-
15
- </p>
16
-
17
- ---
14
+ <a href="https://discord.gg/N4UpBuQv8T">
15
+ <img src="https://img.shields.io/badge/Discord-Join%20Chat-5865F2?logo=discord&logoColor=white" alt="Discord"/></a></p>
18
16
 
19
17
  # Swarmauri Memory Storage Adapter
20
18
 
@@ -70,3 +68,5 @@ bulk transfers when you need to stage many artifacts in memory at once.
70
68
  If you want to contribute to swarmauri-sdk, read up on our
71
69
  [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md)
72
70
  that will help you get started.
71
+
72
+
@@ -1,24 +1,24 @@
1
1
  [project]
2
2
  name = "swarmauri_storage_memory"
3
- version = "0.1.0.dev29"
4
- authors = [
5
- { name = "Jacob Stewart", email = "jacob@swarmauri.com" }
6
- ]
3
+ version = "0.11.0.dev1"
4
+ authors = [{ name = "Jacob Stewart", email = "jacob@swarmauri.com" }]
7
5
  description = "In-memory storage adapter for SwarmauriSDK"
8
6
  readme = "README.md"
9
7
  license = "Apache-2.0"
10
8
  repository = "http://github.com/swarmauri/swarmauri-sdk"
11
- requires-python = ">=3.10,<3.13"
9
+ requires-python = ">=3.10,<3.15"
12
10
  classifiers = [
13
11
  "Development Status :: 1 - Planning",
14
12
  "License :: OSI Approved :: Apache Software License",
13
+ "Operating System :: OS Independent",
14
+ "Programming Language :: Python",
15
15
  "Programming Language :: Python :: 3",
16
+ "Programming Language :: Python :: 3 :: Only",
16
17
  "Programming Language :: Python :: 3.10",
17
18
  "Programming Language :: Python :: 3.11",
18
19
  "Programming Language :: Python :: 3.12",
19
- "Operating System :: OS Independent",
20
- "Programming Language :: Python",
21
- "Programming Language :: Python :: 3 :: Only",
20
+ "Programming Language :: Python :: 3.13",
21
+ "Programming Language :: Python :: 3.14",
22
22
  ]
23
23
  dependencies = [
24
24
  "swarmauri_core",
@@ -78,7 +78,7 @@ dev = [
78
78
  "pytest-xdist>=3.6.1",
79
79
  "pytest-json-report>=1.5.0",
80
80
  "python-dotenv",
81
- "requests>=2.32.3",
81
+ "httpx>=0.27",
82
82
  "flake8>=7.0",
83
83
  "pytest-timeout>=2.3.1",
84
84
  "ruff>=0.9.9",
@@ -17,14 +17,11 @@ class MemoryStorageAdapter(StorageAdapterBase):
17
17
 
18
18
  def __init__(self, *, prefix: str = "", **kwargs) -> None:
19
19
  super().__init__(**kwargs)
20
- self._prefix = prefix.lstrip("/")
20
+ self._prefix = self.normalize_prefix(prefix)
21
21
  self._store: dict[str, bytes] = {}
22
22
 
23
23
  def _full_key(self, key: str) -> str:
24
- key = key.lstrip("/")
25
- if self._prefix:
26
- return f"{self._prefix}/{key}" if key else self._prefix
27
- return key
24
+ return self.compose_key(self._prefix, key, allow_empty=True)
28
25
 
29
26
  @property
30
27
  def root_uri(self) -> str:
@@ -35,9 +32,10 @@ class MemoryStorageAdapter(StorageAdapterBase):
35
32
 
36
33
  def upload(self, key: str, data: BinaryIO) -> str:
37
34
  """Store *data* in memory and return the artifact URI."""
35
+ normalized_key = self.normalize_key(key)
38
36
  full_key = self._full_key(key)
39
37
  self._store[full_key] = data.read()
40
- return f"{self.root_uri}{key.lstrip('/')}"
38
+ return f"{self.root_uri}{normalized_key}"
41
39
 
42
40
  def download(self, key: str) -> BinaryIO:
43
41
  """Return a :class:`BytesIO` with the stored contents."""
@@ -54,7 +52,7 @@ class MemoryStorageAdapter(StorageAdapterBase):
54
52
  for path in base.rglob("*"):
55
53
  if path.is_file():
56
54
  rel = path.relative_to(base)
57
- key = os.path.join(prefix, rel.as_posix())
55
+ key = self.compose_key(prefix, rel.as_posix())
58
56
  with path.open("rb") as fh:
59
57
  self.upload(key, fh)
60
58
 
@@ -75,7 +73,7 @@ class MemoryStorageAdapter(StorageAdapterBase):
75
73
  rel = key[len(base) :].lstrip("/") if base else key
76
74
  if not rel:
77
75
  continue
78
- target = dest_root / rel
76
+ target = self.download_target_for_key(dest_root, rel)
79
77
  target.parent.mkdir(parents=True, exist_ok=True)
80
78
  target.write_bytes(payload)
81
79