pygrestqlambda 0.0.0__py3-none-any.whl → 0.0.2__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.
File without changes
File without changes
@@ -1,3 +1,7 @@
1
+ """
2
+ JSON output transformer for non-serialisable values
3
+ """
4
+
1
5
  from uuid import UUID
2
6
  from datetime import datetime
3
7
 
@@ -6,17 +6,17 @@ Returns payload structure expected by REST API Gateway
6
6
  https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html#api-gateway-simple-proxy-for-lambda-output-format
7
7
  """
8
8
 
9
- import logging
10
- import json
9
+ from base64 import b64encode
11
10
  from dataclasses import dataclass
11
+ import json
12
+ import logging
12
13
  from pygrestqlambda.aws.lambda_function.json_transform import json_output
13
- from base64 import b64encode
14
14
 
15
15
 
16
16
  @dataclass
17
- class LambdaFunctionProxyIntegrationResponse:
17
+ class Response:
18
18
  """
19
- Lambda function response
19
+ Lambda function proxy response for REST API Gateway
20
20
  """
21
21
  is_base64_encoded: bool | None = False
22
22
  status_code: int | None = 401
File without changes
@@ -1,3 +1,7 @@
1
+ """
2
+ Record that represents a DB table row
3
+ """
4
+
1
5
  from abc import ABCMeta
2
6
 
3
7
 
@@ -14,53 +18,52 @@ class Record(metaclass=ABCMeta):
14
18
  Runs before a new record is created. Useful for mutating a new record
15
19
  before being committed.
16
20
  """
17
- pass
21
+
18
22
 
19
23
  def before_read(self):
20
24
  """
21
25
  Before a record is retrieved from the database. Useful for injecting
22
26
  filters or sorting.
23
27
  """
24
- pass
28
+
25
29
 
26
30
  def before_update(self):
27
31
  """
28
32
  Before a new record is created. Useful for mutating a record before it
29
33
  is committed.
30
34
  """
31
- pass
35
+
32
36
 
33
37
  def before_delete(self):
34
38
  """
35
39
  Before an existing record is deleted. Useful for e.g. updating counters
36
40
  or other aggregate fields in other tables.
37
41
  """
38
- pass
42
+
39
43
 
40
44
  def after_create(self):
41
45
  """
42
46
  Runs after a new record is created. Useful for updating e.g. counters
43
47
  tables.
44
48
  """
45
- pass
49
+
46
50
 
47
51
  def after_read(self):
48
52
  """
49
53
  After a record is retrieved from the database. Useful for transforming
50
54
  retrieved data.
51
55
  """
52
- pass
56
+
53
57
 
54
58
  def after_update(self):
55
59
  """
56
60
  Runs after a new record is updated. Useful for updating e.g. counters
57
61
  tables.
58
62
  """
59
- pass
63
+
60
64
 
61
65
  def after_delete(self):
62
66
  """
63
67
  Runs after an existing record is deleted. Useful for updating e.g.
64
68
  counters tables.
65
69
  """
66
- pass
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pygrestqlambda
3
- Version: 0.0.0
3
+ Version: 0.0.2
4
4
  Summary: PostgreSQL REST API framework for AWS Lambda functions
5
5
  Project-URL: Homepage, https://github.com/mesogate/pygrestqlambda
6
6
  Project-URL: Issues, https://github.com/mesogate/pygrestqlambda/issues
@@ -32,3 +32,6 @@ A REST API web framework for persisting records in a PostgreSQL database.
32
32
  - Automatic setting of `created_at` and `last_updated_at` timestamps
33
33
  - Automatic setting of `creator_uid` and `last_updater_uid`
34
34
  - RDS with IAM credentials
35
+
36
+ ## Examples
37
+ See [Examples docs directory](./docs/examples/)
@@ -0,0 +1,11 @@
1
+ pygrestqlambda/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ pygrestqlambda/aws/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ pygrestqlambda/aws/lambda_function/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ pygrestqlambda/aws/lambda_function/json_transform.py,sha256=u4b6PCp5TRWTUU8ofM0iO6Wz8eJN_5yipPQFINNeqjE,442
5
+ pygrestqlambda/aws/lambda_function/rest_api_gateway_proxy_integration.py,sha256=TDn9D_BivcTPoNK1PhgymnF0V8blWaEE0cYV9v3aCLQ,1699
6
+ pygrestqlambda/db/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ pygrestqlambda/db/record.py,sha256=6HwvVIB8iJxxcoLeFgk51Gik_w7--w5fQzLN0ntB8iw,1527
8
+ pygrestqlambda-0.0.2.dist-info/METADATA,sha256=k6CJuCpaAE__9z_Ir2iDA8e-H6C07jr2u9vPMKfkk-s,1294
9
+ pygrestqlambda-0.0.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
+ pygrestqlambda-0.0.2.dist-info/licenses/LICENSE,sha256=8QeS1c5uv4AYoEG3M80OSCBuC_Pk-6vjU1VBUnlX2m0,1071
11
+ pygrestqlambda-0.0.2.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- pygrestqlambda/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- pygrestqlambda/aws/lambda_function/json_transform.py,sha256=Jye6MxYb1vyU4Bz4aLIcYauMwAHrMCZPdUlF3AqdJTM,381
3
- pygrestqlambda/aws/lambda_function/proxy_integration_respose.py,sha256=TMnOk0RMFaDhbFk5ZAfCVQmN_mMKX5KpgKKxwisKV8I,1702
4
- pygrestqlambda/db/record.py,sha256=EoPJTWNfF2ieEV7if2neieF0VZsf2Fs44SW13h3fZcA,1577
5
- pygrestqlambda-0.0.0.dist-info/METADATA,sha256=t1_x_ZXzWSBxXfobwAZCxQ2C7Y_sB1fEtTTHiteqBUk,1233
6
- pygrestqlambda-0.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
7
- pygrestqlambda-0.0.0.dist-info/licenses/LICENSE,sha256=8QeS1c5uv4AYoEG3M80OSCBuC_Pk-6vjU1VBUnlX2m0,1071
8
- pygrestqlambda-0.0.0.dist-info/RECORD,,