nui-python-shared-utils 1.3.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.
- nui_python_shared_utils-1.3.0/.editorconfig +23 -0
- nui_python_shared_utils-1.3.0/.github/workflows/ci.yml +108 -0
- nui_python_shared_utils-1.3.0/.github/workflows/publish.yml +136 -0
- nui_python_shared_utils-1.3.0/.github/workflows/test.yml +44 -0
- nui_python_shared_utils-1.3.0/.markdownlint-cli2.yaml +47 -0
- nui_python_shared_utils-1.3.0/CHANGELOG.md +122 -0
- nui_python_shared_utils-1.3.0/CLAUDE.md +378 -0
- nui_python_shared_utils-1.3.0/CONTRIBUTING.md +290 -0
- nui_python_shared_utils-1.3.0/LICENSE +21 -0
- nui_python_shared_utils-1.3.0/MANIFEST.in +37 -0
- nui_python_shared_utils-1.3.0/PKG-INFO +470 -0
- nui_python_shared_utils-1.3.0/README.md +377 -0
- nui_python_shared_utils-1.3.0/docs/README.md +170 -0
- nui_python_shared_utils-1.3.0/docs/development/testing.md +465 -0
- nui_python_shared_utils-1.3.0/docs/getting-started/configuration.md +396 -0
- nui_python_shared_utils-1.3.0/docs/getting-started/installation.md +260 -0
- nui_python_shared_utils-1.3.0/docs/getting-started/quickstart.md +375 -0
- nui_python_shared_utils-1.3.0/docs/guides/cli-tools.md +270 -0
- nui_python_shared_utils-1.3.0/docs/guides/elasticsearch-integration.md +375 -0
- nui_python_shared_utils-1.3.0/docs/guides/jwt-authentication.md +148 -0
- nui_python_shared_utils-1.3.0/docs/guides/lambda-utilities.md +274 -0
- nui_python_shared_utils-1.3.0/docs/guides/log-processing.md +156 -0
- nui_python_shared_utils-1.3.0/docs/guides/powertools-integration.md +593 -0
- nui_python_shared_utils-1.3.0/docs/guides/shared-types.md +527 -0
- nui_python_shared_utils-1.3.0/docs/guides/slack-integration.md +497 -0
- nui_python_shared_utils-1.3.0/mypy.ini +23 -0
- nui_python_shared_utils-1.3.0/nui_lambda_shared_utils/__init__.py +252 -0
- nui_python_shared_utils-1.3.0/nui_lambda_shared_utils/base_client.py +323 -0
- nui_python_shared_utils-1.3.0/nui_lambda_shared_utils/cli.py +225 -0
- nui_python_shared_utils-1.3.0/nui_lambda_shared_utils/cloudwatch_metrics.py +367 -0
- nui_python_shared_utils-1.3.0/nui_lambda_shared_utils/config.py +136 -0
- nui_python_shared_utils-1.3.0/nui_lambda_shared_utils/db_client.py +623 -0
- nui_python_shared_utils-1.3.0/nui_lambda_shared_utils/error_handler.py +372 -0
- nui_python_shared_utils-1.3.0/nui_lambda_shared_utils/es_client.py +460 -0
- nui_python_shared_utils-1.3.0/nui_lambda_shared_utils/es_query_builder.py +315 -0
- nui_python_shared_utils-1.3.0/nui_lambda_shared_utils/jwt_auth.py +277 -0
- nui_python_shared_utils-1.3.0/nui_lambda_shared_utils/lambda_helpers.py +84 -0
- nui_python_shared_utils-1.3.0/nui_lambda_shared_utils/log_processors.py +172 -0
- nui_python_shared_utils-1.3.0/nui_lambda_shared_utils/powertools_helpers.py +263 -0
- nui_python_shared_utils-1.3.0/nui_lambda_shared_utils/secrets_helper.py +187 -0
- nui_python_shared_utils-1.3.0/nui_lambda_shared_utils/slack_client.py +675 -0
- nui_python_shared_utils-1.3.0/nui_lambda_shared_utils/slack_formatter.py +307 -0
- nui_python_shared_utils-1.3.0/nui_lambda_shared_utils/slack_setup/__init__.py +14 -0
- nui_python_shared_utils-1.3.0/nui_lambda_shared_utils/slack_setup/channel_creator.py +295 -0
- nui_python_shared_utils-1.3.0/nui_lambda_shared_utils/slack_setup/channel_definitions.py +187 -0
- nui_python_shared_utils-1.3.0/nui_lambda_shared_utils/slack_setup/setup_helpers.py +211 -0
- nui_python_shared_utils-1.3.0/nui_lambda_shared_utils/timezone.py +117 -0
- nui_python_shared_utils-1.3.0/nui_lambda_shared_utils/utils.py +291 -0
- nui_python_shared_utils-1.3.0/nui_python_shared_utils.egg-info/SOURCES.txt +72 -0
- nui_python_shared_utils-1.3.0/pyproject.toml +146 -0
- nui_python_shared_utils-1.3.0/pytest.ini +16 -0
- nui_python_shared_utils-1.3.0/redirect/README.md +27 -0
- nui_python_shared_utils-1.3.0/redirect/pyproject.toml +35 -0
- nui_python_shared_utils-1.3.0/redirect/setup.py +10 -0
- nui_python_shared_utils-1.3.0/requirements-test.txt +27 -0
- nui_python_shared_utils-1.3.0/setup.cfg +4 -0
- nui_python_shared_utils-1.3.0/setup.py +87 -0
- nui_python_shared_utils-1.3.0/tests/__init__.py +3 -0
- nui_python_shared_utils-1.3.0/tests/test_aws_utils.py +325 -0
- nui_python_shared_utils-1.3.0/tests/test_base_client.py +924 -0
- nui_python_shared_utils-1.3.0/tests/test_cloudwatch_metrics.py +558 -0
- nui_python_shared_utils-1.3.0/tests/test_config.py +275 -0
- nui_python_shared_utils-1.3.0/tests/test_db_client.py +684 -0
- nui_python_shared_utils-1.3.0/tests/test_error_handler.py +400 -0
- nui_python_shared_utils-1.3.0/tests/test_es_client.py +525 -0
- nui_python_shared_utils-1.3.0/tests/test_es_query_builder.py +723 -0
- nui_python_shared_utils-1.3.0/tests/test_jwt_auth.py +388 -0
- nui_python_shared_utils-1.3.0/tests/test_lambda_helpers.py +253 -0
- nui_python_shared_utils-1.3.0/tests/test_log_processors.py +236 -0
- nui_python_shared_utils-1.3.0/tests/test_powertools_helpers.py +369 -0
- nui_python_shared_utils-1.3.0/tests/test_secrets_helper.py +326 -0
- nui_python_shared_utils-1.3.0/tests/test_slack_client.py +1083 -0
- nui_python_shared_utils-1.3.0/tests/test_slack_formatter.py +561 -0
- nui_python_shared_utils-1.3.0/tests/test_timezone.py +148 -0
- nui_python_shared_utils-1.3.0/tests/test_utils.py +541 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
root = true
|
|
2
|
+
|
|
3
|
+
[*]
|
|
4
|
+
charset = utf-8
|
|
5
|
+
end_of_line = lf
|
|
6
|
+
insert_final_newline = true
|
|
7
|
+
trim_trailing_whitespace = true
|
|
8
|
+
|
|
9
|
+
[*.py]
|
|
10
|
+
indent_style = space
|
|
11
|
+
indent_size = 4
|
|
12
|
+
max_line_length = 120
|
|
13
|
+
|
|
14
|
+
[*.{yml,yaml}]
|
|
15
|
+
indent_style = space
|
|
16
|
+
indent_size = 2
|
|
17
|
+
|
|
18
|
+
[*.md]
|
|
19
|
+
trim_trailing_whitespace = false
|
|
20
|
+
max_line_length = off
|
|
21
|
+
|
|
22
|
+
[Makefile]
|
|
23
|
+
indent_style = tab
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, master, develop ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main, master, develop ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
name: Test Python ${{ matrix.python-version }}
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
strategy:
|
|
14
|
+
matrix:
|
|
15
|
+
python-version: ['3.9', '3.10', '3.11', '3.12']
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
21
|
+
uses: actions/setup-python@v4
|
|
22
|
+
with:
|
|
23
|
+
python-version: ${{ matrix.python-version }}
|
|
24
|
+
|
|
25
|
+
- name: Cache pip dependencies
|
|
26
|
+
uses: actions/cache@v3
|
|
27
|
+
with:
|
|
28
|
+
path: ~/.cache/pip
|
|
29
|
+
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml', '**/setup.py') }}
|
|
30
|
+
restore-keys: |
|
|
31
|
+
${{ runner.os }}-pip-
|
|
32
|
+
|
|
33
|
+
- name: Install dependencies
|
|
34
|
+
run: |
|
|
35
|
+
python -m pip install --upgrade pip
|
|
36
|
+
echo "Installing test requirements..."
|
|
37
|
+
pip install -r requirements-test.txt
|
|
38
|
+
echo "Installing package..."
|
|
39
|
+
pip install -e .
|
|
40
|
+
echo "Verifying key dependencies:"
|
|
41
|
+
python -c "import elasticsearch; print('✓ elasticsearch')" || echo "✗ elasticsearch missing"
|
|
42
|
+
python -c "import slack_sdk; print('✓ slack_sdk')" || echo "✗ slack_sdk missing"
|
|
43
|
+
python -c "import pymysql; print('✓ pymysql')" || echo "✗ pymysql missing"
|
|
44
|
+
|
|
45
|
+
- name: Auto-format with black
|
|
46
|
+
run: |
|
|
47
|
+
black nui_lambda_shared_utils tests
|
|
48
|
+
if ! git diff --quiet; then
|
|
49
|
+
echo "::warning::Code was auto-formatted by Black"
|
|
50
|
+
git config --local user.email "action@github.com"
|
|
51
|
+
git config --local user.name "GitHub Action"
|
|
52
|
+
git add -A
|
|
53
|
+
git commit -m "Auto-format code with Black [skip ci]" || echo "No changes to commit"
|
|
54
|
+
else
|
|
55
|
+
echo "✅ Code is already properly formatted"
|
|
56
|
+
fi
|
|
57
|
+
|
|
58
|
+
- name: Type check with mypy
|
|
59
|
+
run: |
|
|
60
|
+
mypy nui_lambda_shared_utils --ignore-missing-imports
|
|
61
|
+
continue-on-error: true # Don't fail CI on type errors yet
|
|
62
|
+
|
|
63
|
+
- name: Test with pytest
|
|
64
|
+
run: |
|
|
65
|
+
pytest --cov=nui_lambda_shared_utils --cov-report=xml --cov-report=term-missing -v
|
|
66
|
+
|
|
67
|
+
- name: Upload coverage to Codecov
|
|
68
|
+
uses: codecov/codecov-action@v3
|
|
69
|
+
with:
|
|
70
|
+
file: ./coverage.xml
|
|
71
|
+
flags: unittests
|
|
72
|
+
name: codecov-umbrella
|
|
73
|
+
fail_ci_if_error: false
|
|
74
|
+
|
|
75
|
+
build:
|
|
76
|
+
name: Build Package
|
|
77
|
+
runs-on: ubuntu-latest
|
|
78
|
+
needs: test
|
|
79
|
+
|
|
80
|
+
steps:
|
|
81
|
+
- uses: actions/checkout@v4
|
|
82
|
+
|
|
83
|
+
- name: Set up Python
|
|
84
|
+
uses: actions/setup-python@v4
|
|
85
|
+
with:
|
|
86
|
+
python-version: '3.11'
|
|
87
|
+
|
|
88
|
+
- name: Install build dependencies
|
|
89
|
+
run: |
|
|
90
|
+
python -m pip install --upgrade pip
|
|
91
|
+
pip install build twine
|
|
92
|
+
|
|
93
|
+
- name: Build package
|
|
94
|
+
run: python -m build
|
|
95
|
+
|
|
96
|
+
- name: Check package integrity
|
|
97
|
+
run: |
|
|
98
|
+
twine check dist/*
|
|
99
|
+
echo "Package contents:"
|
|
100
|
+
python -m tarfile -l dist/*.tar.gz | head -20
|
|
101
|
+
echo "Wheel contents:"
|
|
102
|
+
python -m zipfile -l dist/*.whl | head -20
|
|
103
|
+
|
|
104
|
+
- name: Test installation
|
|
105
|
+
run: |
|
|
106
|
+
pip install dist/*.whl
|
|
107
|
+
python -c "import nui_lambda_shared_utils; print('✅ Package imports successfully')"
|
|
108
|
+
python -c "from nui_lambda_shared_utils import Config, get_secret; print('✅ Core imports work')"
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
name: Build and Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- '[0-9]*' # Trigger on version tags like 1.3.0
|
|
7
|
+
release:
|
|
8
|
+
types: [published]
|
|
9
|
+
workflow_dispatch: # Allow manual triggering
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test:
|
|
13
|
+
name: Run Tests
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
strategy:
|
|
16
|
+
matrix:
|
|
17
|
+
python-version: ['3.9', '3.10', '3.11', '3.12']
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v4
|
|
21
|
+
|
|
22
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
23
|
+
uses: actions/setup-python@v4
|
|
24
|
+
with:
|
|
25
|
+
python-version: ${{ matrix.python-version }}
|
|
26
|
+
|
|
27
|
+
- name: Install dependencies
|
|
28
|
+
run: |
|
|
29
|
+
python -m pip install --upgrade pip
|
|
30
|
+
echo "Installing test requirements..."
|
|
31
|
+
pip install -r requirements-test.txt
|
|
32
|
+
echo "Installing package..."
|
|
33
|
+
pip install -e .
|
|
34
|
+
echo "Verifying key dependencies:"
|
|
35
|
+
python -c "import elasticsearch; print('✓ elasticsearch')" || echo "✗ elasticsearch missing"
|
|
36
|
+
python -c "import slack_sdk; print('✓ slack_sdk')" || echo "✗ slack_sdk missing"
|
|
37
|
+
python -c "import pymysql; print('✓ pymysql')" || echo "✗ pymysql missing"
|
|
38
|
+
|
|
39
|
+
- name: Run tests
|
|
40
|
+
run: |
|
|
41
|
+
pytest --cov=nui_lambda_shared_utils --cov-report=xml --cov-report=term-missing
|
|
42
|
+
|
|
43
|
+
- name: Upload coverage to Codecov
|
|
44
|
+
uses: codecov/codecov-action@v3
|
|
45
|
+
with:
|
|
46
|
+
file: ./coverage.xml
|
|
47
|
+
fail_ci_if_error: false
|
|
48
|
+
|
|
49
|
+
build:
|
|
50
|
+
name: Build Distribution
|
|
51
|
+
runs-on: ubuntu-latest
|
|
52
|
+
needs: test
|
|
53
|
+
|
|
54
|
+
steps:
|
|
55
|
+
- uses: actions/checkout@v4
|
|
56
|
+
with:
|
|
57
|
+
fetch-depth: 0 # Full history for version calculation
|
|
58
|
+
|
|
59
|
+
- name: Set up Python
|
|
60
|
+
uses: actions/setup-python@v4
|
|
61
|
+
with:
|
|
62
|
+
python-version: '3.11'
|
|
63
|
+
|
|
64
|
+
- name: Install build dependencies
|
|
65
|
+
run: |
|
|
66
|
+
python -m pip install --upgrade pip
|
|
67
|
+
pip install build twine
|
|
68
|
+
|
|
69
|
+
- name: Build package
|
|
70
|
+
run: python -m build
|
|
71
|
+
|
|
72
|
+
- name: Check package
|
|
73
|
+
run: |
|
|
74
|
+
twine check dist/*
|
|
75
|
+
python -m tarfile -l dist/*.tar.gz
|
|
76
|
+
|
|
77
|
+
- name: Upload artifacts
|
|
78
|
+
uses: actions/upload-artifact@v4
|
|
79
|
+
with:
|
|
80
|
+
name: dist
|
|
81
|
+
path: dist/
|
|
82
|
+
|
|
83
|
+
publish:
|
|
84
|
+
name: Publish to PyPI
|
|
85
|
+
runs-on: ubuntu-latest
|
|
86
|
+
needs: [test, build]
|
|
87
|
+
# Only publish on tagged releases
|
|
88
|
+
if: github.event_name == 'release' || startsWith(github.ref, 'refs/tags/')
|
|
89
|
+
environment:
|
|
90
|
+
name: pypi
|
|
91
|
+
url: https://pypi.org/project/nui-python-shared-utils/
|
|
92
|
+
|
|
93
|
+
permissions:
|
|
94
|
+
id-token: write # For trusted publishing
|
|
95
|
+
contents: read
|
|
96
|
+
|
|
97
|
+
steps:
|
|
98
|
+
- name: Download artifacts
|
|
99
|
+
uses: actions/download-artifact@v4
|
|
100
|
+
with:
|
|
101
|
+
name: dist
|
|
102
|
+
path: dist/
|
|
103
|
+
|
|
104
|
+
- name: Publish to PyPI
|
|
105
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
106
|
+
with:
|
|
107
|
+
verbose: true
|
|
108
|
+
print-hash: true
|
|
109
|
+
|
|
110
|
+
publish-test:
|
|
111
|
+
name: Publish to TestPyPI
|
|
112
|
+
runs-on: ubuntu-latest
|
|
113
|
+
needs: [test, build]
|
|
114
|
+
# Publish to TestPyPI on manual trigger or development branches
|
|
115
|
+
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/'))
|
|
116
|
+
environment:
|
|
117
|
+
name: testpypi
|
|
118
|
+
url: https://test.pypi.org/project/nui-python-shared-utils/
|
|
119
|
+
|
|
120
|
+
permissions:
|
|
121
|
+
id-token: write
|
|
122
|
+
contents: read
|
|
123
|
+
|
|
124
|
+
steps:
|
|
125
|
+
- name: Download artifacts
|
|
126
|
+
uses: actions/download-artifact@v4
|
|
127
|
+
with:
|
|
128
|
+
name: dist
|
|
129
|
+
path: dist/
|
|
130
|
+
|
|
131
|
+
- name: Publish to TestPyPI
|
|
132
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
133
|
+
with:
|
|
134
|
+
repository-url: https://test.pypi.org/legacy/
|
|
135
|
+
verbose: true
|
|
136
|
+
print-hash: true
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, master ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main, master ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ['3.9', '3.10', '3.11']
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v3
|
|
18
|
+
|
|
19
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
20
|
+
uses: actions/setup-python@v4
|
|
21
|
+
with:
|
|
22
|
+
python-version: ${{ matrix.python-version }}
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: |
|
|
26
|
+
python -m pip install --upgrade pip
|
|
27
|
+
pip install -r requirements-test.txt
|
|
28
|
+
pip install -e .
|
|
29
|
+
|
|
30
|
+
- name: Check formatting with black
|
|
31
|
+
run: |
|
|
32
|
+
black --check --diff nui_lambda_shared_utils tests || {
|
|
33
|
+
echo "::warning::Code formatting issues found - run 'black nui_lambda_shared_utils tests' locally"
|
|
34
|
+
echo "Continuing build despite formatting issues..."
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
# TODO: Re-enable mypy after fixing type annotations
|
|
38
|
+
# - name: Type check with mypy
|
|
39
|
+
# run: |
|
|
40
|
+
# mypy lambda_shared_utils/ --config-file mypy.ini
|
|
41
|
+
|
|
42
|
+
- name: Test with pytest
|
|
43
|
+
run: |
|
|
44
|
+
pytest --cov=nui_lambda_shared_utils --cov-report=xml
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Markdownlint configuration for nui-python-shared-utils
|
|
2
|
+
# Extends workspace config with project-specific overrides
|
|
3
|
+
|
|
4
|
+
config:
|
|
5
|
+
# Enable all rules by default
|
|
6
|
+
default: true
|
|
7
|
+
|
|
8
|
+
# MD013: Line length - disabled (technical docs need long lines for URLs/commands)
|
|
9
|
+
MD013: false
|
|
10
|
+
|
|
11
|
+
# MD033: Inline HTML - allowed (needed for complex formatting)
|
|
12
|
+
MD033: false
|
|
13
|
+
|
|
14
|
+
# MD036: No emphasis as heading - disabled (acceptable in planning docs)
|
|
15
|
+
MD036: false
|
|
16
|
+
|
|
17
|
+
# MD040: Fenced code language - disabled (not all code blocks need language tags)
|
|
18
|
+
MD040: false
|
|
19
|
+
|
|
20
|
+
# MD041: First line heading - disabled (docs may start with metadata)
|
|
21
|
+
MD041: false
|
|
22
|
+
|
|
23
|
+
# MD024: Multiple headings with same content - allowed with different levels
|
|
24
|
+
MD024:
|
|
25
|
+
siblings_only: true
|
|
26
|
+
|
|
27
|
+
# MD034: Bare URLs - allowed (sometimes intentional)
|
|
28
|
+
MD034: false
|
|
29
|
+
|
|
30
|
+
# MD046: Code block style - prefer fenced
|
|
31
|
+
MD046:
|
|
32
|
+
style: "fenced"
|
|
33
|
+
|
|
34
|
+
# MD060: Table column style - disabled (minor formatting preference)
|
|
35
|
+
MD060: false
|
|
36
|
+
|
|
37
|
+
# File patterns to check
|
|
38
|
+
globs:
|
|
39
|
+
- "**/*.md"
|
|
40
|
+
|
|
41
|
+
# Exclusions
|
|
42
|
+
ignores:
|
|
43
|
+
- "node_modules/**"
|
|
44
|
+
- "vendor/**"
|
|
45
|
+
- ".git/**"
|
|
46
|
+
- "venv/**"
|
|
47
|
+
- ".venv/**"
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **Log Processors Module** - New `log_processors` module for Kinesis/CloudWatch log extraction:
|
|
13
|
+
- `extract_cloudwatch_logs_from_kinesis()` - Base64 decode, gzip decompress, CONTROL_MESSAGE filtering with callback-based processing
|
|
14
|
+
- `derive_index_name()` - Configurable ES index name derivation from log group and timestamp
|
|
15
|
+
- `CloudWatchLogEvent`, `CloudWatchLogsData` type definitions for IDE support
|
|
16
|
+
- No new dependencies (stdlib only)
|
|
17
|
+
- Consolidates ~60 lines of duplicated extraction code across Lambda projects
|
|
18
|
+
|
|
19
|
+
- **AWS Powertools Integration** - New `powertools_helpers` module for standardized Lambda function patterns:
|
|
20
|
+
- `get_powertools_logger()` - Logger with Elasticsearch-compatible timestamps (`2025-01-18T04:39:27.788Z`)
|
|
21
|
+
- `powertools_handler()` - Decorator combining logging, metrics, and error handling with Slack alerts
|
|
22
|
+
- Automatic Lambda vs local environment detection
|
|
23
|
+
- Local development with coloredlogs support
|
|
24
|
+
- CloudWatch metrics integration
|
|
25
|
+
- Graceful degradation for optional dependencies
|
|
26
|
+
- Complete test coverage (94.52%) with 20 comprehensive tests
|
|
27
|
+
- **New optional dependency group**: `[powertools]` for AWS Lambda Powertools integration
|
|
28
|
+
- `aws-lambda-powertools>=3.6.0,<4.0.0`
|
|
29
|
+
- `coloredlogs>=15.0`
|
|
30
|
+
- **Comprehensive Powertools documentation**:
|
|
31
|
+
- New guide: `docs/guides/powertools-integration.md` (500+ lines)
|
|
32
|
+
- Updated quick start examples in README and quickstart guide
|
|
33
|
+
- Migration guide from custom logger wrappers
|
|
34
|
+
- Troubleshooting section for common issues
|
|
35
|
+
- `service_name` parameter to `SlackClient` for custom display names (e.g., "my-service" instead of full Lambda name)
|
|
36
|
+
- Project root improvements (documentation cleanup, standard files)
|
|
37
|
+
- Enhanced .gitignore with project-specific entries
|
|
38
|
+
- New `slack-channel-setup` CLI tool for Slack workspace automation
|
|
39
|
+
|
|
40
|
+
### Changed
|
|
41
|
+
|
|
42
|
+
- Improved Slack Lambda header formatting:
|
|
43
|
+
- Removed 📍 (round_pushpin) emoji for cleaner display
|
|
44
|
+
- Consolidated header to 2 lines (service name + account/region/log info)
|
|
45
|
+
- Updated local testing header to match new format
|
|
46
|
+
- Rebranded package as production-ready and generic for any AWS Lambda environment
|
|
47
|
+
- Updated documentation to emphasize configurability and generic usage patterns
|
|
48
|
+
|
|
49
|
+
### Breaking Changes
|
|
50
|
+
|
|
51
|
+
- **Removed `SERVICE_EMOJI` from public API exports**: The Slack alert formatter (`SlackFormatter.add_alert()`) no longer displays service-specific emojis next to service names. Service names now display in uppercase without emojis (e.g., "SERVICE" instead of "service 🚀").
|
|
52
|
+
- **Migration**: If you need service emojis, create your own emoji mapping and format the service name before passing it to `SlackFormatter.add_alert()`:
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
SERVICE_EMOJI = {"orders": "📦", "auth": "🔐", "notifications": "📧"}
|
|
56
|
+
emoji = SERVICE_EMOJI.get(service_name, "")
|
|
57
|
+
formatted_service = f"{service_name} {emoji}" if emoji else service_name
|
|
58
|
+
formatter.add_alert(service=formatted_service, ...)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
- **Removed database helper methods**: `get_entity_stats()` and `get_record_stats()` have been removed from `DatabaseClient`. Use the generic `query()` method instead with your own SQL.
|
|
62
|
+
- **`format_currency()` now requires currency parameter**: Previously accepted optional currency with "NZD" default. Now requires explicit currency code to avoid assumptions about user's locale.
|
|
63
|
+
|
|
64
|
+
## [0.0.6] - 2025-11-16
|
|
65
|
+
|
|
66
|
+
### Added
|
|
67
|
+
|
|
68
|
+
- Configuration YAML support for account info
|
|
69
|
+
- RabbitMQ integration utilities
|
|
70
|
+
|
|
71
|
+
### Changed
|
|
72
|
+
|
|
73
|
+
- Enhanced configuration system
|
|
74
|
+
|
|
75
|
+
## [0.0.5] - 2025-09-29
|
|
76
|
+
|
|
77
|
+
### Added
|
|
78
|
+
|
|
79
|
+
- Comprehensive test improvements
|
|
80
|
+
- Better test coverage across modules
|
|
81
|
+
|
|
82
|
+
### Fixed
|
|
83
|
+
|
|
84
|
+
- Various test fixes and improvements
|
|
85
|
+
|
|
86
|
+
## [0.0.4] - 2025-09-05
|
|
87
|
+
|
|
88
|
+
### Changed
|
|
89
|
+
|
|
90
|
+
- Minor improvements and fixes
|
|
91
|
+
|
|
92
|
+
## [0.0.3] - 2025-09-05
|
|
93
|
+
|
|
94
|
+
### Changed
|
|
95
|
+
|
|
96
|
+
- Initial improvements
|
|
97
|
+
|
|
98
|
+
## [0.0.2] - 2025-09-05
|
|
99
|
+
|
|
100
|
+
### Added
|
|
101
|
+
|
|
102
|
+
- Initial package structure
|
|
103
|
+
- Core client implementations (Slack, Elasticsearch, Database)
|
|
104
|
+
- Metrics publishing utilities
|
|
105
|
+
- Error handling decorators
|
|
106
|
+
- Timezone utilities for NZ timezone handling
|
|
107
|
+
|
|
108
|
+
## [0.0.1] - 2025-09-05
|
|
109
|
+
|
|
110
|
+
### Added
|
|
111
|
+
|
|
112
|
+
- Initial release
|
|
113
|
+
- Basic project structure
|
|
114
|
+
- Python package configuration
|
|
115
|
+
|
|
116
|
+
[Unreleased]: https://github.com/nuimarkets/nui-python-shared-utils/compare/0.0.6...HEAD
|
|
117
|
+
[0.0.6]: https://github.com/nuimarkets/nui-python-shared-utils/compare/0.0.5...0.0.6
|
|
118
|
+
[0.0.5]: https://github.com/nuimarkets/nui-python-shared-utils/compare/0.0.4...0.0.5
|
|
119
|
+
[0.0.4]: https://github.com/nuimarkets/nui-python-shared-utils/compare/0.0.3...0.0.4
|
|
120
|
+
[0.0.3]: https://github.com/nuimarkets/nui-python-shared-utils/compare/0.0.2...0.0.3
|
|
121
|
+
[0.0.2]: https://github.com/nuimarkets/nui-python-shared-utils/compare/0.0.1...0.0.2
|
|
122
|
+
[0.0.1]: https://github.com/nuimarkets/nui-python-shared-utils/releases/tag/0.0.1
|