boto3-refresh-session 1.0.4__py3-none-any.whl → 6.2.5__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.
@@ -1,102 +0,0 @@
1
- Metadata-Version: 2.3
2
- Name: boto3-refresh-session
3
- Version: 1.0.4
4
- Summary: A simple Python package for refreshing the temporary security credentials in a boto3.session.Session object automatically.
5
- License: MIT
6
- Keywords: boto3,botocore,aws
7
- Author: Mike Letts
8
- Author-email: lettsmt@gmail.com
9
- Maintainer: Michael Letts
10
- Maintainer-email: lettsmt@gmail.com
11
- Requires-Python: >=3.10
12
- Classifier: License :: OSI Approved :: MIT License
13
- Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3.10
15
- Classifier: Programming Language :: Python :: 3.11
16
- Classifier: Programming Language :: Python :: 3.12
17
- Classifier: Programming Language :: Python :: 3.13
18
- Requires-Dist: boto3
19
- Requires-Dist: botocore
20
- Project-URL: Documentation, https://michaelthomasletts.github.io/boto3-refresh-session/index.html
21
- Project-URL: Repository, https://github.com/michaelthomasletts/boto3-refresh-session
22
- Description-Content-Type: text/markdown
23
-
24
- # boto3-refresh-session
25
- [![PyPI Download](https://img.shields.io/pypi/v/boto3-refresh-session?logo=pypis.svg)](https://pypi.org/project/boto3-refresh-session/)
26
- [![Workflow](https://img.shields.io/github/actions/workflow/status/michaelthomasletts/boto3-refresh-session/push.yml?logo=github)](https://github.com/michaelthomasletts/boto3-refresh-session/actions/workflows/push_pullrequest.yml)
27
- ![Python Version](https://img.shields.io/pypi/pyversions/boto3-refresh-session?style=pypi)
28
- ![GitHub last commit](https://img.shields.io/github/last-commit/michaelthomasletts/boto3-refresh-session?logo=github)
29
- ![PyPI - Downloads](https://img.shields.io/pypi/dm/boto3-refresh-session?logo=pypi)
30
-
31
- ![BRS Image](https://raw.githubusercontent.com/michaelthomasletts/boto3-refresh-session/refs/heads/main/doc/brs.png)
32
-
33
- A simple Python package for refreshing the temporary security credentials in a `boto3.session.Session` object automatically.
34
-
35
- - [Documentation](https://michaelthomasletts.github.io/boto3-refresh-session/index.html)
36
- - [Source Code](https://github.com/michaelthomasletts/boto3-refresh-session)
37
- - [PyPI](https://pypi.org/project/boto3-refresh-session/)
38
- - [Contributing](https://michaelthomasletts.github.io/boto3-refresh-session/contributing.html)
39
-
40
- ### Why should I use this?
41
-
42
- It is common for data pipelines and workflows that interact with the AWS API via
43
- `boto3` to run for a long time and, accordingly, for temporary credentials to
44
- expire.
45
-
46
- Usually, engineers deal with that problem one of two different ways:
47
-
48
- - A `try except` block that catches `botocore.exceptions.ClientError` exceptions
49
- - A similar approach as that used in this project -- that is, using methods available
50
- within `botocore` for refreshing temporary credentials automatically.
51
-
52
- Speaking personally, variations of the code found herein exists in code bases at
53
- nearly every company where I have worked. Sometimes, I turned that code into a module;
54
- other times, I wrote it from scratch. Clearly, that is inefficient.
55
-
56
- I decided to finally turn that code into a proper Python package with unit testing,
57
- automatic documentation, and quality checks; the idea being that, henceforth, depending
58
- on my employer's open source policy, I may simply import this package instead of
59
- reproducing the code herein for the Nth time.
60
-
61
- If any of that sounds relatable, then `boto3-refresh-session` should help you!
62
-
63
- ### Usage
64
-
65
- Simply pass the basic parameters and initialize the `RefreshableSession` object;
66
- that's it! You're good to go!
67
-
68
- `RefreshableSession` will refresh
69
- temporary credentials for you in the background. In the following example,
70
- continue using the `s3_client` object without worry of using `try` and
71
- `except` blocks!
72
-
73
- To use this package, your machine must be configured with AWS
74
- credentials. To learn more about how `boto3` searches for credentials on a
75
- machine, check [this documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html).
76
-
77
- ```python
78
- import boto3_refresh_session as brs
79
-
80
- assume_role_kwargs = {
81
- 'RoleArn': '<your-role-arn>',
82
- 'RoleSessionName': '<your-role-session-name>',
83
- 'DurationSeconds': '<your-selection>',
84
- ...
85
- }
86
- session = brs.RefreshableSession(
87
- assume_role_kwargs=assume_role_kwargs
88
- )
89
- s3 = session.client(service_name='s3')
90
- buckets = s3.list_buckets()
91
- ```
92
-
93
- ### Installation
94
-
95
- ```bash
96
- pip install boto3-refresh-session
97
- ```
98
-
99
- ### Authors
100
-
101
- - [Michael Letts](https://michaelthomasletts.github.io/)
102
-
@@ -1,6 +0,0 @@
1
- boto3_refresh_session/__init__.py,sha256=OFlvwxa3cKjI5tUhRqSBsKy8Svx65CFxQNpg6xlsiqw,149
2
- boto3_refresh_session/session.py,sha256=rQHJDvOAz0glymYXQBfSt1keFvQAM_G8AQXgMDLZq2U,5349
3
- boto3_refresh_session-1.0.4.dist-info/LICENSE,sha256=I3ZYTXAjbIly6bm6J-TvFTuuHwTKws4h89QaY5c5HiY,1067
4
- boto3_refresh_session-1.0.4.dist-info/METADATA,sha256=16Y5Ua36XnllNclnwHXqcFmGMT8_hTeL8EVIUuv1ln8,4395
5
- boto3_refresh_session-1.0.4.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
6
- boto3_refresh_session-1.0.4.dist-info/RECORD,,