edutin-toolkit 1.5.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.
Files changed (37) hide show
  1. edutin_toolkit-1.5.0/LICENSE +21 -0
  2. edutin_toolkit-1.5.0/PKG-INFO +68 -0
  3. edutin_toolkit-1.5.0/README.md +34 -0
  4. edutin_toolkit-1.5.0/pyproject.toml +62 -0
  5. edutin_toolkit-1.5.0/setup.cfg +4 -0
  6. edutin_toolkit-1.5.0/src/aws_toolkit/__init__.py +3 -0
  7. edutin_toolkit-1.5.0/src/aws_toolkit/__main__.py +5 -0
  8. edutin_toolkit-1.5.0/src/aws_toolkit/_bundled_templates/python312_arm64/code_template/main.py +7 -0
  9. edutin_toolkit-1.5.0/src/aws_toolkit/_bundled_templates/python312_arm64/template.json +10 -0
  10. edutin_toolkit-1.5.0/src/aws_toolkit/_bundled_vscode/lambda-test-runner-0.3.1.vsix +0 -0
  11. edutin_toolkit-1.5.0/src/aws_toolkit/cli.py +173 -0
  12. edutin_toolkit-1.5.0/src/aws_toolkit/commands/__init__.py +1 -0
  13. edutin_toolkit-1.5.0/src/aws_toolkit/commands/_shared.py +646 -0
  14. edutin_toolkit-1.5.0/src/aws_toolkit/commands/config.py +351 -0
  15. edutin_toolkit-1.5.0/src/aws_toolkit/commands/dynamodb_doc.py +159 -0
  16. edutin_toolkit-1.5.0/src/aws_toolkit/commands/init.py +676 -0
  17. edutin_toolkit-1.5.0/src/aws_toolkit/commands/install_vscode_extension.py +185 -0
  18. edutin_toolkit-1.5.0/src/aws_toolkit/commands/lambda_create.py +376 -0
  19. edutin_toolkit-1.5.0/src/aws_toolkit/commands/lambda_deploy.py +309 -0
  20. edutin_toolkit-1.5.0/src/aws_toolkit/commands/lambda_download.py +226 -0
  21. edutin_toolkit-1.5.0/src/aws_toolkit/commands/lambda_download_all.py +343 -0
  22. edutin_toolkit-1.5.0/src/aws_toolkit/commands/lambda_download_tests.py +321 -0
  23. edutin_toolkit-1.5.0/src/aws_toolkit/commands/lambda_explorer.py +585 -0
  24. edutin_toolkit-1.5.0/src/aws_toolkit/commands/lambda_layer_doc.py +107 -0
  25. edutin_toolkit-1.5.0/src/aws_toolkit/commands/lambda_publish_version.py +231 -0
  26. edutin_toolkit-1.5.0/src/aws_toolkit/commands/lambda_test.py +582 -0
  27. edutin_toolkit-1.5.0/src/aws_toolkit/config_resolver.py +387 -0
  28. edutin_toolkit-1.5.0/src/edutin_toolkit.egg-info/PKG-INFO +68 -0
  29. edutin_toolkit-1.5.0/src/edutin_toolkit.egg-info/SOURCES.txt +35 -0
  30. edutin_toolkit-1.5.0/src/edutin_toolkit.egg-info/dependency_links.txt +1 -0
  31. edutin_toolkit-1.5.0/src/edutin_toolkit.egg-info/entry_points.txt +2 -0
  32. edutin_toolkit-1.5.0/src/edutin_toolkit.egg-info/requires.txt +11 -0
  33. edutin_toolkit-1.5.0/src/edutin_toolkit.egg-info/top_level.txt +1 -0
  34. edutin_toolkit-1.5.0/tests/test_config_resolver.py +434 -0
  35. edutin_toolkit-1.5.0/tests/test_init.py +431 -0
  36. edutin_toolkit-1.5.0/tests/test_lambda_download_all.py +292 -0
  37. edutin_toolkit-1.5.0/tests/test_lambda_publish_version.py +248 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Edutin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,68 @@
1
+ Metadata-Version: 2.4
2
+ Name: edutin-toolkit
3
+ Version: 1.5.0
4
+ Summary: CLI to manage AWS Lambda and DynamoDB resources from the terminal
5
+ Author-email: Pablo Ospino <cto@edutin.com>
6
+ License: MIT
7
+ Keywords: aws,lambda,dynamodb,cli,devops,toolkit,edutin
8
+ Classifier: Development Status :: 5 - Production/Stable
9
+ Classifier: Environment :: Console
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Intended Audience :: System Administrators
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Software Development :: Build Tools
20
+ Classifier: Topic :: System :: Systems Administration
21
+ Classifier: Topic :: Utilities
22
+ Requires-Python: >=3.10
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: boto3>=1.34.0
26
+ Requires-Dist: botocore>=1.34.0
27
+ Requires-Dist: rich>=13.7.0
28
+ Requires-Dist: tomli>=2.0; python_version < "3.11"
29
+ Requires-Dist: tomli-w>=1.0
30
+ Provides-Extra: dev
31
+ Requires-Dist: pytest>=7.0; extra == "dev"
32
+ Requires-Dist: build>=1.0; extra == "dev"
33
+ Dynamic: license-file
34
+
35
+ # aws-toolkit (`etk`)
36
+
37
+ CLI to manage AWS Lambda and DynamoDB resources from the terminal.
38
+
39
+ > This is the package README, bundled inside the installed wheel.
40
+ > For full docs (DESIGN, MIGRATION_GUIDE, CHANGELOG), see the project
41
+ > repository.
42
+
43
+ ## Install
44
+
45
+ ```bash
46
+ pip install edutin-toolkit
47
+ ```
48
+
49
+ Provides the `etk` command. Requires Python 3.10+ and AWS credentials
50
+ configured (`aws configure`).
51
+
52
+ ## Quick start
53
+
54
+ ```bash
55
+ cd <your-project>
56
+ etk init # set up .aws-toolkit/ in the current repo
57
+ etk lambda_download_all # bulk-pull every accessible Lambda
58
+ etk lambda_deploy <fn> # push local code + config to AWS
59
+ etk config # view / edit toolkit settings
60
+ etk --help # full command list
61
+ ```
62
+
63
+ Every command supports `-ai` for machine-readable TSV output. See the
64
+ project docs for the full reference.
65
+
66
+ ## License
67
+
68
+ MIT. See `LICENSE` in the repo root.
@@ -0,0 +1,34 @@
1
+ # aws-toolkit (`etk`)
2
+
3
+ CLI to manage AWS Lambda and DynamoDB resources from the terminal.
4
+
5
+ > This is the package README, bundled inside the installed wheel.
6
+ > For full docs (DESIGN, MIGRATION_GUIDE, CHANGELOG), see the project
7
+ > repository.
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ pip install edutin-toolkit
13
+ ```
14
+
15
+ Provides the `etk` command. Requires Python 3.10+ and AWS credentials
16
+ configured (`aws configure`).
17
+
18
+ ## Quick start
19
+
20
+ ```bash
21
+ cd <your-project>
22
+ etk init # set up .aws-toolkit/ in the current repo
23
+ etk lambda_download_all # bulk-pull every accessible Lambda
24
+ etk lambda_deploy <fn> # push local code + config to AWS
25
+ etk config # view / edit toolkit settings
26
+ etk --help # full command list
27
+ ```
28
+
29
+ Every command supports `-ai` for machine-readable TSV output. See the
30
+ project docs for the full reference.
31
+
32
+ ## License
33
+
34
+ MIT. See `LICENSE` in the repo root.
@@ -0,0 +1,62 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "edutin-toolkit"
7
+ version = "1.5.0"
8
+ description = "CLI to manage AWS Lambda and DynamoDB resources from the terminal"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = { text = "MIT" }
12
+ authors = [
13
+ { name = "Pablo Ospino", email = "cto@edutin.com" },
14
+ ]
15
+ keywords = [
16
+ "aws", "lambda", "dynamodb", "cli", "devops", "toolkit", "edutin",
17
+ ]
18
+ classifiers = [
19
+ "Development Status :: 5 - Production/Stable",
20
+ "Environment :: Console",
21
+ "Intended Audience :: Developers",
22
+ "Intended Audience :: System Administrators",
23
+ "License :: OSI Approved :: MIT License",
24
+ "Operating System :: OS Independent",
25
+ "Programming Language :: Python :: 3",
26
+ "Programming Language :: Python :: 3.10",
27
+ "Programming Language :: Python :: 3.11",
28
+ "Programming Language :: Python :: 3.12",
29
+ "Programming Language :: Python :: 3.13",
30
+ "Topic :: Software Development :: Build Tools",
31
+ "Topic :: System :: Systems Administration",
32
+ "Topic :: Utilities",
33
+ ]
34
+ dependencies = [
35
+ "boto3>=1.34.0",
36
+ "botocore>=1.34.0",
37
+ "rich>=13.7.0",
38
+ "tomli>=2.0; python_version < '3.11'",
39
+ "tomli-w>=1.0",
40
+ ]
41
+
42
+ [project.optional-dependencies]
43
+ dev = [
44
+ "pytest>=7.0",
45
+ "build>=1.0",
46
+ ]
47
+
48
+ [project.scripts]
49
+ etk = "aws_toolkit.cli:main"
50
+
51
+ [tool.setuptools.packages.find]
52
+ where = ["src"]
53
+
54
+ [tool.setuptools.package-data]
55
+ aws_toolkit = [
56
+ "_bundled_templates/**/*",
57
+ "_bundled_vscode/*.vsix",
58
+ ]
59
+
60
+ [tool.pytest.ini_options]
61
+ testpaths = ["tests"]
62
+ pythonpath = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ """AWS Toolkit — utilidades CLI para Lambda."""
2
+
3
+ __version__ = "0.1.0"
@@ -0,0 +1,5 @@
1
+ """Enables: python -m aws_toolkit [command] [args]"""
2
+
3
+ from aws_toolkit.cli import main
4
+
5
+ main()
@@ -0,0 +1,7 @@
1
+ import json
2
+
3
+ def lambda_handler(event, context):
4
+ return {
5
+ 'statusCode': 200,
6
+ 'body': json.dumps('Hello from Lambda!')
7
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "runtime": "python3.12",
3
+ "architectures": ["arm64"],
4
+ "timeout": 5,
5
+ "memory_size": 128,
6
+ "ephemeral_storage_size": 512,
7
+ "handler": "main.main",
8
+ "role": "lambda_dynamodb_exec",
9
+ "aliases": ["current", "develop", "legacy"]
10
+ }
@@ -0,0 +1,173 @@
1
+ #!/usr/bin/env python3
2
+ """AWS Toolkit – unified CLI dispatcher."""
3
+
4
+ import sys
5
+ import importlib
6
+
7
+ COMMANDS = {
8
+ "init": {
9
+ "desc": "Initialize the current directory as an aws-toolkit project",
10
+ "usage": "etk init [--template <n>] [--lambdas <p>] [--layers <p>] [--dynamo <p>] [--author <n>] [--profile <p>] [--sandbox <l>] [--force] [-ai]",
11
+ "module": "aws_toolkit.commands.init",
12
+ },
13
+ "lambda_explorer": {
14
+ "desc": "Interactive TUI to browse, search and download Lambda functions",
15
+ "usage": "etk lambda_explorer [-ai [query]]",
16
+ "module": "aws_toolkit.commands.lambda_explorer",
17
+ },
18
+ "lambda_download": {
19
+ "desc": "Download a Lambda function by name",
20
+ "usage": "etk lambda_download <function_name> [-ai]",
21
+ "module": "aws_toolkit.commands.lambda_download",
22
+ },
23
+ "lambda_download_all": {
24
+ "desc": "Bulk download every accessible Lambda (idempotent, parallel)",
25
+ "usage": "etk lambda_download_all [--filter <pat>] [--force] [--dry-run] [--workers N] [-ai]",
26
+ "module": "aws_toolkit.commands.lambda_download_all",
27
+ },
28
+ "dynamodb_doc": {
29
+ "desc": "Document DynamoDB table schemas to JSON files",
30
+ "usage": "etk dynamodb_doc [-ai] | etk dynamodb_doc <table_name> [-ai]",
31
+ "module": "aws_toolkit.commands.dynamodb_doc",
32
+ },
33
+ "lambda_create": {
34
+ "desc": "Create a Lambda function from a template",
35
+ "usage": "etk lambda_create <function_name> [--template <name>] [-ai]",
36
+ "module": "aws_toolkit.commands.lambda_create",
37
+ },
38
+ "lambda_deploy": {
39
+ "desc": "Deploy local code and lambda_config.json to AWS",
40
+ "usage": "etk lambda_deploy <function_name> [-ai]",
41
+ "module": "aws_toolkit.commands.lambda_deploy",
42
+ },
43
+ "lambda_test": {
44
+ "desc": "Deploy source lambda to test lambda and invoke it with an event",
45
+ "usage": "etk lambda_test <function_name> <event_name> [-ai]",
46
+ "module": "aws_toolkit.commands.lambda_test",
47
+ },
48
+ "lambda_download_tests": {
49
+ "desc": "Download shareable test events from AWS into event_tests/",
50
+ "usage": "etk lambda_download_tests <function_name> [-ai]",
51
+ "module": "aws_toolkit.commands.lambda_download_tests",
52
+ },
53
+ "lambda_publish_version": {
54
+ "desc": "Publish a new version of a Lambda from $LATEST (optionally aliasing it as `current`)",
55
+ "usage": "etk lambda_publish_version <name> <description> [--prod] [-ai]",
56
+ "module": "aws_toolkit.commands.lambda_publish_version",
57
+ },
58
+ "lambda_layer_doc": {
59
+ "desc": "Download and document Lambda layer versions (top 3 most recent)",
60
+ "usage": "etk lambda_layer_doc [layer_name] [-ai]",
61
+ "module": "aws_toolkit.commands.lambda_layer_doc",
62
+ },
63
+ "config": {
64
+ "desc": "Create / modify toolkit configuration",
65
+ "usage": "etk config [-ai] | etk config set <key> <value> [-ai]",
66
+ "module": "aws_toolkit.commands.config",
67
+ },
68
+ "install_vscode_extension": {
69
+ "desc": "Install the bundled VSCode extension (▶/☁⬆ buttons on lambda files)",
70
+ "usage": "etk install_vscode_extension [-ai]",
71
+ "module": "aws_toolkit.commands.install_vscode_extension",
72
+ },
73
+ }
74
+
75
+ def _make_commands_table(title: str, commands: dict, T, box):
76
+ from rich.table import Table
77
+ tbl = Table(
78
+ show_header=True,
79
+ header_style=T.HEADER_ST,
80
+ border_style=T.BORDER,
81
+ box=box.DOUBLE_EDGE,
82
+ title=title,
83
+ title_style=T.TITLE,
84
+ padding=(0, 2),
85
+ )
86
+ tbl.add_column("COMMAND", style=f"bold {T.NEON_GREEN}", min_width=20)
87
+ tbl.add_column("DESCRIPTION", style=T.NORMAL, min_width=30)
88
+ tbl.add_column("USAGE", style=T.DIM_STYLE, min_width=45)
89
+ for name, info in commands.items():
90
+ tbl.add_row(name, info["desc"], info["usage"])
91
+ return tbl
92
+
93
+
94
+ def show_help():
95
+ from aws_toolkit.commands._shared import console, Theme as T
96
+ from rich.align import Align
97
+ from rich import box
98
+
99
+ console.print()
100
+ console.print(f"[bold {T.CYAN}]AWS TOOLKIT[/bold {T.CYAN}]")
101
+ console.print(f" [{T.DIM_STYLE}]Usage: etk <command> [args][/{T.DIM_STYLE}]")
102
+ console.print()
103
+
104
+ console.print(Align.center(_make_commands_table(
105
+ f"[{T.CYAN}]《 COMMANDS 》[/{T.CYAN}]", COMMANDS, T, box
106
+ )))
107
+
108
+ console.print()
109
+
110
+
111
+ def _check_config(ai_mode: bool) -> None:
112
+ """Force config resolution to surface a clear error before the command runs.
113
+
114
+ ConfigError subclasses (RepoRootNotFound, ProjectConfigMissingField,
115
+ UserConfigMissingField, etc.) are caught by the dispatcher's
116
+ try/except and produce a consistent error code in -ai mode.
117
+ """
118
+ from aws_toolkit.config_resolver import resolve_config
119
+ resolve_config()
120
+
121
+
122
+ def main():
123
+ args = sys.argv[1:]
124
+
125
+ if not args or args[0] in ("--help", "-h", "help"):
126
+ show_help()
127
+ return
128
+
129
+ cmd = args[0]
130
+ rest = args[1:]
131
+ ai_mode = "-ai" in rest
132
+
133
+ if cmd not in COMMANDS:
134
+ from aws_toolkit.commands._shared import die
135
+ die(
136
+ f"Unknown command: [bold]{cmd}[/bold]\n\n"
137
+ f" Run [bold]etk --help[/bold] to see available commands."
138
+ )
139
+
140
+ from aws_toolkit.commands._shared import log_command
141
+ from aws_toolkit.config_resolver import ConfigError
142
+
143
+ entry = COMMANDS[cmd]
144
+
145
+ try:
146
+ mod = importlib.import_module(entry["module"])
147
+
148
+ if cmd not in ("config", "init", "install_vscode_extension"):
149
+ _check_config(ai_mode=ai_mode)
150
+ detail = mod.main(rest) or ""
151
+ log_command(cmd, rest, "SUCCESS", detail)
152
+ except ConfigError as exc:
153
+ log_command(cmd, rest, "ERROR", f"config_error={exc.code}")
154
+ if ai_mode:
155
+ print(f"error\t{exc.code}\t{exc}", file=sys.stderr)
156
+ sys.exit(1)
157
+ else:
158
+ from aws_toolkit.commands._shared import die as _die
159
+ _die(str(exc)) # exits with code 1
160
+ except SystemExit as exc:
161
+ code = exc.code if exc.code is not None else 0
162
+ if code == 0:
163
+ log_command(cmd, rest, "SUCCESS")
164
+ else:
165
+ log_command(cmd, rest, "ERROR", f"exit_code={code}")
166
+ raise
167
+ except Exception as exc:
168
+ log_command(cmd, rest, "ERROR", f"exception={type(exc).__name__}: {exc}")
169
+ raise
170
+
171
+
172
+ if __name__ == "__main__":
173
+ main()
@@ -0,0 +1 @@
1
+ """Subcomandos de la CLI (p. ej. lambda_explorer)."""