cc-py-commons 0.4.7__tar.gz → 0.4.9__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 (137) hide show
  1. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/PKG-INFO +1 -1
  2. cc_py_commons-0.4.9/cc_py_commons/db/create_table.py +14 -0
  3. cc_py_commons-0.4.9/cc_py_commons/db/delete_table.py +13 -0
  4. cc_py_commons-0.4.9/cc_py_commons/sqs/sqs_service.py +25 -0
  5. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons.egg-info/PKG-INFO +1 -1
  6. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons.egg-info/SOURCES.txt +2 -0
  7. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/setup.py +1 -1
  8. cc_py_commons-0.4.7/cc_py_commons/sqs/sqs_service.py +0 -17
  9. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/README.md +0 -0
  10. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/__init__.py +0 -0
  11. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/bids/__init__.py +0 -0
  12. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/bids/bid.py +0 -0
  13. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/bids/bid_history.py +0 -0
  14. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/bids/bid_history_schema.py +0 -0
  15. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/bids/bid_schema.py +0 -0
  16. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/carriers/__init__.py +0 -0
  17. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/carriers/account_carrier_map.py +0 -0
  18. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/carriers/account_carrier_map_schema.py +0 -0
  19. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/carriers/carrier.py +0 -0
  20. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/carriers/carrier_schema.py +0 -0
  21. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/carriers/contact.py +0 -0
  22. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/carriers/contact_schema.py +0 -0
  23. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/config/__init__.py +0 -0
  24. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/config/env.py +0 -0
  25. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/config/mcleod_load_fields.py +0 -0
  26. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/config/pc_miler_config.py +0 -0
  27. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/db/__init__.py +0 -0
  28. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/db/connection.py +0 -0
  29. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/geolocate.py +0 -0
  30. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/lanes/__init__.py +0 -0
  31. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/lanes/carrier_lane.py +0 -0
  32. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/lanes/carrier_lane_schema.py +0 -0
  33. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/lanes/lane.py +0 -0
  34. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/lanes/lane_schema.py +0 -0
  35. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/loads/__init__.py +0 -0
  36. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/loads/equipment.py +0 -0
  37. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/loads/equipment_schema.py +0 -0
  38. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/loads/equipment_types.py +0 -0
  39. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/loads/freighthub_contact.py +0 -0
  40. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/loads/freighthub_contact_schema.py +0 -0
  41. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/loads/load.py +0 -0
  42. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/loads/load_schema.py +0 -0
  43. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/loads/load_status.py +0 -0
  44. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/loads/location.py +0 -0
  45. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/loads/location_schema.py +0 -0
  46. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/loads/map_load_response.py +0 -0
  47. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/quotes/__init__.py +0 -0
  48. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/quotes/quote.py +0 -0
  49. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/quotes/quote_schema.py +0 -0
  50. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/quotes/quote_status.py +0 -0
  51. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/rfp/__init__.py +0 -0
  52. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/rfp/lane_price_result_fields.py +0 -0
  53. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/rfp/price_lane_file_input_fields.py +0 -0
  54. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/rfp/rfp_status.py +0 -0
  55. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/schemas/__init__.py +0 -0
  56. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/schemas/camel_case_schema.py +0 -0
  57. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/__init__.py +0 -0
  58. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/booking_agent/__init__.py +0 -0
  59. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/booking_agent/accept_bid.py +0 -0
  60. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/booking_agent/cancel_bid.py +0 -0
  61. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/booking_agent/constants.py +0 -0
  62. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/booking_agent/counter_bid.py +0 -0
  63. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/booking_agent/decline_bid.py +0 -0
  64. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/booking_agent/get_bid_by_amazon_order_id.py +0 -0
  65. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/booking_agent/get_quote.py +0 -0
  66. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/booking_agent/update_bid.py +0 -0
  67. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/c4/__init__.py +0 -0
  68. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/c4/amazon_session_token.py +0 -0
  69. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/c4/constants.py +0 -0
  70. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/c4/get_account.py +0 -0
  71. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/c4/get_integration.py +0 -0
  72. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/c4/get_users_for_account.py +0 -0
  73. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/c4/refresh_amazon_token.py +0 -0
  74. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/carrier_hub/__init__.py +0 -0
  75. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/carrier_hub/get_carrier.py +0 -0
  76. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/carrier_hub/list_carriers.py +0 -0
  77. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/carrier_hub/list_contacts.py +0 -0
  78. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/carrier_hub/update_contact.py +0 -0
  79. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/freight_hub/__init__.py +0 -0
  80. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/freight_hub/post_freight_hub_load.py +0 -0
  81. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/mercury/__init__.py +0 -0
  82. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/mercury/create_account_folder.py +0 -0
  83. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/mercury/get_client.py +0 -0
  84. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/mercury/get_green_screens_lane_price.py +0 -0
  85. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/mercury/get_import_stat.py +0 -0
  86. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/mercury/get_lane_price.py +0 -0
  87. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/mercury/get_lane_price_for_bulk.py +0 -0
  88. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/mercury/list_clients.py +0 -0
  89. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/mercury/post_import_stat.py +0 -0
  90. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/mercury/update_import_stat.py +0 -0
  91. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/slack/__init__.py +0 -0
  92. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/services/slack/send_slack_message.py +0 -0
  93. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/sns/__init__.py +0 -0
  94. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/sns/book_load_notification.py +0 -0
  95. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/sns/booking_agent/__init__.py +0 -0
  96. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/sns/booking_agent/bid_counter_failure_notification.py +0 -0
  97. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/sns/booking_agent/constants.py +0 -0
  98. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/sns/booking_agent/send_sns_notification.py +0 -0
  99. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/sns/booking_assistant_flow_notification.py +0 -0
  100. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/sns/import_movements_notification.py +0 -0
  101. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/sns/parsed_carrier_notification.py +0 -0
  102. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/sns/sns_service.py +0 -0
  103. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/sqs/__init__.py +0 -0
  104. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/sqs/booking_assistant_flow_event.py +0 -0
  105. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/tests/__init__.py +0 -0
  106. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/tests/test_case_conversion.py +0 -0
  107. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/tests/test_lambda_utils.py +0 -0
  108. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/tests/test_map_transaction.py +0 -0
  109. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/tests/test_temperature_utils.py +0 -0
  110. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/transactions/__init__.py +0 -0
  111. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/transactions/equipment_clas_schema.py +0 -0
  112. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/transactions/equipment_class.py +0 -0
  113. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/transactions/equipment_mapping.py +0 -0
  114. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/transactions/equipment_mapping_schema.py +0 -0
  115. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/transactions/map_transaction.py +0 -0
  116. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/transactions/transaction.py +0 -0
  117. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/transactions/transaction_schema.py +0 -0
  118. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/utils/__init__.py +0 -0
  119. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/utils/case_conversion.py +0 -0
  120. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/utils/datadog_logger.py +0 -0
  121. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/utils/datetimes.py +0 -0
  122. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/utils/dimension_utils.py +0 -0
  123. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/utils/get_delivery_date.py +0 -0
  124. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/utils/json_logger.py +0 -0
  125. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/utils/lambda_utils.py +0 -0
  126. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/utils/local_file.py +0 -0
  127. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/utils/logger.py +0 -0
  128. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/utils/logger_v2.py +0 -0
  129. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/utils/pc_miler_utils.py +0 -0
  130. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/utils/price_utils.py +0 -0
  131. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/utils/redis.py +0 -0
  132. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/utils/s3_file.py +0 -0
  133. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons/utils/temperature_utils.py +0 -0
  134. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons.egg-info/dependency_links.txt +0 -0
  135. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons.egg-info/requires.txt +0 -0
  136. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/cc_py_commons.egg-info/top_level.txt +0 -0
  137. {cc_py_commons-0.4.7 → cc_py_commons-0.4.9}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cc_py_commons
3
- Version: 0.4.7
3
+ Version: 0.4.9
4
4
  Summary: Common code for microservices
5
5
  Home-page: https://github.com/Cargo-Chief/py-commons
6
6
  Author: CargoChief
@@ -0,0 +1,14 @@
1
+ from cc_py_commons.db import connection as db_connection
2
+
3
+
4
+ def execute(table_name):
5
+ conn = None
6
+ try:
7
+ conn = db_connection.get()
8
+ cursor = conn.cursor()
9
+ sql_query = f"CREATE TABLE {table_name} (search_result text)"
10
+ cursor.execute(sql_query)
11
+ conn.commit()
12
+ finally:
13
+ db_connection.close(conn)
14
+ return table_name
@@ -0,0 +1,13 @@
1
+ from cc_py_commons.db import connection as db_connection
2
+
3
+
4
+ def execute(table_name):
5
+ conn = None
6
+ try:
7
+ conn = db_connection.get()
8
+ cursor = conn.cursor()
9
+ sql_query = f'DROP TABLE IF EXISTS {table_name}'
10
+ cursor.execute(sql_query)
11
+ conn.commit()
12
+ finally:
13
+ db_connection.close(conn)
@@ -0,0 +1,25 @@
1
+ import boto3
2
+
3
+ class SqsService:
4
+ def send(self, queue_url, message, delaySeconds=0, messageGroupId=None):
5
+ '''
6
+ Sends a message to the specified queue and returns the messageId.
7
+ The messageId can be used to lookup and delete the message in the queue.
8
+ '''
9
+ sqs = boto3.client('sqs')
10
+ if messageGroupId:
11
+ response = sqs.send_message(
12
+ QueueUrl=queue_url,
13
+ MessageBody=message,
14
+ DelaySeconds=delaySeconds,
15
+ MessageAttributes={},
16
+ MessageGroupId=messageGroupId
17
+ )
18
+ else:
19
+ response = sqs.send_message(
20
+ QueueUrl=queue_url,
21
+ MessageBody=message,
22
+ DelaySeconds=delaySeconds,
23
+ MessageAttributes={}
24
+ )
25
+ return response.get('MessageId')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cc-py-commons
3
- Version: 0.4.7
3
+ Version: 0.4.9
4
4
  Summary: Common code for microservices
5
5
  Home-page: https://github.com/Cargo-Chief/py-commons
6
6
  Author: CargoChief
@@ -25,6 +25,8 @@ cc_py_commons/config/mcleod_load_fields.py
25
25
  cc_py_commons/config/pc_miler_config.py
26
26
  cc_py_commons/db/__init__.py
27
27
  cc_py_commons/db/connection.py
28
+ cc_py_commons/db/create_table.py
29
+ cc_py_commons/db/delete_table.py
28
30
  cc_py_commons/lanes/__init__.py
29
31
  cc_py_commons/lanes/carrier_lane.py
30
32
  cc_py_commons/lanes/carrier_lane_schema.py
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
3
3
  setup(
4
4
  name='cc_py_commons',
5
5
  description='Common code for microservices',
6
- version='0.4.7',
6
+ version='0.4.9',
7
7
  url='https://github.com/Cargo-Chief/py-commons',
8
8
  author='CargoChief',
9
9
  author_email='engineering@cargochief.com',
@@ -1,17 +0,0 @@
1
- import boto3
2
-
3
- class SqsService:
4
- def send(self, queue_url, message, delaySeconds=0, messageGroupId=None):
5
- '''
6
- Sends a message to the specified queue and returns the messageId.
7
- The messageId can be used to lookup and delete the message in the queue.
8
- '''
9
- sqs = boto3.client('sqs')
10
- response = sqs.send_message(
11
- QueueUrl=queue_url,
12
- MessageBody=message,
13
- DelaySeconds=delaySeconds,
14
- MessageAttributes={},
15
- MessageGroupId=messageGroupId
16
- )
17
- return response.get('MessageId')
File without changes
File without changes