boto3-assist 0.23.0__py3-none-any.whl → 0.25.0__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.
@@ -352,7 +352,7 @@ class DynamoDB(DynamoDBConnection):
352
352
  if not index_name:
353
353
  index_name = key.name
354
354
  # turn it into a key expected by dynamodb
355
- key = key.key()
355
+ key = key.key(query_key=True)
356
356
 
357
357
  kwargs: dict = {}
358
358
 
@@ -156,11 +156,22 @@ class DynamoDBIndex:
156
156
  condition: str = "begins_with",
157
157
  low_value: Any = None,
158
158
  high_value: Any = None,
159
+ query_key: bool = False,
159
160
  # sk_value_2: Optional[str | int | float] = None,
160
161
  ) -> dict | Key | ConditionBase | ComparisonCondition | Equals:
161
162
  """Get the key for a given index"""
162
163
  key: dict | Key | ConditionBase | ComparisonCondition | Equals
163
- if (
164
+
165
+ if query_key:
166
+ key = self._build_query_key(
167
+ include_sort_key=include_sort_key,
168
+ condition=condition,
169
+ low_value=low_value,
170
+ high_value=high_value,
171
+ )
172
+ return key
173
+
174
+ elif (
164
175
  self.name == DynamoDBIndexes.PRIMARY_INDEX
165
176
  and include_sort_key
166
177
  # if it ends with a # we are assuming that we are doing a wild card mapping
@@ -175,14 +186,15 @@ class DynamoDBIndex:
175
186
  key[self.sort_key.attribute_name] = self.sort_key.value
176
187
 
177
188
  return key
178
- else:
179
- key = self._build_query_key(
180
- include_sort_key=include_sort_key,
181
- condition=condition,
182
- low_value=low_value,
183
- high_value=high_value,
184
- )
185
- return key
189
+
190
+ # catch all (TODO: decide if this is the best pattern or should we raise an error)
191
+ key = self._build_query_key(
192
+ include_sort_key=include_sort_key,
193
+ condition=condition,
194
+ low_value=low_value,
195
+ high_value=high_value,
196
+ )
197
+ return key
186
198
 
187
199
  def _build_query_key(
188
200
  self,
boto3_assist/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = '0.23.0'
1
+ __version__ = '0.25.0'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: boto3_assist
3
- Version: 0.23.0
3
+ Version: 0.25.0
4
4
  Summary: Additional boto3 wrappers to make your life a little easier
5
5
  Author-email: Eric Wilson <boto3-assist@geekcafe.com>
6
6
  License-File: LICENSE-EXPLAINED.txt
@@ -32,7 +32,7 @@ Description-Content-Type: text/markdown
32
32
 
33
33
  This is in beta and subject to changes before it's initial 1.0.0 release
34
34
 
35
- This libary was created to make life a little easier when using boto3.
35
+ This library was created to make life a little easier when using boto3.
36
36
 
37
37
  Currently it supports:
38
38
  - User Authentication / Session Mapping
@@ -40,11 +40,11 @@ Currently it supports:
40
40
 
41
41
 
42
42
  ## User Authentication / Session Mapping
43
- Have you ever needed an easy way to load your sessions for a local, dev or production enviroment? Well this library
43
+ Have you ever needed an easy way to load your sessions for a local, dev or production environment? Well this library
44
44
  makes it a little easier by lazy loading your boto3 session so that tools like `python-dotenv` can be used to load your
45
45
  environment vars first and then load your session.
46
46
 
47
- ## DyamoDB model mapping and Key Generation
47
+ ## DynamoDB model mapping and Key Generation
48
48
  It's a light weight mapping tool to turn your python classes / object models to DynamoDB items that are ready
49
49
  for saving. See the [examples](https://github.com/geekcafe/boto3-assist/tree/main/examples) directory in the repo for more information.
50
50
 
@@ -61,7 +61,7 @@ pip install boto3-assist
61
61
  ## Running Unit Tests
62
62
  Several of our tests use a mocking library to simulate connections to S3, DynamoDB, etc. In order to use those tests, you will need to have a `.env.unittest` file at the root of this project (which our tests will attempt to locate and load).
63
63
 
64
- For your convenince the `.evn.unittest` file has been added to this project. The values should not point to live AWS profiles, instead it should use the values added.
64
+ For your convenience the `.evn.unittest` file has been added to this project. The values should not point to live AWS profiles, instead it should use the values added.
65
65
 
66
66
  Since we also point to a profile, you should create the profile in the `~/.aws/config` file. The entry should look like the following:
67
67
 
@@ -6,7 +6,7 @@ boto3_assist/connection_tracker.py,sha256=UgfR9RlvXf3A4ssMr3gDMpw89ka8mSRvJn4M34
6
6
  boto3_assist/http_status_codes.py,sha256=G0zRSWenwavYKETvDF9tNVUXQz3Ae2gXdBETYbjvJe8,3284
7
7
  boto3_assist/role_assumption_mixin.py,sha256=PMUU5yC2FUBjFD1UokVkRY3CPB5zTw85AhIB5BMtbc8,1031
8
8
  boto3_assist/session_setup_mixin.py,sha256=X-JQKyyaWNA8Z8kKgf2V2I5vsiLAH8udLTX_xepnsdQ,3140
9
- boto3_assist/version.py,sha256=pwluWaTPL8Xkb9G3PEN8_juXZgyuXodBFmQvwlw9pb4,23
9
+ boto3_assist/version.py,sha256=ZXwoHOJ1nuRTdGrZbLNxvqbzWWkFvDkI3L0gzEDgw-w,23
10
10
  boto3_assist/aws_lambda/event_info.py,sha256=OkZ4WzuGaHEu_T8sB188KBgShAJhZpWASALKRGBOhMg,14648
11
11
  boto3_assist/aws_lambda/mock_context.py,sha256=LPjHP-3YSoY6iPl1kPqJDwSVf1zLNTcukUunDtYcbK0,116
12
12
  boto3_assist/cloudwatch/cloudwatch_connection.py,sha256=mnGWaLSQpHh5EeY7Ek_2o9JKHJxOELIYtQVMX1IaHn4,2480
@@ -19,11 +19,11 @@ boto3_assist/cognito/cognito_connection.py,sha256=deuXR3cNHz0mCYff2k0LfAvK--9Okq
19
19
  boto3_assist/cognito/cognito_utility.py,sha256=IVZAg58nHG1U7uxe7FsTYpqwwZiwwdIBGiVTZuLCFqg,18417
20
20
  boto3_assist/cognito/jwks_cache.py,sha256=1Y9r-YfQ8qrgZN5xYPvjUEEV0vthbdcPdAIaPbZP7kU,373
21
21
  boto3_assist/cognito/user.py,sha256=qc44qLx3gwq6q2zMxcPQze1EjeZwy5Kuav93vbe-4WU,820
22
- boto3_assist/dynamodb/dynamodb.py,sha256=aW6kWq-Hcc6idmuFygdpUyPusPHsIvVGq2hiG8n8gBo,18481
22
+ boto3_assist/dynamodb/dynamodb.py,sha256=TiO1lnQGiWxaWZ5-nnaWMMThFl3PMkD2r5ApIxEhBC8,18495
23
23
  boto3_assist/dynamodb/dynamodb_connection.py,sha256=D4KmVpMpE0OuVOwW5g4JBWllUNkwy0hMXEGUiToAMBc,3608
24
24
  boto3_assist/dynamodb/dynamodb_helpers.py,sha256=RoRRqKjdwfC-2-gvlkLvCoNWhIoMrHm-68dkyhXI_Xk,12080
25
25
  boto3_assist/dynamodb/dynamodb_importer.py,sha256=nCKsyRQeMqDSf0Q5mQ_X_oVIg4PRnu0hcUzZnBli610,3471
26
- boto3_assist/dynamodb/dynamodb_index.py,sha256=AOIeiWkJ3dgg21PJ2vADkR61l1AA6z5IYV3WtPYlvng,8734
26
+ boto3_assist/dynamodb/dynamodb_index.py,sha256=EhLvaLQznrsbP1b8LRHDnPSUxou_JYn0fYYRLhvH26U,9085
27
27
  boto3_assist/dynamodb/dynamodb_iservice.py,sha256=O9Aj0PFEvcuk2vhARifWTFnUwcQW5EXzwZS478Hm-N0,796
28
28
  boto3_assist/dynamodb/dynamodb_key.py,sha256=4IYnG4a99AjdOKUcDaWhNF_lvZJRZcKOIPzBQQzVdB0,3294
29
29
  boto3_assist/dynamodb/dynamodb_model_base.py,sha256=Bgnjs62lHTqqJ2nZbPV1JHvcK6d2-aaRsJtcc8DEqKk,12291
@@ -57,8 +57,8 @@ boto3_assist/utilities/logging_utility.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
57
57
  boto3_assist/utilities/numbers_utility.py,sha256=wzv9d0uXT_2_ZHHio7LBzibwxPqhGpvbq9HinrVn_4A,10160
58
58
  boto3_assist/utilities/serialization_utility.py,sha256=Jc6H0cpcZjLO7tdyUZdBWHzItduLkw6sh2YQh8Hc8D8,21647
59
59
  boto3_assist/utilities/string_utility.py,sha256=XxUIz19L2LFFTRDAAmdPa8Qhn40u9yO7g4nULFuvg0M,11033
60
- boto3_assist-0.23.0.dist-info/METADATA,sha256=3Qv_kRRHYWhDr-E5jQG7qH7Y1lFy6-6qAIA8hALdMJI,2875
61
- boto3_assist-0.23.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
62
- boto3_assist-0.23.0.dist-info/licenses/LICENSE-EXPLAINED.txt,sha256=WFREvTpfTjPjDHpOLADxJpCKpIla3Ht87RUUGii4ODU,606
63
- boto3_assist-0.23.0.dist-info/licenses/LICENSE.txt,sha256=PXDhFWS5L5aOTkVhNvoitHKbAkgxqMI2uUPQyrnXGiI,1105
64
- boto3_assist-0.23.0.dist-info/RECORD,,
60
+ boto3_assist-0.25.0.dist-info/METADATA,sha256=OMCf1gbVokM0aOSksJTPEPXmoCP6KCWVfLA7MOQS0AM,2879
61
+ boto3_assist-0.25.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
62
+ boto3_assist-0.25.0.dist-info/licenses/LICENSE-EXPLAINED.txt,sha256=WFREvTpfTjPjDHpOLADxJpCKpIla3Ht87RUUGii4ODU,606
63
+ boto3_assist-0.25.0.dist-info/licenses/LICENSE.txt,sha256=PXDhFWS5L5aOTkVhNvoitHKbAkgxqMI2uUPQyrnXGiI,1105
64
+ boto3_assist-0.25.0.dist-info/RECORD,,