boto3-assist 0.1.0__py3-none-any.whl → 0.1.1__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.
@@ -142,24 +142,37 @@ class DynamoDBHelpers:
142
142
  Wraps Up Some usefull information when dealing with
143
143
 
144
144
  """
145
- response: dict[str, List] = {"Items": [], "Batches": []}
145
+ response: dict[str, Any] = {"Items": [], "Batches": []}
146
146
  record_start: int = 0
147
+ total_count = 0
148
+ total_scanned_count = 0
149
+ record_end = 0
147
150
  for item in collection:
148
151
  record_start += 1
149
- record_end = record_start + len(collection)
152
+ record_end = record_end + len(item["Items"])
150
153
  response["Items"].extend(item["Items"])
151
- response["Batches"].append(
152
- {
153
- "LastKey": item["LastKey"],
154
- "Count": item["Count"],
155
- "Scanned": item["Scanned"],
156
- "MoreRecords": item["MoreRecords"],
157
- "Records": {"start": record_start, "end": record_end},
158
- }
159
- )
154
+
155
+ batch: dict[str, Any] = {}
156
+ if "LastEvaluatedKey" in item:
157
+ batch["LastKey"] = item["LastEvaluatedKey"]
158
+
159
+ if "Count" in item:
160
+ batch["Count"] = item["Count"]
161
+ total_count += item["Count"]
162
+
163
+ if "ScannedCount" in item:
164
+ batch["ScannedCount"] = item["ScannedCount"]
165
+ total_scanned_count += item["ScannedCount"]
166
+
167
+ batch["Records"] = {"start": record_start, "end": record_end}
168
+
169
+ response["Batches"].append(batch)
160
170
 
161
171
  record_start = record_end
162
172
 
173
+ response["Count"] = total_count
174
+ response["ScannedCount"] = total_scanned_count
175
+
163
176
  return response
164
177
 
165
178
  @staticmethod
boto3_assist/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = '0.1.0'
1
+ __version__ = '0.1.1'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: boto3_assist
3
- Version: 0.1.0
3
+ Version: 0.1.1
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
@@ -40,7 +40,7 @@ environment vars first and then load your session.
40
40
 
41
41
  ## DyamoDB model mapping and Key Generation
42
42
  It's a light weight mapping tool to turn your python classes / object models to DynamoDB items that are ready
43
- for saving. See the examples directory for more information.
43
+ for saving. See the [examples](https://github.com/geekcafe/boto3-assist/tree/main/examples) directory in the repo for more information.
44
44
 
45
45
 
46
46
  ```sh
@@ -1,10 +1,10 @@
1
1
  boto3_assist/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  boto3_assist/boto3session.py,sha256=J20E2lkqJOaey4Ohi-xRe2xABj7QsA8DrggzK29-5es,6415
3
- boto3_assist/version.py,sha256=IMjkMO3twhQzluVTo8Z6rE7Eg-9U79_LGKMcsWLKBkY,22
3
+ boto3_assist/version.py,sha256=ls1camlIoMxEZz9gSkZ1OJo-MXqHWwKPtdPbZJmwp7E,22
4
4
  boto3_assist/dynamodb/dynamodb.py,sha256=jU4R__5jjI1CmH9xVNUeU8PICD2dtbQ2CYUFKMRw0P0,14561
5
5
  boto3_assist/dynamodb/dynamodb_connection.py,sha256=JMCmWOsMzy45rikGl3Z2xqlG2vUTEKSYqi6dpsfJ750,4418
6
6
  boto3_assist/dynamodb/dynamodb_connection_tracker.py,sha256=nTNQ99sIidDoLMhMbBju2umgLmcttsmnvmd_DMy_J9M,1582
7
- boto3_assist/dynamodb/dynamodb_helpers.py,sha256=LsoNixhinEwBT7hgWc7hT-5I2qdvEAiF59ZVb19jA7Y,11833
7
+ boto3_assist/dynamodb/dynamodb_helpers.py,sha256=ajpTJ5bJOm9PDgE2Zx9p2zkTRFV4xswqJRS81SOTn1s,12198
8
8
  boto3_assist/dynamodb/dynamodb_importer.py,sha256=8SlT2W03Dvb3LIs6xqtzXP4IShyv655PgMCDNr4kmPk,2559
9
9
  boto3_assist/dynamodb/dynamodb_index.py,sha256=Uw2MmFivLp8VwDc3sNWgifc0yUvDcZD1TNawqvioi_8,5953
10
10
  boto3_assist/dynamodb/dynamodb_iservice.py,sha256=2AuaKxt7DUZbB-GpBBtPtPMpAlgZkumkAldm8vy7-sg,701
@@ -21,8 +21,8 @@ boto3_assist/utilities/datetime_utility.py,sha256=TbqGQkJDTahqvaZAIV550nhYnW1Bsq
21
21
  boto3_assist/utilities/logging_utility.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
22
  boto3_assist/utilities/serialization_utility.py,sha256=s_QQRIhtwIE7xN5nU13mNk2wtWyErBX_Sg7n0gbHj-M,4308
23
23
  boto3_assist/utilities/string_utility.py,sha256=w8l063UT3GE48tuJopETyZrjG4CgAzWkyDWMAYMg5Og,7432
24
- boto3_assist-0.1.0.dist-info/METADATA,sha256=XqXrX9CBBG0trJGOs5W_AZ33u_1ccmEH6ddLt6-wyHc,1729
25
- boto3_assist-0.1.0.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
26
- boto3_assist-0.1.0.dist-info/licenses/LICENSE-EXPLAINED.txt,sha256=WFREvTpfTjPjDHpOLADxJpCKpIla3Ht87RUUGii4ODU,606
27
- boto3_assist-0.1.0.dist-info/licenses/LICENSE.txt,sha256=PXDhFWS5L5aOTkVhNvoitHKbAkgxqMI2uUPQyrnXGiI,1105
28
- boto3_assist-0.1.0.dist-info/RECORD,,
24
+ boto3_assist-0.1.1.dist-info/METADATA,sha256=cVmT6i7LxZJ15TJ_n2yBcrhvoGzaTNs21BnOuV5gvI8,1804
25
+ boto3_assist-0.1.1.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
26
+ boto3_assist-0.1.1.dist-info/licenses/LICENSE-EXPLAINED.txt,sha256=WFREvTpfTjPjDHpOLADxJpCKpIla3Ht87RUUGii4ODU,606
27
+ boto3_assist-0.1.1.dist-info/licenses/LICENSE.txt,sha256=PXDhFWS5L5aOTkVhNvoitHKbAkgxqMI2uUPQyrnXGiI,1105
28
+ boto3_assist-0.1.1.dist-info/RECORD,,