cloudtoolbox 0.1.0__tar.gz → 0.2.1__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.
- cloudtoolbox-0.2.1/PKG-INFO +86 -0
- cloudtoolbox-0.2.1/README.md +55 -0
- cloudtoolbox-0.2.1/cloud/amazon/sns.py +11 -0
- cloudtoolbox-0.2.1/cloud/amazon/sqs.py +11 -0
- cloudtoolbox-0.2.1/cloudtoolbox.egg-info/PKG-INFO +86 -0
- {cloudtoolbox-0.1.0 → cloudtoolbox-0.2.1}/cloudtoolbox.egg-info/SOURCES.txt +2 -0
- {cloudtoolbox-0.1.0 → cloudtoolbox-0.2.1}/cloudtoolbox.egg-info/requires.txt +5 -0
- {cloudtoolbox-0.1.0 → cloudtoolbox-0.2.1}/pyproject.toml +20 -2
- {cloudtoolbox-0.1.0 → cloudtoolbox-0.2.1}/tests/test_factory.py +11 -1
- cloudtoolbox-0.1.0/PKG-INFO +0 -19
- cloudtoolbox-0.1.0/README.md +0 -3
- cloudtoolbox-0.1.0/cloudtoolbox.egg-info/PKG-INFO +0 -19
- {cloudtoolbox-0.1.0 → cloudtoolbox-0.2.1}/LICENSE +0 -0
- {cloudtoolbox-0.1.0 → cloudtoolbox-0.2.1}/cloud/__init__.py +0 -0
- {cloudtoolbox-0.1.0 → cloudtoolbox-0.2.1}/cloud/amazon/__init__.py +0 -0
- {cloudtoolbox-0.1.0 → cloudtoolbox-0.2.1}/cloud/amazon/s3.py +0 -0
- {cloudtoolbox-0.1.0 → cloudtoolbox-0.2.1}/cloud/factory.py +0 -0
- {cloudtoolbox-0.1.0 → cloudtoolbox-0.2.1}/cloud/google/__init__.py +0 -0
- {cloudtoolbox-0.1.0 → cloudtoolbox-0.2.1}/cloud/google/pubsub.py +0 -0
- {cloudtoolbox-0.1.0 → cloudtoolbox-0.2.1}/cloud/google/storage.py +0 -0
- {cloudtoolbox-0.1.0 → cloudtoolbox-0.2.1}/cloud/protocols.py +0 -0
- {cloudtoolbox-0.1.0 → cloudtoolbox-0.2.1}/cloudtoolbox.egg-info/dependency_links.txt +0 -0
- {cloudtoolbox-0.1.0 → cloudtoolbox-0.2.1}/cloudtoolbox.egg-info/top_level.txt +0 -0
- {cloudtoolbox-0.1.0 → cloudtoolbox-0.2.1}/setup.cfg +0 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: cloudtoolbox
|
|
3
|
+
Version: 0.2.1
|
|
4
|
+
Summary: Toolbox for the cloud.
|
|
5
|
+
Author-email: Dotz Developers <devs-dotz@dotz.com>
|
|
6
|
+
Project-URL: Repository, https://github.com/DotzInc/cloud-toolbox
|
|
7
|
+
Keywords: cloud,tools,utilities,google,gcp,amazon,aws
|
|
8
|
+
Classifier: Operating System :: OS Independent
|
|
9
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Topic :: Internet
|
|
16
|
+
Classifier: Topic :: Software Development
|
|
17
|
+
Classifier: Intended Audience :: Developers
|
|
18
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
19
|
+
Requires-Python: >=3.8
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Provides-Extra: amazon
|
|
23
|
+
Requires-Dist: boto3; extra == "amazon"
|
|
24
|
+
Provides-Extra: google
|
|
25
|
+
Requires-Dist: google-cloud-pubsub; extra == "google"
|
|
26
|
+
Requires-Dist: google-cloud-storage; extra == "google"
|
|
27
|
+
Provides-Extra: all
|
|
28
|
+
Requires-Dist: boto3; extra == "all"
|
|
29
|
+
Requires-Dist: google-cloud-pubsub; extra == "all"
|
|
30
|
+
Requires-Dist: google-cloud-storage; extra == "all"
|
|
31
|
+
|
|
32
|
+
# Cloud Toolbox
|
|
33
|
+
|
|
34
|
+

|
|
35
|
+

|
|
36
|
+

|
|
37
|
+
|
|
38
|
+
Decouple your applications from cloud providers with carefully crafted service interfaces.
|
|
39
|
+
|
|
40
|
+
## Requirements
|
|
41
|
+
|
|
42
|
+
* Python 3.8+
|
|
43
|
+
|
|
44
|
+
## Installation
|
|
45
|
+
|
|
46
|
+
To install Cloud Toolbox, use pip:
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
pip install cloudtoolbox
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Extras
|
|
53
|
+
|
|
54
|
+
Cloud Toolbox offers the following optional dependencies for easy installation of provider SDKs:
|
|
55
|
+
|
|
56
|
+
* `cloudtoolbox[amazon]` - Installs the Amazon AWS SDK.
|
|
57
|
+
* `cloudtoolbox[google]` - Installs the Google Cloud SDK.
|
|
58
|
+
* `cloudtoolbox[all]` - Installs SDKs for both providers.
|
|
59
|
+
|
|
60
|
+
## Example
|
|
61
|
+
|
|
62
|
+
Uploading a file to Google Cloud Storage.
|
|
63
|
+
|
|
64
|
+
```python
|
|
65
|
+
from cloud import factory
|
|
66
|
+
from cloud.google.storage import Uploader
|
|
67
|
+
|
|
68
|
+
FileUploader = factory.storage_uploader(Uploader)
|
|
69
|
+
|
|
70
|
+
bucket = "my-bucket"
|
|
71
|
+
filename = "notes.txt"
|
|
72
|
+
filepath = f"/path/to/{filename}"
|
|
73
|
+
|
|
74
|
+
uploader = FileUploader()
|
|
75
|
+
uploader.upload(bucket, filename, filepath)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Switching from Cloud Storage to Amazon S3.
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
# Replace this import
|
|
82
|
+
from cloud.google.storage import Uploader
|
|
83
|
+
|
|
84
|
+
# For this one
|
|
85
|
+
from cloud.amazon.s3 import Uploader
|
|
86
|
+
```
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Cloud Toolbox
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
Decouple your applications from cloud providers with carefully crafted service interfaces.
|
|
8
|
+
|
|
9
|
+
## Requirements
|
|
10
|
+
|
|
11
|
+
* Python 3.8+
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
To install Cloud Toolbox, use pip:
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
pip install cloudtoolbox
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Extras
|
|
22
|
+
|
|
23
|
+
Cloud Toolbox offers the following optional dependencies for easy installation of provider SDKs:
|
|
24
|
+
|
|
25
|
+
* `cloudtoolbox[amazon]` - Installs the Amazon AWS SDK.
|
|
26
|
+
* `cloudtoolbox[google]` - Installs the Google Cloud SDK.
|
|
27
|
+
* `cloudtoolbox[all]` - Installs SDKs for both providers.
|
|
28
|
+
|
|
29
|
+
## Example
|
|
30
|
+
|
|
31
|
+
Uploading a file to Google Cloud Storage.
|
|
32
|
+
|
|
33
|
+
```python
|
|
34
|
+
from cloud import factory
|
|
35
|
+
from cloud.google.storage import Uploader
|
|
36
|
+
|
|
37
|
+
FileUploader = factory.storage_uploader(Uploader)
|
|
38
|
+
|
|
39
|
+
bucket = "my-bucket"
|
|
40
|
+
filename = "notes.txt"
|
|
41
|
+
filepath = f"/path/to/{filename}"
|
|
42
|
+
|
|
43
|
+
uploader = FileUploader()
|
|
44
|
+
uploader.upload(bucket, filename, filepath)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Switching from Cloud Storage to Amazon S3.
|
|
48
|
+
|
|
49
|
+
```python
|
|
50
|
+
# Replace this import
|
|
51
|
+
from cloud.google.storage import Uploader
|
|
52
|
+
|
|
53
|
+
# For this one
|
|
54
|
+
from cloud.amazon.s3 import Uploader
|
|
55
|
+
```
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
3
|
+
import boto3
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Publisher:
|
|
7
|
+
def __init__(self, *args: Any, **kwargs: Any):
|
|
8
|
+
self.client = boto3.client("sns", *args, **kwargs)
|
|
9
|
+
|
|
10
|
+
def publish(self, recipient: str, message: str, **attrs: Any) -> None:
|
|
11
|
+
self.client.publish(TargetArn=recipient, Message=message, **attrs)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
3
|
+
import boto3
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Publisher:
|
|
7
|
+
def __init__(self, *args: Any, **kwargs: Any):
|
|
8
|
+
self.client = boto3.client("sqs", *args, **kwargs)
|
|
9
|
+
|
|
10
|
+
def publish(self, recipient: str, message: str, **attrs: Any) -> None:
|
|
11
|
+
self.client.send_message(QueueUrl=recipient, MessageBody=message, **attrs)
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: cloudtoolbox
|
|
3
|
+
Version: 0.2.1
|
|
4
|
+
Summary: Toolbox for the cloud.
|
|
5
|
+
Author-email: Dotz Developers <devs-dotz@dotz.com>
|
|
6
|
+
Project-URL: Repository, https://github.com/DotzInc/cloud-toolbox
|
|
7
|
+
Keywords: cloud,tools,utilities,google,gcp,amazon,aws
|
|
8
|
+
Classifier: Operating System :: OS Independent
|
|
9
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Topic :: Internet
|
|
16
|
+
Classifier: Topic :: Software Development
|
|
17
|
+
Classifier: Intended Audience :: Developers
|
|
18
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
19
|
+
Requires-Python: >=3.8
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Provides-Extra: amazon
|
|
23
|
+
Requires-Dist: boto3; extra == "amazon"
|
|
24
|
+
Provides-Extra: google
|
|
25
|
+
Requires-Dist: google-cloud-pubsub; extra == "google"
|
|
26
|
+
Requires-Dist: google-cloud-storage; extra == "google"
|
|
27
|
+
Provides-Extra: all
|
|
28
|
+
Requires-Dist: boto3; extra == "all"
|
|
29
|
+
Requires-Dist: google-cloud-pubsub; extra == "all"
|
|
30
|
+
Requires-Dist: google-cloud-storage; extra == "all"
|
|
31
|
+
|
|
32
|
+
# Cloud Toolbox
|
|
33
|
+
|
|
34
|
+

|
|
35
|
+

|
|
36
|
+

|
|
37
|
+
|
|
38
|
+
Decouple your applications from cloud providers with carefully crafted service interfaces.
|
|
39
|
+
|
|
40
|
+
## Requirements
|
|
41
|
+
|
|
42
|
+
* Python 3.8+
|
|
43
|
+
|
|
44
|
+
## Installation
|
|
45
|
+
|
|
46
|
+
To install Cloud Toolbox, use pip:
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
pip install cloudtoolbox
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Extras
|
|
53
|
+
|
|
54
|
+
Cloud Toolbox offers the following optional dependencies for easy installation of provider SDKs:
|
|
55
|
+
|
|
56
|
+
* `cloudtoolbox[amazon]` - Installs the Amazon AWS SDK.
|
|
57
|
+
* `cloudtoolbox[google]` - Installs the Google Cloud SDK.
|
|
58
|
+
* `cloudtoolbox[all]` - Installs SDKs for both providers.
|
|
59
|
+
|
|
60
|
+
## Example
|
|
61
|
+
|
|
62
|
+
Uploading a file to Google Cloud Storage.
|
|
63
|
+
|
|
64
|
+
```python
|
|
65
|
+
from cloud import factory
|
|
66
|
+
from cloud.google.storage import Uploader
|
|
67
|
+
|
|
68
|
+
FileUploader = factory.storage_uploader(Uploader)
|
|
69
|
+
|
|
70
|
+
bucket = "my-bucket"
|
|
71
|
+
filename = "notes.txt"
|
|
72
|
+
filepath = f"/path/to/{filename}"
|
|
73
|
+
|
|
74
|
+
uploader = FileUploader()
|
|
75
|
+
uploader.upload(bucket, filename, filepath)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Switching from Cloud Storage to Amazon S3.
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
# Replace this import
|
|
82
|
+
from cloud.google.storage import Uploader
|
|
83
|
+
|
|
84
|
+
# For this one
|
|
85
|
+
from cloud.amazon.s3 import Uploader
|
|
86
|
+
```
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "cloudtoolbox"
|
|
7
|
-
version = "0.1
|
|
7
|
+
version = "0.2.1"
|
|
8
8
|
description = "Toolbox for the cloud."
|
|
9
9
|
readme = {file = "README.md", content-type = "text/markdown"}
|
|
10
10
|
authors = [
|
|
@@ -12,14 +12,32 @@ authors = [
|
|
|
12
12
|
]
|
|
13
13
|
keywords = ["cloud", "tools", "utilities", "google", "gcp", "amazon", "aws"]
|
|
14
14
|
classifiers = [
|
|
15
|
-
"
|
|
15
|
+
"Operating System :: OS Independent",
|
|
16
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
17
|
+
"Programming Language :: Python :: 3.8",
|
|
18
|
+
"Programming Language :: Python :: 3.9",
|
|
19
|
+
"Programming Language :: Python :: 3.10",
|
|
20
|
+
"Programming Language :: Python :: 3.11",
|
|
21
|
+
"Programming Language :: Python :: 3.12",
|
|
22
|
+
"Topic :: Internet",
|
|
23
|
+
"Topic :: Software Development",
|
|
24
|
+
"Intended Audience :: Developers",
|
|
25
|
+
"License :: OSI Approved :: MIT License",
|
|
16
26
|
]
|
|
17
27
|
requires-python = ">=3.8"
|
|
18
28
|
dependencies = []
|
|
19
29
|
|
|
30
|
+
[project.urls]
|
|
31
|
+
Repository = "https://github.com/DotzInc/cloud-toolbox"
|
|
32
|
+
|
|
20
33
|
[project.optional-dependencies]
|
|
21
34
|
amazon = ["boto3"]
|
|
22
35
|
google = ["google-cloud-pubsub", "google-cloud-storage"]
|
|
36
|
+
all = [
|
|
37
|
+
"boto3",
|
|
38
|
+
"google-cloud-pubsub",
|
|
39
|
+
"google-cloud-storage",
|
|
40
|
+
]
|
|
23
41
|
|
|
24
42
|
[tool.ruff]
|
|
25
43
|
exclude = [
|
|
@@ -2,7 +2,7 @@ import unittest
|
|
|
2
2
|
from unittest import mock
|
|
3
3
|
|
|
4
4
|
from cloud import factory
|
|
5
|
-
from cloud.amazon import s3
|
|
5
|
+
from cloud.amazon import s3, sns, sqs
|
|
6
6
|
from cloud.google import pubsub, storage
|
|
7
7
|
from cloud.protocols import MessagePublisher, StorageUploader
|
|
8
8
|
|
|
@@ -50,6 +50,16 @@ class TestMessagePublisherFactory(unittest.TestCase):
|
|
|
50
50
|
self.assertIsInstance(publisher, MessagePublisher)
|
|
51
51
|
self.assertIsInstance(publisher, pubsub.Publisher)
|
|
52
52
|
|
|
53
|
+
@mock.patch("boto3.client")
|
|
54
|
+
def test_amazon_publisher(self, _):
|
|
55
|
+
for cls in (sns.Publisher, sqs.Publisher):
|
|
56
|
+
with self.subTest(class_name=cls.__name__):
|
|
57
|
+
Publisher = factory.message_publisher(cls)
|
|
58
|
+
publisher = Publisher()
|
|
59
|
+
|
|
60
|
+
self.assertIsInstance(publisher, MessagePublisher)
|
|
61
|
+
self.assertIsInstance(publisher, cls)
|
|
62
|
+
|
|
53
63
|
def test_publisher_protocol_validation(self):
|
|
54
64
|
error = "NotMessagePublisher does not implement MessagePublisher protocol"
|
|
55
65
|
|
cloudtoolbox-0.1.0/PKG-INFO
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: cloudtoolbox
|
|
3
|
-
Version: 0.1.0
|
|
4
|
-
Summary: Toolbox for the cloud.
|
|
5
|
-
Author-email: Dotz Developers <devs-dotz@dotz.com>
|
|
6
|
-
Keywords: cloud,tools,utilities,google,gcp,amazon,aws
|
|
7
|
-
Classifier: Programming Language :: Python :: 3
|
|
8
|
-
Requires-Python: >=3.8
|
|
9
|
-
Description-Content-Type: text/markdown
|
|
10
|
-
License-File: LICENSE
|
|
11
|
-
Provides-Extra: amazon
|
|
12
|
-
Requires-Dist: boto3; extra == "amazon"
|
|
13
|
-
Provides-Extra: google
|
|
14
|
-
Requires-Dist: google-cloud-pubsub; extra == "google"
|
|
15
|
-
Requires-Dist: google-cloud-storage; extra == "google"
|
|
16
|
-
|
|
17
|
-
# Cloud Toolbox
|
|
18
|
-
|
|
19
|
-
Decouple your applications from cloud providers with carefully crafted service interfaces.
|
cloudtoolbox-0.1.0/README.md
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: cloudtoolbox
|
|
3
|
-
Version: 0.1.0
|
|
4
|
-
Summary: Toolbox for the cloud.
|
|
5
|
-
Author-email: Dotz Developers <devs-dotz@dotz.com>
|
|
6
|
-
Keywords: cloud,tools,utilities,google,gcp,amazon,aws
|
|
7
|
-
Classifier: Programming Language :: Python :: 3
|
|
8
|
-
Requires-Python: >=3.8
|
|
9
|
-
Description-Content-Type: text/markdown
|
|
10
|
-
License-File: LICENSE
|
|
11
|
-
Provides-Extra: amazon
|
|
12
|
-
Requires-Dist: boto3; extra == "amazon"
|
|
13
|
-
Provides-Extra: google
|
|
14
|
-
Requires-Dist: google-cloud-pubsub; extra == "google"
|
|
15
|
-
Requires-Dist: google-cloud-storage; extra == "google"
|
|
16
|
-
|
|
17
|
-
# Cloud Toolbox
|
|
18
|
-
|
|
19
|
-
Decouple your applications from cloud providers with carefully crafted service interfaces.
|
|
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
|