lambdaforge-local 0.1.0__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.
- lambdaforge_local-0.1.0/.gitignore +12 -0
- lambdaforge_local-0.1.0/PKG-INFO +79 -0
- lambdaforge_local-0.1.0/README.md +52 -0
- lambdaforge_local-0.1.0/docs/course.html +1257 -0
- lambdaforge_local-0.1.0/examples/s3_to_dynamo/event.json +44 -0
- lambdaforge_local-0.1.0/examples/s3_to_dynamo/handler.py +75 -0
- lambdaforge_local-0.1.0/examples/s3_to_dynamo/run_and_display.py +60 -0
- lambdaforge_local-0.1.0/lambdaforge/__init__.py +1 -0
- lambdaforge_local-0.1.0/lambdaforge/cli.py +116 -0
- lambdaforge_local-0.1.0/lambdaforge/events/__init__.py +9 -0
- lambdaforge_local-0.1.0/lambdaforge/events/apigateway.py +16 -0
- lambdaforge_local-0.1.0/lambdaforge/events/eventbridge.py +12 -0
- lambdaforge_local-0.1.0/lambdaforge/events/s3.py +25 -0
- lambdaforge_local-0.1.0/lambdaforge/events/sns.py +23 -0
- lambdaforge_local-0.1.0/lambdaforge/events/sqs.py +21 -0
- lambdaforge_local-0.1.0/lambdaforge/invoker.py +80 -0
- lambdaforge_local-0.1.0/lambdaforge/mocking.py +16 -0
- lambdaforge_local-0.1.0/lambdaforge/output.py +42 -0
- lambdaforge_local-0.1.0/pypi-key.txt +0 -0
- lambdaforge_local-0.1.0/pyproject.toml +46 -0
- lambdaforge_local-0.1.0/tests/.gitkeep +0 -0
- lambdaforge_local-0.1.0/tests/test_cli.py +166 -0
- lambdaforge_local-0.1.0/tests/test_events.py +58 -0
- lambdaforge_local-0.1.0/tests/test_invoker.py +128 -0
- lambdaforge_local-0.1.0/tests/test_mocking.py +35 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: lambdaforge-local
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Local AWS Lambda testing: generate realistic trigger events and invoke handlers with mocked AWS services
|
|
5
|
+
Project-URL: Homepage, https://github.com/TretiqHiks/lambdaforge
|
|
6
|
+
Project-URL: Source, https://github.com/TretiqHiks/lambdaforge
|
|
7
|
+
Author: TretiqHiks
|
|
8
|
+
License: MIT
|
|
9
|
+
Keywords: aws,cli,lambda,local,moto,testing
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Topic :: Software Development :: Testing
|
|
19
|
+
Requires-Python: >=3.9
|
|
20
|
+
Requires-Dist: boto3>=1.26
|
|
21
|
+
Requires-Dist: click>=8.0
|
|
22
|
+
Requires-Dist: moto[all]>=4.0
|
|
23
|
+
Requires-Dist: rich>=13.0
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
|
|
28
|
+
# lambdaforge
|
|
29
|
+
|
|
30
|
+
> Local AWS Lambda testing made simple.
|
|
31
|
+
|
|
32
|
+
Generate realistic trigger event payloads and invoke your Python Lambda handler locally — with optional in-memory AWS service mocking via [moto](https://docs.getmoto.org/). No Docker. No SAM. No LocalStack.
|
|
33
|
+
|
|
34
|
+
## Install
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install lambdaforge
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Quick Start
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# 1. Generate a realistic event file for your trigger type
|
|
44
|
+
lambdaforge generate --trigger apigateway
|
|
45
|
+
|
|
46
|
+
# 2. Edit event.json with your actual path, body, etc.
|
|
47
|
+
|
|
48
|
+
# 3. Invoke your handler
|
|
49
|
+
lambdaforge invoke --handler src/handler.py::lambda_handler
|
|
50
|
+
|
|
51
|
+
# With mocked DynamoDB and S3 (boto3 calls intercepted, no real AWS)
|
|
52
|
+
lambdaforge invoke --handler src/handler.py::lambda_handler --mock dynamodb,s3
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Supported Triggers
|
|
56
|
+
|
|
57
|
+
| Trigger | CLI value |
|
|
58
|
+
|---|---|
|
|
59
|
+
| API Gateway REST proxy | `apigateway` |
|
|
60
|
+
| SQS | `sqs` |
|
|
61
|
+
| S3 object created | `s3` |
|
|
62
|
+
| SNS | `sns` |
|
|
63
|
+
| EventBridge / scheduled | `eventbridge` |
|
|
64
|
+
|
|
65
|
+
## Supported Mock Services
|
|
66
|
+
|
|
67
|
+
Pass any combination via `--mock`: `dynamodb`, `s3`, `ssm`, `sqs`, `sns`
|
|
68
|
+
|
|
69
|
+
> **Note:** Mocked services start empty. Pre-populate state in your handler behind an env var guard if needed. Seed file support is planned for v2.
|
|
70
|
+
|
|
71
|
+
## How It Works
|
|
72
|
+
|
|
73
|
+
**`generate`** writes a complete AWS event JSON to a file (default: `event.json`). User-supplied fields are marked with `"<placeholder>"` strings.
|
|
74
|
+
|
|
75
|
+
**`invoke`** loads your handler via Python's import system, builds a mock `LambdaContext`, optionally activates moto's `mock_aws()` context, and calls `handler(event, context)`. Output is formatted with [rich](https://github.com/Textualize/rich).
|
|
76
|
+
|
|
77
|
+
## License
|
|
78
|
+
|
|
79
|
+
MIT
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# lambdaforge
|
|
2
|
+
|
|
3
|
+
> Local AWS Lambda testing made simple.
|
|
4
|
+
|
|
5
|
+
Generate realistic trigger event payloads and invoke your Python Lambda handler locally — with optional in-memory AWS service mocking via [moto](https://docs.getmoto.org/). No Docker. No SAM. No LocalStack.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install lambdaforge
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# 1. Generate a realistic event file for your trigger type
|
|
17
|
+
lambdaforge generate --trigger apigateway
|
|
18
|
+
|
|
19
|
+
# 2. Edit event.json with your actual path, body, etc.
|
|
20
|
+
|
|
21
|
+
# 3. Invoke your handler
|
|
22
|
+
lambdaforge invoke --handler src/handler.py::lambda_handler
|
|
23
|
+
|
|
24
|
+
# With mocked DynamoDB and S3 (boto3 calls intercepted, no real AWS)
|
|
25
|
+
lambdaforge invoke --handler src/handler.py::lambda_handler --mock dynamodb,s3
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Supported Triggers
|
|
29
|
+
|
|
30
|
+
| Trigger | CLI value |
|
|
31
|
+
|---|---|
|
|
32
|
+
| API Gateway REST proxy | `apigateway` |
|
|
33
|
+
| SQS | `sqs` |
|
|
34
|
+
| S3 object created | `s3` |
|
|
35
|
+
| SNS | `sns` |
|
|
36
|
+
| EventBridge / scheduled | `eventbridge` |
|
|
37
|
+
|
|
38
|
+
## Supported Mock Services
|
|
39
|
+
|
|
40
|
+
Pass any combination via `--mock`: `dynamodb`, `s3`, `ssm`, `sqs`, `sns`
|
|
41
|
+
|
|
42
|
+
> **Note:** Mocked services start empty. Pre-populate state in your handler behind an env var guard if needed. Seed file support is planned for v2.
|
|
43
|
+
|
|
44
|
+
## How It Works
|
|
45
|
+
|
|
46
|
+
**`generate`** writes a complete AWS event JSON to a file (default: `event.json`). User-supplied fields are marked with `"<placeholder>"` strings.
|
|
47
|
+
|
|
48
|
+
**`invoke`** loads your handler via Python's import system, builds a mock `LambdaContext`, optionally activates moto's `mock_aws()` context, and calls `handler(event, context)`. Output is formatted with [rich](https://github.com/Textualize/rich).
|
|
49
|
+
|
|
50
|
+
## License
|
|
51
|
+
|
|
52
|
+
MIT
|