boto3-assist 0.1.10__tar.gz → 0.1.12__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.
Files changed (81) hide show
  1. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/PKG-INFO +1 -1
  2. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/pyproject.toml +1 -1
  3. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/src/boto3_assist/connection_tracker.py +19 -11
  4. boto3_assist-0.1.12/src/boto3_assist/dynamodb/dynamodb_connection_tracker.py +17 -0
  5. boto3_assist-0.1.12/src/boto3_assist/version.py +1 -0
  6. boto3_assist-0.1.10/src/boto3_assist/dynamodb/dynamodb_connection_tracker.py +0 -46
  7. boto3_assist-0.1.10/src/boto3_assist/version.py +0 -1
  8. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/.env.development +0 -0
  9. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/.env.docker +0 -0
  10. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/.env.docker.001 +0 -0
  11. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/.env.docker.nosql.workbench +0 -0
  12. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/.gitignore +0 -0
  13. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/.vscode/launch.json +0 -0
  14. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/.vscode/settings.json +0 -0
  15. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/.vscode/tasks.json +0 -0
  16. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/LICENSE-EXPLAINED.txt +0 -0
  17. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/LICENSE.txt +0 -0
  18. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/README.md +0 -0
  19. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/aws_regions_with_status.csv +0 -0
  20. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/aws_regions_with_status.json +0 -0
  21. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/devops/build.py +0 -0
  22. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/devops/readme.md +0 -0
  23. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/examples/__init__.py +0 -0
  24. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/examples/dynamodb/models/order_item_model.py +0 -0
  25. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/examples/dynamodb/models/order_model.py +0 -0
  26. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/examples/dynamodb/models/product_model.py +0 -0
  27. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/examples/dynamodb/models/user_model.py +0 -0
  28. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/examples/dynamodb/models/user_post_model.py +0 -0
  29. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/examples/dynamodb/order_example/main.py +0 -0
  30. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/examples/dynamodb/order_example/products.json +0 -0
  31. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/examples/dynamodb/services/order_item_service.py +0 -0
  32. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/examples/dynamodb/services/order_service.py +0 -0
  33. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/examples/dynamodb/services/product_service.py +0 -0
  34. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/examples/dynamodb/services/table_service.py +0 -0
  35. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/examples/dynamodb/services/user_post_service.py +0 -0
  36. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/examples/dynamodb/services/user_service.py +0 -0
  37. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/examples/dynamodb/services/user_service_client_example.py +0 -0
  38. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/examples/dynamodb/services/user_service_resource_example.py +0 -0
  39. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/examples/dynamodb/user_post_example/main.py +0 -0
  40. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/examples/ec2/regions_report.py +0 -0
  41. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/module-headers.txt +0 -0
  42. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/mypy.ini +0 -0
  43. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/requirements-dev.txt +0 -0
  44. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/requirements.txt +0 -0
  45. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/run-checks.sh +0 -0
  46. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/src/boto3_assist/__init__.py +0 -0
  47. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/src/boto3_assist/boto3session.py +0 -0
  48. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/src/boto3_assist/dynamodb/dynamodb.py +0 -0
  49. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/src/boto3_assist/dynamodb/dynamodb_connection.py +0 -0
  50. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/src/boto3_assist/dynamodb/dynamodb_helpers.py +0 -0
  51. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/src/boto3_assist/dynamodb/dynamodb_importer.py +0 -0
  52. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/src/boto3_assist/dynamodb/dynamodb_index.py +0 -0
  53. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/src/boto3_assist/dynamodb/dynamodb_iservice.py +0 -0
  54. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/src/boto3_assist/dynamodb/dynamodb_key.py +0 -0
  55. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/src/boto3_assist/dynamodb/dynamodb_model_base.py +0 -0
  56. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/src/boto3_assist/dynamodb/dynamodb_model_base_interfaces.py +0 -0
  57. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/src/boto3_assist/dynamodb/dynamodb_reindexer.py +0 -0
  58. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/src/boto3_assist/dynamodb/dynamodb_reserved_words.py +0 -0
  59. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/src/boto3_assist/dynamodb/dynamodb_reserved_words.txt +0 -0
  60. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/src/boto3_assist/dynamodb/readme.md +0 -0
  61. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/src/boto3_assist/dynamodb/troubleshooting.md +0 -0
  62. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/src/boto3_assist/ec2/ec2_connection.py +0 -0
  63. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/src/boto3_assist/environment_services/__init__.py +0 -0
  64. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/src/boto3_assist/environment_services/environment_loader.py +0 -0
  65. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/src/boto3_assist/environment_services/environment_variables.py +0 -0
  66. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/src/boto3_assist/utilities/datetime_utility.py +0 -0
  67. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/src/boto3_assist/utilities/logging_utility.py +0 -0
  68. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/src/boto3_assist/utilities/serialization_utility.py +0 -0
  69. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/src/boto3_assist/utilities/string_utility.py +0 -0
  70. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/tests/__init__.py +0 -0
  71. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/tests/__top/__init__.py +0 -0
  72. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/tests/dynamodb/__init__.py +0 -0
  73. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/tests/dynamodb/dynamodb_model_base_test.py +0 -0
  74. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/tests/dynamodb/dynamodb_model_projections_test.py +0 -0
  75. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/tests/dynamodb/dynamodb_reindex_test.py +0 -0
  76. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/tests/dynamodb/models/simple_model.py +0 -0
  77. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/tests/dynamodb/models/user_model.py +0 -0
  78. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/tests/examples_test/__init__.py +0 -0
  79. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/tests/examples_test/user_service_test.py +0 -0
  80. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/tests/utilities/__init__.py +0 -0
  81. {boto3_assist-0.1.10 → boto3_assist-0.1.12}/tests/utilities/serialization_utility_test.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: boto3_assist
3
- Version: 0.1.10
3
+ Version: 0.1.12
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
@@ -7,7 +7,7 @@ packages = ["src/boto3_assist"]
7
7
 
8
8
  [project]
9
9
  name = "boto3_assist"
10
- version = "0.1.10"
10
+ version = "0.1.12"
11
11
  authors = [
12
12
  { name="Eric Wilson", email="boto3-assist@geekcafe.com" }
13
13
  ]
@@ -15,12 +15,19 @@ class ConnectionTracker:
15
15
  """
16
16
 
17
17
  def __init__(self, service_name: str) -> None:
18
- self.__stack_trace_env_var: str = "ISSUE_STACK_TRACE"
18
+ self.__stack_trace_env_var: str = "BOTO3_ASSIST_CONNECTION_STACK_TRACE"
19
19
  self.__connection_couter: int = 0
20
20
  self.__service_name: str = service_name
21
- self.__issue_stack_trace: bool = (
22
- os.getenv(f"{self.__stack_trace_env_var}", "false") == "true"
23
- )
21
+ self.__issue_stack_trace: bool | None = None
22
+
23
+ @property
24
+ def issue_stack_trace(self) -> bool:
25
+ """Returns True if the stack trace should be issued"""
26
+ if self.__issue_stack_trace is None:
27
+ self.__issue_stack_trace = (
28
+ os.getenv(self.__stack_trace_env_var, "").lower() == "true"
29
+ )
30
+ return self.__issue_stack_trace
24
31
 
25
32
  def increment_connection(self) -> None:
26
33
  """Increments the connection counter"""
@@ -32,11 +39,18 @@ class ConnectionTracker:
32
39
  if self.__service_name:
33
40
  service_message = f"Your {self.__service_name} service has more than one connection.\n"
34
41
 
35
- if not self.__issue_stack_trace:
42
+ if not self.issue_stack_trace:
36
43
  stack_trace_message = (
37
44
  f"\nTo add addtional information to the log and determine where additional connections are being created"
38
45
  f", set the environment variable {self.__stack_trace_env_var} to true.\n"
39
46
  )
47
+ else:
48
+ stack = "\n".join(traceback.format_stack())
49
+ stack_trace_message = (
50
+ f"\nStack Trace Enabeld with {self.__stack_trace_env_var}"
51
+ f"\n{stack}"
52
+ )
53
+
40
54
  self.__log_warning(
41
55
  f"{service_message}"
42
56
  f"Your dynamodb connection count is {self.connection_count}. "
@@ -48,12 +62,6 @@ class ConnectionTracker:
48
62
  f"{stack_trace_message}"
49
63
  )
50
64
 
51
- # do a stack trace
52
- if self.__issue_stack_trace:
53
- print("Stack Trace")
54
- traceback.print_stack()
55
- print("")
56
-
57
65
  def decrement_connection(self) -> None:
58
66
  """Decrements the connection counter"""
59
67
  self.__connection_couter -= 1
@@ -0,0 +1,17 @@
1
+ """
2
+ Geek Cafe, LLC
3
+ Maintainers: Eric Wilson
4
+ MIT License. See Project Root for the license information.
5
+ """
6
+
7
+ from boto3_assist.connection_tracker import ConnectionTracker
8
+
9
+
10
+ class DynamoDBConnectionTracker(ConnectionTracker):
11
+ """
12
+ Tracks DynamoDB Connection Requests.
13
+ Useful in for performance tuning and debugging.
14
+ """
15
+
16
+ def __init__(self) -> None:
17
+ super().__init__("DynamoDB")
@@ -0,0 +1 @@
1
+ __version__ = '0.1.12'
@@ -1,46 +0,0 @@
1
- """
2
- Geek Cafe, LLC
3
- Maintainers: Eric Wilson
4
- MIT License. See Project Root for the license information.
5
- """
6
-
7
-
8
- class DynamoDBConnectionTracker:
9
- """
10
- Tracks DynamoDB Connection Requests.
11
- Useful in for performance tuning and debugging.
12
- """
13
-
14
- def __init__(self) -> None:
15
- self.__connection_couter: int = 0
16
-
17
- def increment_connection(self) -> None:
18
- """Increments the connection counter"""
19
- self.__connection_couter += 1
20
-
21
- if self.connection_count > 1:
22
- self.__log_warning(
23
- f"Your dynamodb connection count is {self.connection_count}. "
24
- "Under most circumstances you should be able to use the same connection "
25
- "vs. creating a new one. Connections are expensive in terms of time / latency. "
26
- "If you are seeing perforance issues, check how and where you are creating your "
27
- "connections. You should be able to pass the .db connection to your other objects "
28
- "and reuse your dynamodb boto connections."
29
- )
30
-
31
- def decrement_connection(self) -> None:
32
- """Decrements the connection counter"""
33
- self.__connection_couter -= 1
34
-
35
- @property
36
- def connection_count(self) -> int:
37
- """Returns the current connection count"""
38
- return self.__connection_couter
39
-
40
- def reset(self) -> None:
41
- """Resets the connection counter"""
42
- self.__connection_couter = 0
43
-
44
- def __log_warning(self, message: str) -> None:
45
- """Logs a warning message"""
46
- print(f"Warning: {message}")
@@ -1 +0,0 @@
1
- __version__ = '0.1.10'
File without changes
File without changes
File without changes
File without changes
File without changes