velocity-python 0.0.117__tar.gz → 0.0.118__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.

Potentially problematic release.


This version of velocity-python might be problematic. Click here for more details.

Files changed (85) hide show
  1. {velocity_python-0.0.117/src/velocity_python.egg-info → velocity_python-0.0.118}/PKG-INFO +1 -1
  2. {velocity_python-0.0.117 → velocity_python-0.0.118}/pyproject.toml +1 -1
  3. velocity_python-0.0.118/src/velocity/__init__.py +8 -0
  4. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/aws/__init__.py +3 -0
  5. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/aws/amplify.py +6 -7
  6. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/aws/handlers/__init__.py +2 -0
  7. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/aws/handlers/context.py +2 -2
  8. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/aws/handlers/lambda_handler.py +4 -8
  9. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/aws/handlers/response.py +1 -1
  10. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/aws/handlers/sqs_handler.py +1 -6
  11. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/db/__init__.py +15 -0
  12. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/db/core/decorators.py +0 -1
  13. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/db/core/engine.py +3 -5
  14. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/db/core/result.py +0 -2
  15. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/db/core/table.py +4 -4
  16. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/db/servers/mysql.py +2 -3
  17. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/db/servers/postgres/sql.py +4 -4
  18. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/db/servers/sqlite.py +2 -2
  19. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/db/servers/sqlserver.py +3 -3
  20. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/db/utils.py +1 -1
  21. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/misc/conv/__init__.py +2 -0
  22. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/misc/conv/iconv.py +5 -4
  23. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/misc/export.py +1 -4
  24. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/misc/merge.py +1 -1
  25. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/misc/tools.py +0 -1
  26. {velocity_python-0.0.117 → velocity_python-0.0.118/src/velocity_python.egg-info}/PKG-INFO +1 -1
  27. velocity_python-0.0.117/src/velocity/__init__.py +0 -6
  28. {velocity_python-0.0.117 → velocity_python-0.0.118}/LICENSE +0 -0
  29. {velocity_python-0.0.117 → velocity_python-0.0.118}/README.md +0 -0
  30. {velocity_python-0.0.117 → velocity_python-0.0.118}/setup.cfg +0 -0
  31. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/app/__init__.py +0 -0
  32. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/app/invoices.py +0 -0
  33. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/app/orders.py +0 -0
  34. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/app/payments.py +0 -0
  35. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/app/purchase_orders.py +0 -0
  36. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/aws/handlers/base_handler.py +0 -0
  37. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/aws/handlers/exceptions.py +0 -0
  38. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/db/core/__init__.py +0 -0
  39. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/db/core/column.py +0 -0
  40. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/db/core/database.py +0 -0
  41. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/db/core/exceptions.py +0 -0
  42. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/db/core/row.py +0 -0
  43. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/db/core/sequence.py +0 -0
  44. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/db/core/transaction.py +0 -0
  45. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/db/exceptions.py +0 -0
  46. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/db/servers/__init__.py +0 -0
  47. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/db/servers/mysql_reserved.py +0 -0
  48. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/db/servers/postgres/__init__.py +0 -0
  49. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/db/servers/postgres/operators.py +0 -0
  50. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/db/servers/postgres/reserved.py +0 -0
  51. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/db/servers/postgres/types.py +0 -0
  52. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/db/servers/sqlite_reserved.py +0 -0
  53. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/db/servers/sqlserver_reserved.py +0 -0
  54. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/db/servers/tablehelper.py +0 -0
  55. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/misc/__init__.py +0 -0
  56. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/misc/conv/oconv.py +0 -0
  57. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/misc/db.py +0 -0
  58. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/misc/format.py +0 -0
  59. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/misc/mail.py +0 -0
  60. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity/misc/timer.py +0 -0
  61. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity_python.egg-info/SOURCES.txt +0 -0
  62. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity_python.egg-info/dependency_links.txt +0 -0
  63. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity_python.egg-info/requires.txt +0 -0
  64. {velocity_python-0.0.117 → velocity_python-0.0.118}/src/velocity_python.egg-info/top_level.txt +0 -0
  65. {velocity_python-0.0.117 → velocity_python-0.0.118}/tests/test_cursor_rowcount_fix.py +0 -0
  66. {velocity_python-0.0.117 → velocity_python-0.0.118}/tests/test_db.py +0 -0
  67. {velocity_python-0.0.117 → velocity_python-0.0.118}/tests/test_db_utils.py +0 -0
  68. {velocity_python-0.0.117 → velocity_python-0.0.118}/tests/test_email_processing.py +0 -0
  69. {velocity_python-0.0.117 → velocity_python-0.0.118}/tests/test_fix.py +0 -0
  70. {velocity_python-0.0.117 → velocity_python-0.0.118}/tests/test_format.py +0 -0
  71. {velocity_python-0.0.117 → velocity_python-0.0.118}/tests/test_iconv.py +0 -0
  72. {velocity_python-0.0.117 → velocity_python-0.0.118}/tests/test_merge.py +0 -0
  73. {velocity_python-0.0.117 → velocity_python-0.0.118}/tests/test_oconv.py +0 -0
  74. {velocity_python-0.0.117 → velocity_python-0.0.118}/tests/test_original_error.py +0 -0
  75. {velocity_python-0.0.117 → velocity_python-0.0.118}/tests/test_payment_profile_sorting.py +0 -0
  76. {velocity_python-0.0.117 → velocity_python-0.0.118}/tests/test_postgres.py +0 -0
  77. {velocity_python-0.0.117 → velocity_python-0.0.118}/tests/test_process_error_robustness.py +0 -0
  78. {velocity_python-0.0.117 → velocity_python-0.0.118}/tests/test_response.py +0 -0
  79. {velocity_python-0.0.117 → velocity_python-0.0.118}/tests/test_result_caching.py +0 -0
  80. {velocity_python-0.0.117 → velocity_python-0.0.118}/tests/test_result_sql_aware.py +0 -0
  81. {velocity_python-0.0.117 → velocity_python-0.0.118}/tests/test_row_get_missing_column.py +0 -0
  82. {velocity_python-0.0.117 → velocity_python-0.0.118}/tests/test_spreadsheet_functions.py +0 -0
  83. {velocity_python-0.0.117 → velocity_python-0.0.118}/tests/test_sql_builder.py +0 -0
  84. {velocity_python-0.0.117 → velocity_python-0.0.118}/tests/test_tablehelper.py +0 -0
  85. {velocity_python-0.0.117 → velocity_python-0.0.118}/tests/test_timer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: velocity-python
3
- Version: 0.0.117
3
+ Version: 0.0.118
4
4
  Summary: A rapid application development library for interfacing with data storage
5
5
  Author-email: Velocity Team <info@codeclubs.org>
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "velocity-python"
7
- version = "0.0.117"
7
+ version = "0.0.118"
8
8
  authors = [
9
9
  { name="Velocity Team", email="info@codeclubs.org" },
10
10
  ]
@@ -0,0 +1,8 @@
1
+ __version__ = version = "0.0.118"
2
+
3
+ from . import aws
4
+ from . import db
5
+ from . import misc
6
+ from . import app
7
+
8
+ __all__ = ["aws", "db", "misc", "app"]
@@ -18,3 +18,6 @@ class AWS(object):
18
18
  response = requests.get("http://169.254.169.254/latest/meta-data/instance-id")
19
19
  instance_id = response.text
20
20
  return instance_id
21
+
22
+
23
+ __all__ = ["AmplifyProject", "AWS"]
@@ -1,4 +1,5 @@
1
1
  import boto3
2
+ import time
2
3
 
3
4
 
4
5
  class AmplifyProject:
@@ -320,10 +321,10 @@ class AmplifyProject:
320
321
  "Effect": "Allow",
321
322
  "Resource": "*",
322
323
  "Action": [
323
- "ec2:DescribeInstances",
324
+ "ec2:DescribeInstances",
324
325
  "ec2:CreateNetworkInterface",
325
326
  "ec2:AttachNetworkInterface",
326
- "ec2:DescribeNetworkInterfaces",
327
+ "ec2:DescribeNetworkInterfaces",
327
328
  "ec2:DeleteNetworkInterface",
328
329
  "ec2:DescribeSecurityGroups",
329
330
  "ec2:AuthorizeSecurityGroupIngress",
@@ -394,10 +395,9 @@ class AmplifyProject:
394
395
  except Exception:
395
396
  pass
396
397
 
397
- def check_policies(
398
- self,
399
- ):
398
+ def check_policies(self, function):
400
399
  # Attach a role policy
400
+ iam_client = boto3.client("iam")
401
401
  response = iam_client.list_attached_role_policies(
402
402
  RoleName=function["Role"].split("/")[1]
403
403
  )
@@ -431,7 +431,7 @@ class AmplifyProject:
431
431
  print(f"\n🔧 Applying {len(env_vars)} environment variables...")
432
432
  for function_name in self.list_lambda_functions_filtered(branch):
433
433
  print(f"➡️ Updating Lambda function: {function_name}")
434
- self.update_lambda_env(function_name, env_vars)
434
+ self.update_lambda_function(function_name, env_vars)
435
435
 
436
436
  print(
437
437
  "✅ Environment variables successfully applied to matching Lambda functions.\n"
@@ -440,7 +440,6 @@ class AmplifyProject:
440
440
 
441
441
  def main():
442
442
  app_id = "d3c209q3ri53mk"
443
- branch = "demo"
444
443
  app = AmplifyProject(app_id)
445
444
  print(app.list_backend_branches())
446
445
 
@@ -1,3 +1,5 @@
1
1
  from velocity.aws.handlers.response import Response
2
2
  from velocity.aws.handlers.lambda_handler import LambdaHandler
3
3
  from velocity.aws.handlers.sqs_handler import SqsHandler
4
+
5
+ __all__ = ["Response", "LambdaHandler", "SqsHandler"]
@@ -196,7 +196,7 @@ class Context:
196
196
  if isinstance(payload, dict):
197
197
  payload = [payload]
198
198
  messages = []
199
- if user == None:
199
+ if user is None:
200
200
  user = self.session.get("email_address") or "EnqueueTasks"
201
201
  for item in payload:
202
202
  message = {"action": action, "payload": item}
@@ -216,7 +216,7 @@ class Context:
216
216
  "batch_id": str(batch_id),
217
217
  "job_id": id,
218
218
  "status": "Initialized",
219
- "message": f"Job Initialized",
219
+ "message": "Job Initialized",
220
220
  }
221
221
  )
222
222
  messages.append({"Id": id, "MessageBody": to_json(message)})
@@ -1,11 +1,6 @@
1
- from velocity.misc.format import to_json
2
1
  import json
3
- import sys
4
- import os
5
- import traceback
6
2
  from velocity.aws.handlers.base_handler import BaseHandler
7
3
  from velocity.aws.handlers.response import Response
8
- from velocity.aws.handlers.exceptions import AlertError
9
4
  from . import context
10
5
 
11
6
  # TODO: helpers import needs to be resolved - may need to pass table name instead
@@ -54,7 +49,7 @@ class LambdaHandler(BaseHandler):
54
49
  if isinstance(body, str) and len(body) > 0:
55
50
  try:
56
51
  postdata = json.loads(body)
57
- except:
52
+ except (json.JSONDecodeError, TypeError):
58
53
  postdata = {"raw_body": body}
59
54
  elif isinstance(body, dict):
60
55
  postdata = body
@@ -62,7 +57,7 @@ class LambdaHandler(BaseHandler):
62
57
  try:
63
58
  new = "\n".join(body)
64
59
  postdata = json.loads(new)
65
- except:
60
+ except (json.JSONDecodeError, TypeError):
66
61
  postdata = {"raw_body": body}
67
62
 
68
63
  req_params = self.aws_event.get("queryStringParameters") or {}
@@ -90,7 +85,8 @@ class LambdaHandler(BaseHandler):
90
85
  "sys_modified_by": self.session["email_address"],
91
86
  }
92
87
  )
93
- tx.table(helpers.get_tracking_table(user or self.session)).insert(data)
88
+ # TODO: Fix undefined helpers reference
89
+ # tx.table(helpers.get_tracking_table(user or self.session)).insert(data)
94
90
 
95
91
  def OnActionDefault(self, tx, context):
96
92
  context.response().set_body(
@@ -1,6 +1,6 @@
1
1
  import sys
2
2
  import traceback
3
- from typing import Any, Dict, List, Optional, Union
3
+ from typing import Any, Dict, List, Optional
4
4
  from velocity.misc.format import to_json
5
5
  from support.app import DEBUG
6
6
 
@@ -6,15 +6,10 @@ It includes logging capabilities, action routing, and error handling.
6
6
  """
7
7
 
8
8
  import json
9
- import os
10
- import sys
11
- import traceback
12
- from typing import Any, Dict, Optional
9
+ from typing import Any, Dict
13
10
 
14
- from velocity.aws import DEBUG
15
11
  from velocity.aws.handlers import context as VelocityContext
16
12
  from velocity.aws.handlers.base_handler import BaseHandler
17
- from velocity.misc.format import to_json
18
13
 
19
14
 
20
15
  class SqsHandler(BaseHandler):
@@ -17,3 +17,18 @@ from velocity.db.utils import (
17
17
  group_by_fields,
18
18
  safe_sort_grouped_rows,
19
19
  )
20
+
21
+ __all__ = [
22
+ "exceptions",
23
+ "postgres",
24
+ "mysql",
25
+ "sqlite",
26
+ "sqlserver",
27
+ "utils",
28
+ "safe_sort_rows",
29
+ "safe_sort_key_none_last",
30
+ "safe_sort_key_none_first",
31
+ "safe_sort_key_with_default",
32
+ "group_by_fields",
33
+ "safe_sort_grouped_rows",
34
+ ]
@@ -1,6 +1,5 @@
1
1
  import time
2
2
  import random
3
- import traceback
4
3
  from functools import wraps
5
4
  from velocity.db import exceptions
6
5
 
@@ -1,7 +1,5 @@
1
1
  import inspect
2
- import sys
3
2
  import re
4
- import traceback
5
3
  from functools import wraps
6
4
  from velocity.db import exceptions
7
5
  from velocity.db.core.transaction import Transaction
@@ -176,18 +174,18 @@ class Engine:
176
174
  while True:
177
175
  try:
178
176
  return function(*args, **kwds)
179
- except exceptions.DbRetryTransaction as e:
177
+ except exceptions.DbRetryTransaction:
180
178
  retry_count += 1
181
179
  if retry_count > self.MAX_RETRIES:
182
180
  raise
183
181
  _tx.rollback()
184
- except exceptions.DbLockTimeoutError as e:
182
+ except exceptions.DbLockTimeoutError:
185
183
  lock_timeout_count += 1
186
184
  if lock_timeout_count > self.MAX_RETRIES:
187
185
  raise
188
186
  _tx.rollback()
189
187
  continue
190
- except:
188
+ except Exception:
191
189
  raise
192
190
  finally:
193
191
  setattr(_tx, "_exec_function_depth", depth)
@@ -1,5 +1,3 @@
1
- import datetime
2
- import decimal
3
1
  from velocity.misc.format import to_json
4
2
 
5
3
 
@@ -54,13 +54,13 @@ class Table:
54
54
  """
55
55
  try:
56
56
  self._cursor.close()
57
- except:
57
+ except Exception:
58
58
  pass
59
59
 
60
60
  def cursor(self):
61
61
  try:
62
62
  return self._cursor
63
- except:
63
+ except AttributeError:
64
64
  pass
65
65
  self._cursor = self.tx.cursor()
66
66
  return self._cursor
@@ -887,8 +887,8 @@ class Table:
887
887
  # Return a descriptive string of differences.
888
888
  if differences:
889
889
  differences.insert(0, f"Comparing {self.name}: {pk1} vs {pk2}")
890
- differences.insert(0, f"--------------------------------------")
891
- differences.append(f"--------------------------------------")
890
+ differences.insert(0, "--------------------------------------")
891
+ differences.append("--------------------------------------")
892
892
  return "\n".join(differences)
893
893
  else:
894
894
  return f"{self.name} rows {pk1} and {pk2} are identical."
@@ -30,7 +30,7 @@ def make_where(where, sql, vals, is_join=False):
30
30
  if is_join:
31
31
  if "." not in key:
32
32
  key = "A." + key
33
- if val == None:
33
+ if val is None:
34
34
  if "!" in key:
35
35
  key = key.replace("!", "")
36
36
  sql.append("{} is not NULL".format(quote(key.lower())))
@@ -198,7 +198,7 @@ class SQL:
198
198
  cls, table, columns, key_to_table, key_to_columns, name=None, schema=None
199
199
  ):
200
200
  if "." not in table and schema:
201
- if schema == None:
201
+ if schema is None:
202
202
  schema = cls.default_schema
203
203
  table = "{}.{}".format(schema, table)
204
204
  if isinstance(key_to_columns, str):
@@ -254,7 +254,6 @@ class SQL:
254
254
 
255
255
  @classmethod
256
256
  def create_table(cls, name, columns={}, drop=False):
257
- trigger = "".format(name)
258
257
  sql = []
259
258
  if drop:
260
259
  sql.append(cls.drop_table(name))
@@ -1,7 +1,7 @@
1
1
  import re
2
2
  import hashlib
3
3
  import sqlparse
4
- from psycopg2 import sql
4
+ from psycopg2 import sql as psycopg2_sql
5
5
 
6
6
  from velocity.db import exceptions
7
7
 
@@ -985,7 +985,7 @@ class SQL:
985
985
  columns = TableHelper.quote(columns)
986
986
  sql = ["DROP"]
987
987
  sql.append("INDEX IF EXISTS")
988
- tablename = TableHelper.quote(table)
988
+ _tablename = TableHelper.quote(table)
989
989
  if not name:
990
990
  name = re.sub(
991
991
  r"\([^)]*\)",
@@ -1155,9 +1155,9 @@ class SQL:
1155
1155
  @classmethod
1156
1156
  def missing(cls, tx, table, list, column="SYS_ID", where=None):
1157
1157
  sql = [
1158
- f"SELECT * FROM",
1158
+ "SELECT * FROM",
1159
1159
  f"UNNEST('{{{','.join([str(x) for x in list])}}}'::int[]) id",
1160
- f"EXCEPT ALL",
1160
+ "EXCEPT ALL",
1161
1161
  f"SELECT {column} FROM {table}",
1162
1162
  ]
1163
1163
  vals = []
@@ -216,7 +216,7 @@ class SQL(object):
216
216
  if is_join:
217
217
  if "." not in key:
218
218
  key = "A." + key
219
- if val == None:
219
+ if val is None:
220
220
  if "!" in key:
221
221
  key = key.replace("!", "")
222
222
  sql.append("{} is not NULL".format(quote(key.lower())))
@@ -919,7 +919,7 @@ class SQL(object):
919
919
  for key in sorted(where.keys()):
920
920
  if join:
921
921
  sql.append(join)
922
- if where[key] == None:
922
+ if where[key] is None:
923
923
  sql.append("{} is NULL".format(quote(key.lower())))
924
924
  else:
925
925
  sql.append("{} = ?".format(quote(key.lower())))
@@ -30,7 +30,7 @@ def make_where(where, sql, vals, is_join=False):
30
30
  if is_join:
31
31
  if "." not in key:
32
32
  key = "A." + key
33
- if val == None:
33
+ if val is None:
34
34
  if "!" in key:
35
35
  key = key.replace("!", "")
36
36
  sql.append("{} is not NULL".format(quote(key.lower())))
@@ -394,7 +394,7 @@ class SQL:
394
394
  cls, table, columns, key_to_table, key_to_columns, name=None, schema=None
395
395
  ):
396
396
  if "." not in table and schema:
397
- if schema == None:
397
+ if schema is None:
398
398
  schema = cls.default_schema
399
399
  table = "{}.{}".format(schema, table)
400
400
  if isinstance(key_to_columns, str):
@@ -873,7 +873,7 @@ class SQL:
873
873
  for key in sorted(where.keys()):
874
874
  if join:
875
875
  sql.append(join)
876
- if where[key] == None:
876
+ if where[key] is None:
877
877
  sql.append("{} is NULL".format(quote(key.lower())))
878
878
  else:
879
879
  sql.append("{} = %s".format(quote(key.lower())))
@@ -5,7 +5,7 @@ This module provides utility functions to handle common database operations
5
5
  safely, including sorting with None values and other edge cases.
6
6
  """
7
7
 
8
- from typing import Any, Callable, List, Optional, Union
8
+ from typing import Any, Callable, List
9
9
 
10
10
 
11
11
  def safe_sort_key_none_last(field_name: str) -> Callable[[dict], tuple]:
@@ -1,2 +1,4 @@
1
1
  from . import iconv
2
2
  from . import oconv
3
+
4
+ __all__ = ["iconv", "oconv"]
@@ -1,6 +1,7 @@
1
1
  import re
2
2
  import ast
3
3
  import codecs
4
+ import decimal
4
5
  from decimal import Decimal, ROUND_HALF_UP
5
6
  from email.utils import parseaddr
6
7
  from datetime import datetime
@@ -224,7 +225,7 @@ def money(data: str) -> Optional[Decimal]:
224
225
  return None
225
226
  try:
226
227
  return Decimal(cleaned)
227
- except:
228
+ except (ValueError, TypeError, decimal.InvalidOperation):
228
229
  return None
229
230
 
230
231
 
@@ -246,7 +247,7 @@ def round_to(
246
247
  cleaned = re.sub(r"[^0-9\.\-+]", "", val_str)
247
248
  try:
248
249
  as_dec = Decimal(cleaned)
249
- except:
250
+ except (ValueError, TypeError, decimal.InvalidOperation):
250
251
  return None
251
252
  return as_dec.quantize(Decimal(10) ** -precision, rounding=ROUND_HALF_UP)
252
253
 
@@ -269,7 +270,7 @@ def decimal_val(data: str) -> Optional[Decimal]:
269
270
  return None
270
271
  try:
271
272
  return Decimal(cleaned)
272
- except:
273
+ except (ValueError, TypeError, decimal.InvalidOperation):
273
274
  return None
274
275
 
275
276
 
@@ -305,7 +306,7 @@ def to_list(data: Union[str, list, None]) -> Optional[list]:
305
306
  if data_str.startswith("[") and data_str.endswith("]"):
306
307
  try:
307
308
  return ast.literal_eval(data_str)
308
- except:
309
+ except (ValueError, SyntaxError):
309
310
  return [data_str] # fallback: treat as a single string
310
311
  return [data_str]
311
312
 
@@ -1,7 +1,4 @@
1
- import decimal
2
- import json
3
- from datetime import datetime, date, time, timedelta
4
- from typing import Union, List, Dict
1
+ from typing import List, Dict
5
2
  from io import BytesIO
6
3
  import base64
7
4
  import openpyxl
@@ -1,6 +1,6 @@
1
1
  from copy import deepcopy
2
2
  from functools import reduce
3
- from typing import Dict, List, Any
3
+ from typing import Dict, Any
4
4
 
5
5
 
6
6
  def deep_merge(*dicts: Dict[str, Any], update: bool = False) -> Dict[str, Any]:
@@ -1,5 +1,4 @@
1
1
  import os
2
- import inspect
3
2
  import hashlib
4
3
 
5
4
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: velocity-python
3
- Version: 0.0.117
3
+ Version: 0.0.118
4
4
  Summary: A rapid application development library for interfacing with data storage
5
5
  Author-email: Velocity Team <info@codeclubs.org>
6
6
  License-Expression: MIT
@@ -1,6 +0,0 @@
1
- __version__ = version = "0.0.117"
2
-
3
- from . import aws
4
- from . import db
5
- from . import misc
6
- from . import app