swarmauri_gitfilter_s3fs 0.3.0.dev4__py3-none-any.whl → 0.3.0.dev31__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.
@@ -0,0 +1,142 @@
1
+ Metadata-Version: 2.4
2
+ Name: swarmauri_gitfilter_s3fs
3
+ Version: 0.3.0.dev31
4
+ Summary: S3 git filter for Peagen using s3fs
5
+ License-Expression: Apache-2.0
6
+ License-File: LICENSE
7
+ Keywords: swarmauri,sdk,standards,gitfilter,s3fs
8
+ Author: Jacob Stewart
9
+ Author-email: jacob@swarmauri.com
10
+ Requires-Python: >=3.10,<3.13
11
+ Classifier: License :: OSI Approved :: Apache Software License
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python
18
+ Classifier: Programming Language :: Python :: 3 :: Only
19
+ Requires-Dist: peagen
20
+ Requires-Dist: s3fs
21
+ Requires-Dist: swarmauri_base
22
+ Requires-Dist: swarmauri_core
23
+ Requires-Dist: swarmauri_standard
24
+ Description-Content-Type: text/markdown
25
+
26
+ ![Swarmauri Logo](https://github.com/swarmauri/swarmauri-sdk/blob/3d4d1cfa949399d7019ae9d8f296afba773dfb7f/assets/swarmauri.brand.theme.svg)
27
+
28
+ <p align="center">
29
+ <a href="https://pypi.org/project/swarmauri_gitfilter_s3fs/">
30
+ <img src="https://img.shields.io/pypi/dm/swarmauri_gitfilter_s3fs" alt="PyPI - Downloads"/>
31
+ </a>
32
+ <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_gitfilter_s3fs/">
33
+ <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_gitfilter_s3fs.svg"/>
34
+ </a>
35
+ <a href="https://pypi.org/project/swarmauri_gitfilter_s3fs/">
36
+ <img src="https://img.shields.io/pypi/pyversions/swarmauri_gitfilter_s3fs" alt="PyPI - Python Version"/>
37
+ </a>
38
+ <a href="https://pypi.org/project/swarmauri_gitfilter_s3fs/">
39
+ <img src="https://img.shields.io/pypi/l/swarmauri_gitfilter_s3fs" alt="PyPI - License"/>
40
+ </a>
41
+ <a href="https://pypi.org/project/swarmauri_gitfilter_s3fs/">
42
+ <img src="https://img.shields.io/pypi/v/swarmauri_gitfilter_s3fs?label=swarmauri_gitfilter_s3fs&color=green" alt="PyPI - swarmauri_gitfilter_s3fs"/>
43
+ </a>
44
+ </p>
45
+
46
+ ---
47
+
48
+ # Swarmauri Git Filter S3FS
49
+
50
+ Git filter implementation for Peagen that streams artifacts to Amazon S3 (or
51
+ S3-compatible services) through ``s3fs``. The filter registers as a
52
+ ``StorageAdapter`` named ``S3FSFilter`` and supports the full git clean/smudge
53
+ cycle by delegating reads and writes to the configured S3 bucket.
54
+
55
+ ## Features
56
+
57
+ - Implements :class:`~swarmauri_base.storage.StorageAdapterBase` and
58
+ :class:`~swarmauri_base.git_filters.GitFilterBase` to provide streaming
59
+ ``upload`` and ``download`` operations.
60
+ - Recursively uploads local directories via ``upload_dir`` and reconstructs
61
+ prefixes back onto disk with ``download_prefix``.
62
+ - Lists existing objects under a prefix with ``iter_prefix`` to back git
63
+ history reconstruction.
64
+ - Reads configuration from ``peagen.toml`` (``[storage.filters.s3fs]``) or the
65
+ ``AWS_*`` environment variables when instantiated through
66
+ :meth:`S3FSFilter.from_uri`.
67
+
68
+ ## Installation
69
+
70
+ Install the package with your preferred Python packaging tool:
71
+
72
+ ```bash
73
+ pip install swarmauri_gitfilter_s3fs
74
+ ```
75
+
76
+ ```bash
77
+ poetry add swarmauri_gitfilter_s3fs
78
+ ```
79
+
80
+ ```bash
81
+ uv pip install swarmauri_gitfilter_s3fs
82
+ ```
83
+
84
+ ## Configuration
85
+
86
+ Create the filter by supplying your bucket name and optional connection
87
+ parameters:
88
+
89
+ - ``bucket`` – Target bucket name (required).
90
+ - ``prefix`` – Optional key prefix to scope uploads.
91
+ - ``key`` / ``secret`` – Credentials for the S3 endpoint. ``SecretStr``
92
+ instances are supported.
93
+ - ``endpoint_url`` – Custom S3-compatible endpoint (useful for MinIO or
94
+ LocalStack).
95
+ - ``region_name`` – Region for the endpoint.
96
+
97
+ When using :meth:`S3FSFilter.from_uri`, the URI sets the ``bucket`` and
98
+ ``prefix`` while credentials are loaded from ``peagen.toml`` at
99
+ ``[storage.filters.s3fs]`` (``key``, ``secret``, ``endpoint_url``, and
100
+ ``region``). Missing configuration falls back to
101
+ ``AWS_ACCESS_KEY_ID``, ``AWS_SECRET_ACCESS_KEY``, ``AWS_ENDPOINT_URL``, and
102
+ ``AWS_REGION`` respectively.
103
+
104
+ ## Usage
105
+
106
+ The example below patches ``s3fs`` with an in-memory stub so it can run without
107
+ network access. The logic mirrors how ``S3FSFilter`` writes data to S3 and
108
+ returns the URI of the uploaded object.
109
+
110
+ ```python
111
+ from contextlib import nullcontext
112
+ from io import BytesIO
113
+ from unittest.mock import MagicMock, patch
114
+
115
+ from swarmauri_gitfilter_s3fs import S3FSFilter
116
+
117
+ with patch("swarmauri_gitfilter_s3fs.s3fs_filter.s3fs.S3FileSystem") as fs_cls:
118
+ fake_fs = MagicMock()
119
+ buffer = BytesIO()
120
+ fake_fs.open.return_value = nullcontext(buffer)
121
+ fs_cls.return_value = fake_fs
122
+
123
+ filt = S3FSFilter.from_uri("s3://demo-bucket/models")
124
+ location = filt.upload("artifacts/model.bin", BytesIO(b"model-weights"))
125
+
126
+ assert location == "s3://demo-bucket/models/artifacts/model.bin"
127
+ fake_fs.open.assert_called_with(
128
+ "demo-bucket/models/artifacts/model.bin",
129
+ "wb",
130
+ )
131
+ assert buffer.getvalue() == b"model-weights"
132
+ ```
133
+
134
+ In a production workflow you do not need to patch ``s3fs`` – instantiate the
135
+ filter with your credentials and bucket, then use ``clean``/``smudge`` or
136
+ ``upload``/``download`` to move artifacts between git and S3.
137
+
138
+ ## Want to help?
139
+
140
+ If you want to contribute to swarmauri-sdk, read up on our
141
+ [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md)
142
+ that will help you get started.
@@ -0,0 +1,7 @@
1
+ swarmauri_gitfilter_s3fs/__init__.py,sha256=qCTB0mBQ9_G86H4jhyOskqU1ExQc-5k6PD9nrqDiwWE,413
2
+ swarmauri_gitfilter_s3fs/s3fs_filter.py,sha256=G7tfTERStoe4PtFbnH2oeEkBaJHeqPKkoRHl-6uRq5k,4250
3
+ swarmauri_gitfilter_s3fs-0.3.0.dev31.dist-info/METADATA,sha256=aGQq5dDud1rNwHkkGH_G6z9eN1d5WfLf_JBZVgiJzMk,5435
4
+ swarmauri_gitfilter_s3fs-0.3.0.dev31.dist-info/WHEEL,sha256=kJCRJT_g0adfAJzTx2GUMmS80rTJIVHRCfG0DQgLq3o,88
5
+ swarmauri_gitfilter_s3fs-0.3.0.dev31.dist-info/entry_points.txt,sha256=HkWix2d-C6c2ByB7GdU-sQAzgAT_Lg9yEe07RgdIfCU,165
6
+ swarmauri_gitfilter_s3fs-0.3.0.dev31.dist-info/licenses/LICENSE,sha256=djUXOlCxLVszShEpZXshZ7v33G-2qIC_j9KXpWKZSzQ,11359
7
+ swarmauri_gitfilter_s3fs-0.3.0.dev31.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.1.3
2
+ Generator: poetry-core 2.3.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,61 +0,0 @@
1
- Metadata-Version: 2.3
2
- Name: swarmauri_gitfilter_s3fs
3
- Version: 0.3.0.dev4
4
- Summary: S3 git filter for Peagen using s3fs
5
- License: Apache-2.0
6
- Author: Jacob Stewart
7
- Author-email: jacob@swarmauri.com
8
- Requires-Python: >=3.10,<3.13
9
- Classifier: License :: OSI Approved :: Apache Software License
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: Programming Language :: Python :: 3.10
12
- Classifier: Programming Language :: Python :: 3.11
13
- Classifier: Programming Language :: Python :: 3.12
14
- Classifier: Operating System :: OS Independent
15
- Requires-Dist: peagen
16
- Requires-Dist: s3fs
17
- Requires-Dist: swarmauri_base
18
- Requires-Dist: swarmauri_core
19
- Requires-Dist: swarmauri_standard
20
- Description-Content-Type: text/markdown
21
-
22
- ![Swamauri Logo](https://res.cloudinary.com/dbjmpekvl/image/upload/v1730099724/Swarmauri-logo-lockup-2048x757_hww01w.png)
23
-
24
- <p align="center">
25
- <a href="https://pypi.org/project/swarmauri_gitfilter_s3fs/">
26
- <img src="https://img.shields.io/pypi/dm/swarmauri_gitfilter_s3fs" alt="PyPI - Downloads"/>
27
- </a>
28
- <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_gitfilter_s3fs/">
29
- <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_gitfilter_s3fs.svg"/>
30
- </a>
31
- <a href="https://pypi.org/project/swarmauri_gitfilter_s3fs/">
32
- <img src="https://img.shields.io/pypi/pyversions/swarmauri_gitfilter_s3fs" alt="PyPI - Python Version"/>
33
- </a>
34
- <a href="https://pypi.org/project/swarmauri_gitfilter_s3fs/">
35
- <img src="https://img.shields.io/pypi/l/swarmauri_gitfilter_s3fs" alt="PyPI - License"/>
36
- </a>
37
- <a href="https://pypi.org/project/swarmauri_gitfilter_s3fs/">
38
- <img src="https://img.shields.io/pypi/v/swarmauri_gitfilter_s3fs?label=swarmauri_gitfilter_s3fs&color=green" alt="PyPI - swarmauri_gitfilter_s3fs"/>
39
- </a>
40
- </p>
41
-
42
- ---
43
-
44
- # Swarmauri Git Filter S3FS
45
-
46
- S3 backed git filter for Peagen using ``s3fs``.
47
-
48
- ## Installation
49
-
50
- ```bash
51
- pip install swarmauri_gitfilter_s3fs
52
- ```
53
-
54
- ## Usage
55
-
56
- ```python
57
- from swarmauri_gitfilter_s3fs import S3FSFilter
58
-
59
- filt = S3FSFilter.from_uri("s3://bucket/path")
60
- ```
61
-
@@ -1,7 +0,0 @@
1
- swarmauri_gitfilter_s3fs/__init__.py,sha256=qCTB0mBQ9_G86H4jhyOskqU1ExQc-5k6PD9nrqDiwWE,413
2
- swarmauri_gitfilter_s3fs/s3fs_filter.py,sha256=G7tfTERStoe4PtFbnH2oeEkBaJHeqPKkoRHl-6uRq5k,4250
3
- swarmauri_gitfilter_s3fs-0.3.0.dev4.dist-info/LICENSE,sha256=djUXOlCxLVszShEpZXshZ7v33G-2qIC_j9KXpWKZSzQ,11359
4
- swarmauri_gitfilter_s3fs-0.3.0.dev4.dist-info/METADATA,sha256=oJWjXMQ98Dofp47vNFnLJPFzsv9TOFY5I0CHv3fr6OU,2165
5
- swarmauri_gitfilter_s3fs-0.3.0.dev4.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
6
- swarmauri_gitfilter_s3fs-0.3.0.dev4.dist-info/entry_points.txt,sha256=HkWix2d-C6c2ByB7GdU-sQAzgAT_Lg9yEe07RgdIfCU,165
7
- swarmauri_gitfilter_s3fs-0.3.0.dev4.dist-info/RECORD,,