shuuten 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.
- shuuten-0.1.0/CONTRIBUTING.md +119 -0
- shuuten-0.1.0/HISTORY.md +5 -0
- shuuten-0.1.0/LICENSE +21 -0
- shuuten-0.1.0/MANIFEST.in +10 -0
- shuuten-0.1.0/PKG-INFO +93 -0
- shuuten-0.1.0/README.md +51 -0
- shuuten-0.1.0/docs/index.md +16 -0
- shuuten-0.1.0/docs/installation.md +38 -0
- shuuten-0.1.0/docs/usage.md +7 -0
- shuuten-0.1.0/pyproject.toml +99 -0
- shuuten-0.1.0/setup.cfg +4 -0
- shuuten-0.1.0/src/shuuten/__init__.py +12 -0
- shuuten-0.1.0/src/shuuten/__main__.py +4 -0
- shuuten-0.1.0/src/shuuten/cli.py +22 -0
- shuuten-0.1.0/src/shuuten/shuuten.py +38 -0
- shuuten-0.1.0/src/shuuten/utils.py +2 -0
- shuuten-0.1.0/src/shuuten.egg-info/PKG-INFO +93 -0
- shuuten-0.1.0/src/shuuten.egg-info/SOURCES.txt +21 -0
- shuuten-0.1.0/src/shuuten.egg-info/dependency_links.txt +1 -0
- shuuten-0.1.0/src/shuuten.egg-info/requires.txt +15 -0
- shuuten-0.1.0/src/shuuten.egg-info/top_level.txt +1 -0
- shuuten-0.1.0/tests/__init__.py +1 -0
- shuuten-0.1.0/tests/test_shuuten.py +22 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.
|
|
4
|
+
|
|
5
|
+
You can contribute in many ways:
|
|
6
|
+
|
|
7
|
+
## Types of Contributions
|
|
8
|
+
|
|
9
|
+
### Report Bugs
|
|
10
|
+
|
|
11
|
+
Report bugs at https://github.com/rnag/shuuten/issues.
|
|
12
|
+
|
|
13
|
+
If you are reporting a bug, please include:
|
|
14
|
+
|
|
15
|
+
- Your operating system name and version.
|
|
16
|
+
- Any details about your local setup that might be helpful in troubleshooting.
|
|
17
|
+
- Detailed steps to reproduce the bug.
|
|
18
|
+
|
|
19
|
+
### Fix Bugs
|
|
20
|
+
|
|
21
|
+
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help wanted" is open to whoever wants to implement it.
|
|
22
|
+
|
|
23
|
+
### Implement Features
|
|
24
|
+
|
|
25
|
+
Look through the GitHub issues for features. Anything tagged with "enhancement" and "help wanted" is open to whoever wants to implement it.
|
|
26
|
+
|
|
27
|
+
### Write Documentation
|
|
28
|
+
|
|
29
|
+
Shuuten Signal could always use more documentation, whether as part of the official docs, in docstrings, or even on the web in blog posts, articles, and such.
|
|
30
|
+
|
|
31
|
+
### Submit Feedback
|
|
32
|
+
|
|
33
|
+
The best way to send feedback is to file an issue at https://github.com/rnag/shuuten/issues.
|
|
34
|
+
|
|
35
|
+
If you are proposing a feature:
|
|
36
|
+
|
|
37
|
+
- Explain in detail how it would work.
|
|
38
|
+
- Keep the scope as narrow as possible, to make it easier to implement.
|
|
39
|
+
- Remember that this is a volunteer-driven project, and that contributions are welcome :)
|
|
40
|
+
|
|
41
|
+
## Get Started!
|
|
42
|
+
|
|
43
|
+
Ready to contribute? Here's how to set up `shuuten` for local development.
|
|
44
|
+
|
|
45
|
+
1. Fork the `shuuten` repo on GitHub.
|
|
46
|
+
2. Clone your fork locally:
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
git clone git@github.com:your_name_here/shuuten.git
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development:
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
mkvirtualenv shuuten
|
|
56
|
+
cd shuuten/
|
|
57
|
+
python setup.py develop
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
4. Create a branch for local development:
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
git checkout -b name-of-your-bugfix-or-feature
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Now you can make your changes locally.
|
|
67
|
+
|
|
68
|
+
5. When you're done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox:
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
make lint
|
|
72
|
+
make test
|
|
73
|
+
# Or
|
|
74
|
+
make test-all
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
To get flake8 and tox, just pip install them into your virtualenv.
|
|
78
|
+
|
|
79
|
+
6. Commit your changes and push your branch to GitHub:
|
|
80
|
+
|
|
81
|
+
```sh
|
|
82
|
+
git add .
|
|
83
|
+
git commit -m "Your detailed description of your changes."
|
|
84
|
+
git push origin name-of-your-bugfix-or-feature
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
7. Submit a pull request through the GitHub website.
|
|
88
|
+
|
|
89
|
+
## Pull Request Guidelines
|
|
90
|
+
|
|
91
|
+
Before you submit a pull request, check that it meets these guidelines:
|
|
92
|
+
|
|
93
|
+
1. The pull request should include tests.
|
|
94
|
+
2. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in README.md.
|
|
95
|
+
3. The pull request should work for Python 3.12 and 3.13. Tests run in GitHub Actions on every pull request to the main branch, make sure that the tests pass for all supported Python versions.
|
|
96
|
+
|
|
97
|
+
## Tips
|
|
98
|
+
|
|
99
|
+
To run a subset of tests:
|
|
100
|
+
|
|
101
|
+
```sh
|
|
102
|
+
pytest tests.test_shuuten
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Deploying
|
|
106
|
+
|
|
107
|
+
A reminder for the maintainers on how to deploy. Make sure all your changes are committed (including an entry in HISTORY.md). Then run:
|
|
108
|
+
|
|
109
|
+
```sh
|
|
110
|
+
bump2version patch # possible: major / minor / patch
|
|
111
|
+
git push
|
|
112
|
+
git push --tags
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
You can set up a [GitHub Actions workflow](https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-python#publishing-to-pypi) to automatically deploy your package to PyPI when you push a new tag.
|
|
116
|
+
|
|
117
|
+
## Code of Conduct
|
|
118
|
+
|
|
119
|
+
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
|
shuuten-0.1.0/HISTORY.md
ADDED
shuuten-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, Ritvik Nag
|
|
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.
|
shuuten-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: shuuten
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Last-stop signals for automation failures.
|
|
5
|
+
Author-email: Ritvik Nag <me@ritviknag.com>
|
|
6
|
+
Maintainer-email: Ritvik Nag <me@ritviknag.com>
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/rnag/shuuten
|
|
9
|
+
Project-URL: Repository, https://github.com/rnag/shuuten.git
|
|
10
|
+
Project-URL: Issues, https://github.com/rnag/shuuten/issues
|
|
11
|
+
Project-URL: Changelog, https://github.com/rnag/shuuten/blob/main/CHANGELOG.md
|
|
12
|
+
Keywords: automation,notifications,alerts,slack,email,aws,lambda,ecs,observability,ops
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Topic :: System :: Logging
|
|
17
|
+
Classifier: Topic :: System :: Monitoring
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
26
|
+
Requires-Python: >=3.9
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
License-File: LICENSE
|
|
29
|
+
Provides-Extra: cli
|
|
30
|
+
Requires-Dist: rich; extra == "cli"
|
|
31
|
+
Requires-Dist: typer; extra == "cli"
|
|
32
|
+
Provides-Extra: test
|
|
33
|
+
Requires-Dist: pytest; extra == "test"
|
|
34
|
+
Requires-Dist: pytest-cov; extra == "test"
|
|
35
|
+
Requires-Dist: coverage; extra == "test"
|
|
36
|
+
Requires-Dist: ruff; extra == "test"
|
|
37
|
+
Requires-Dist: ty; extra == "test"
|
|
38
|
+
Requires-Dist: ipdb; extra == "test"
|
|
39
|
+
Provides-Extra: email
|
|
40
|
+
Requires-Dist: boto3; extra == "email"
|
|
41
|
+
Dynamic: license-file
|
|
42
|
+
|
|
43
|
+
<div align="center">
|
|
44
|
+
<img alt="logo" width="175" src="img/logo.png">
|
|
45
|
+
|
|
46
|
+
## Shuuten Signal
|
|
47
|
+
|
|
48
|
+
[](https://github.com/rnag/shuuten/actions)
|
|
49
|
+
[](https://pypi.org/project/shuuten)
|
|
50
|
+
[](https://pypi.python.org/pypi/shuuten)
|
|
51
|
+
[](https://opensource.org/license/MIT)
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
**Last-stop signals for automation failures.**
|
|
55
|
+
|
|
56
|
+
*終点 (Shuuten) means “final stop” or “terminus” in Japanese — the point where a workflow ends and signals that something needs attention.*
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
> 終点 (Shuuten): the final stop — where automations end and signal for attention.
|
|
61
|
+
|
|
62
|
+
## About
|
|
63
|
+
|
|
64
|
+
Shuuten Signal provides structured, safe failure notifications for Python automations running in AWS Lambda, ECS, and beyond.
|
|
65
|
+
|
|
66
|
+
In v0.1.0, Shuuten focuses on being a lightweight, dependency-free foundation for sending failure signals from automation workflows.
|
|
67
|
+
|
|
68
|
+
## Features
|
|
69
|
+
|
|
70
|
+
- Dependency-free Slack Incoming Webhook notifications
|
|
71
|
+
- Designed for AWS Lambda, ECS, and container-based automations
|
|
72
|
+
- Minimal surface area, easy to extend
|
|
73
|
+
|
|
74
|
+
## Install
|
|
75
|
+
|
|
76
|
+
```shell
|
|
77
|
+
pip install shuuten
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Usage
|
|
81
|
+
|
|
82
|
+
```python3
|
|
83
|
+
import shuuten
|
|
84
|
+
|
|
85
|
+
hook_url = "https://hooks.slack.com/services/<team>/<channel>/<token>" # keep this secret
|
|
86
|
+
payload = {'text': 'Hello from Shuuten 👋 (webhook test)'}
|
|
87
|
+
|
|
88
|
+
shuuten.send_to_slack(hook_url, payload)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Credits
|
|
92
|
+
|
|
93
|
+
This package was created with [Cookiecutter](https://github.com/audreyfeldroy/cookiecutter) and the [audreyfeldroy/cookiecutter-pypackage](https://github.com/audreyfeldroy/cookiecutter-pypackage) project template.
|
shuuten-0.1.0/README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img alt="logo" width="175" src="img/logo.png">
|
|
3
|
+
|
|
4
|
+
## Shuuten Signal
|
|
5
|
+
|
|
6
|
+
[](https://github.com/rnag/shuuten/actions)
|
|
7
|
+
[](https://pypi.org/project/shuuten)
|
|
8
|
+
[](https://pypi.python.org/pypi/shuuten)
|
|
9
|
+
[](https://opensource.org/license/MIT)
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
**Last-stop signals for automation failures.**
|
|
13
|
+
|
|
14
|
+
*終点 (Shuuten) means “final stop” or “terminus” in Japanese — the point where a workflow ends and signals that something needs attention.*
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
> 終点 (Shuuten): the final stop — where automations end and signal for attention.
|
|
19
|
+
|
|
20
|
+
## About
|
|
21
|
+
|
|
22
|
+
Shuuten Signal provides structured, safe failure notifications for Python automations running in AWS Lambda, ECS, and beyond.
|
|
23
|
+
|
|
24
|
+
In v0.1.0, Shuuten focuses on being a lightweight, dependency-free foundation for sending failure signals from automation workflows.
|
|
25
|
+
|
|
26
|
+
## Features
|
|
27
|
+
|
|
28
|
+
- Dependency-free Slack Incoming Webhook notifications
|
|
29
|
+
- Designed for AWS Lambda, ECS, and container-based automations
|
|
30
|
+
- Minimal surface area, easy to extend
|
|
31
|
+
|
|
32
|
+
## Install
|
|
33
|
+
|
|
34
|
+
```shell
|
|
35
|
+
pip install shuuten
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
```python3
|
|
41
|
+
import shuuten
|
|
42
|
+
|
|
43
|
+
hook_url = "https://hooks.slack.com/services/<team>/<channel>/<token>" # keep this secret
|
|
44
|
+
payload = {'text': 'Hello from Shuuten 👋 (webhook test)'}
|
|
45
|
+
|
|
46
|
+
shuuten.send_to_slack(hook_url, payload)
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Credits
|
|
50
|
+
|
|
51
|
+
This package was created with [Cookiecutter](https://github.com/audreyfeldroy/cookiecutter) and the [audreyfeldroy/cookiecutter-pypackage](https://github.com/audreyfeldroy/cookiecutter-pypackage) project template.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Welcome to Shuuten Signal's documentation!
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- [Readme](readme.md)
|
|
6
|
+
- [Installation](installation.md)
|
|
7
|
+
- [Usage](usage.md)
|
|
8
|
+
- [Modules](modules.md)
|
|
9
|
+
- [Contributing](contributing.md)
|
|
10
|
+
- [History](history.md)
|
|
11
|
+
|
|
12
|
+
## Indices and tables
|
|
13
|
+
|
|
14
|
+
- [Index](genindex)
|
|
15
|
+
- [Module Index](modindex)
|
|
16
|
+
- [Search](search)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Installation
|
|
2
|
+
|
|
3
|
+
## Stable release
|
|
4
|
+
|
|
5
|
+
To install Shuuten Signal, run this command in your terminal:
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
uv add shuuten
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or if you prefer to use `pip`:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
pip install shuuten
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## From source
|
|
18
|
+
|
|
19
|
+
The source files for Shuuten Signal can be downloaded from the [Github repo](https://github.com/rnag/shuuten).
|
|
20
|
+
|
|
21
|
+
You can either clone the public repository:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
git clone git://github.com/rnag/shuuten
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Or download the [tarball](https://github.com/rnag/shuuten/tarball/master):
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
curl -OJL https://github.com/rnag/shuuten/tarball/master
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Once you have a copy of the source, you can install it with:
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
cd shuuten
|
|
37
|
+
uv pip install .
|
|
38
|
+
```
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "shuuten"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Last-stop signals for automation failures."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.9"
|
|
7
|
+
license = {text = "MIT"}
|
|
8
|
+
|
|
9
|
+
authors = [
|
|
10
|
+
{name = "Ritvik Nag", email = "me@ritviknag.com"}
|
|
11
|
+
]
|
|
12
|
+
maintainers = [
|
|
13
|
+
{name = "Ritvik Nag", email = "me@ritviknag.com"}
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
dependencies = []
|
|
17
|
+
|
|
18
|
+
keywords = [
|
|
19
|
+
"automation",
|
|
20
|
+
"notifications",
|
|
21
|
+
"alerts",
|
|
22
|
+
"slack",
|
|
23
|
+
"email",
|
|
24
|
+
"aws",
|
|
25
|
+
"lambda",
|
|
26
|
+
"ecs",
|
|
27
|
+
"observability",
|
|
28
|
+
"ops",
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
classifiers = [
|
|
32
|
+
# How mature is this project? Common values are
|
|
33
|
+
# 3 - Alpha
|
|
34
|
+
# 4 - Beta
|
|
35
|
+
# 5 - Production/Stable
|
|
36
|
+
"Development Status :: 3 - Alpha",
|
|
37
|
+
# Indicate who your project is intended for
|
|
38
|
+
"Intended Audience :: Developers",
|
|
39
|
+
"License :: OSI Approved :: MIT License",
|
|
40
|
+
"Topic :: System :: Logging",
|
|
41
|
+
"Topic :: System :: Monitoring",
|
|
42
|
+
"Topic :: Software Development :: Libraries",
|
|
43
|
+
# Specify the Python versions you support here.
|
|
44
|
+
"Programming Language :: Python :: 3",
|
|
45
|
+
"Programming Language :: Python :: 3.9",
|
|
46
|
+
"Programming Language :: Python :: 3.10",
|
|
47
|
+
"Programming Language :: Python :: 3.11",
|
|
48
|
+
"Programming Language :: Python :: 3.12",
|
|
49
|
+
"Programming Language :: Python :: 3.13",
|
|
50
|
+
"Programming Language :: Python :: 3.14",
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
[project.optional-dependencies]
|
|
54
|
+
cli = [
|
|
55
|
+
"rich",
|
|
56
|
+
"typer",
|
|
57
|
+
]
|
|
58
|
+
test = [
|
|
59
|
+
"pytest", # testing
|
|
60
|
+
"pytest-cov", # testing
|
|
61
|
+
"coverage", # testing
|
|
62
|
+
"ruff", # linting
|
|
63
|
+
"ty", # checking types
|
|
64
|
+
"ipdb", # debugging
|
|
65
|
+
]
|
|
66
|
+
email = ["boto3"]
|
|
67
|
+
# slack = ["slack_sdk"] # only if I decide to support Slack Web API; webhooks don't need this
|
|
68
|
+
|
|
69
|
+
[project.urls]
|
|
70
|
+
Homepage = "https://github.com/rnag/shuuten"
|
|
71
|
+
# Documentation = "https://readthedocs.org"
|
|
72
|
+
Repository = "https://github.com/rnag/shuuten.git"
|
|
73
|
+
Issues = "https://github.com/rnag/shuuten/issues"
|
|
74
|
+
Changelog = "https://github.com/rnag/shuuten/blob/main/CHANGELOG.md"
|
|
75
|
+
|
|
76
|
+
# Consider removing this until I want a CLI-first experience
|
|
77
|
+
# [project.scripts]
|
|
78
|
+
# shuuten = "shuuten.cli:app"
|
|
79
|
+
|
|
80
|
+
[tool.ty]
|
|
81
|
+
# All rules are enabled as "error" by default; no need to specify unless overriding.
|
|
82
|
+
# Example override: relax a rule for the entire project (uncomment if needed).
|
|
83
|
+
# rules.TY015 = "warn" # For invalid-argument-type, warn instead of error.
|
|
84
|
+
|
|
85
|
+
[tool.ruff]
|
|
86
|
+
line-length = 80
|
|
87
|
+
|
|
88
|
+
[tool.ruff.lint]
|
|
89
|
+
select = [
|
|
90
|
+
"E", # pycodestyle errors
|
|
91
|
+
"W", # pycodestyle warnings
|
|
92
|
+
"F", # Pyflakes
|
|
93
|
+
"I", # isort
|
|
94
|
+
"B", # flake8-bugbear
|
|
95
|
+
"UP", # pyupgrade
|
|
96
|
+
]
|
|
97
|
+
|
|
98
|
+
[tool.uv]
|
|
99
|
+
package = true
|
shuuten-0.1.0/setup.cfg
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""Top-level package for Shuuten Signal."""
|
|
2
|
+
|
|
3
|
+
__author__ = """Ritvik Nag"""
|
|
4
|
+
__email__ = 'me@ritviknag.com'
|
|
5
|
+
|
|
6
|
+
from .shuuten import send_to_slack
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def version():
|
|
10
|
+
from importlib.metadata import version
|
|
11
|
+
__version__ = version('shuuten')
|
|
12
|
+
return __version__
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"""Console script for shuuten."""
|
|
2
|
+
|
|
3
|
+
import typer
|
|
4
|
+
from rich.console import Console
|
|
5
|
+
|
|
6
|
+
from shuuten import utils
|
|
7
|
+
|
|
8
|
+
app = typer.Typer()
|
|
9
|
+
console = Console()
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@app.command()
|
|
13
|
+
def main():
|
|
14
|
+
"""Console script for shuuten."""
|
|
15
|
+
console.print("Replace this message by putting your code into "
|
|
16
|
+
"shuuten.cli.main")
|
|
17
|
+
console.print("See Typer documentation at https://typer.tiangolo.com/")
|
|
18
|
+
utils.do_something_useful()
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
if __name__ == "__main__":
|
|
22
|
+
app()
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""Slack webhook utilities for Shuuten."""
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
import urllib.request
|
|
5
|
+
import urllib.error
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def send_to_slack(webhook_url: str, payload: dict) -> None:
|
|
9
|
+
"""
|
|
10
|
+
Send a message to Slack via Incoming Webhook.
|
|
11
|
+
|
|
12
|
+
:param webhook_url: Slack Incoming Webhook URL
|
|
13
|
+
:param payload: JSON-serializable Slack message payload
|
|
14
|
+
(e.g. {"text": "Hello from Shuuten"})
|
|
15
|
+
:raises RuntimeError: if Slack returns a non-2xx response
|
|
16
|
+
:raises URLError: if the request fails at the network level
|
|
17
|
+
"""
|
|
18
|
+
data = json.dumps(payload).encode('utf-8')
|
|
19
|
+
|
|
20
|
+
req = urllib.request.Request(
|
|
21
|
+
webhook_url,
|
|
22
|
+
data=data,
|
|
23
|
+
headers={'Content-Type': 'application/json'},
|
|
24
|
+
method='POST',
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
try:
|
|
28
|
+
with urllib.request.urlopen(req, timeout=10) as resp:
|
|
29
|
+
if resp.status >= 400:
|
|
30
|
+
body = resp.read().decode('utf-8', errors='replace')
|
|
31
|
+
raise RuntimeError(
|
|
32
|
+
f'Slack webhook failed with status {resp.status}: {body}'
|
|
33
|
+
)
|
|
34
|
+
except urllib.error.HTTPError as e:
|
|
35
|
+
body = e.read().decode('utf-8', errors='replace')
|
|
36
|
+
raise RuntimeError(
|
|
37
|
+
f'Slack webhook HTTP error {e.code}: {body}'
|
|
38
|
+
) from e
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: shuuten
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Last-stop signals for automation failures.
|
|
5
|
+
Author-email: Ritvik Nag <me@ritviknag.com>
|
|
6
|
+
Maintainer-email: Ritvik Nag <me@ritviknag.com>
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/rnag/shuuten
|
|
9
|
+
Project-URL: Repository, https://github.com/rnag/shuuten.git
|
|
10
|
+
Project-URL: Issues, https://github.com/rnag/shuuten/issues
|
|
11
|
+
Project-URL: Changelog, https://github.com/rnag/shuuten/blob/main/CHANGELOG.md
|
|
12
|
+
Keywords: automation,notifications,alerts,slack,email,aws,lambda,ecs,observability,ops
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Topic :: System :: Logging
|
|
17
|
+
Classifier: Topic :: System :: Monitoring
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
26
|
+
Requires-Python: >=3.9
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
License-File: LICENSE
|
|
29
|
+
Provides-Extra: cli
|
|
30
|
+
Requires-Dist: rich; extra == "cli"
|
|
31
|
+
Requires-Dist: typer; extra == "cli"
|
|
32
|
+
Provides-Extra: test
|
|
33
|
+
Requires-Dist: pytest; extra == "test"
|
|
34
|
+
Requires-Dist: pytest-cov; extra == "test"
|
|
35
|
+
Requires-Dist: coverage; extra == "test"
|
|
36
|
+
Requires-Dist: ruff; extra == "test"
|
|
37
|
+
Requires-Dist: ty; extra == "test"
|
|
38
|
+
Requires-Dist: ipdb; extra == "test"
|
|
39
|
+
Provides-Extra: email
|
|
40
|
+
Requires-Dist: boto3; extra == "email"
|
|
41
|
+
Dynamic: license-file
|
|
42
|
+
|
|
43
|
+
<div align="center">
|
|
44
|
+
<img alt="logo" width="175" src="img/logo.png">
|
|
45
|
+
|
|
46
|
+
## Shuuten Signal
|
|
47
|
+
|
|
48
|
+
[](https://github.com/rnag/shuuten/actions)
|
|
49
|
+
[](https://pypi.org/project/shuuten)
|
|
50
|
+
[](https://pypi.python.org/pypi/shuuten)
|
|
51
|
+
[](https://opensource.org/license/MIT)
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
**Last-stop signals for automation failures.**
|
|
55
|
+
|
|
56
|
+
*終点 (Shuuten) means “final stop” or “terminus” in Japanese — the point where a workflow ends and signals that something needs attention.*
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
> 終点 (Shuuten): the final stop — where automations end and signal for attention.
|
|
61
|
+
|
|
62
|
+
## About
|
|
63
|
+
|
|
64
|
+
Shuuten Signal provides structured, safe failure notifications for Python automations running in AWS Lambda, ECS, and beyond.
|
|
65
|
+
|
|
66
|
+
In v0.1.0, Shuuten focuses on being a lightweight, dependency-free foundation for sending failure signals from automation workflows.
|
|
67
|
+
|
|
68
|
+
## Features
|
|
69
|
+
|
|
70
|
+
- Dependency-free Slack Incoming Webhook notifications
|
|
71
|
+
- Designed for AWS Lambda, ECS, and container-based automations
|
|
72
|
+
- Minimal surface area, easy to extend
|
|
73
|
+
|
|
74
|
+
## Install
|
|
75
|
+
|
|
76
|
+
```shell
|
|
77
|
+
pip install shuuten
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Usage
|
|
81
|
+
|
|
82
|
+
```python3
|
|
83
|
+
import shuuten
|
|
84
|
+
|
|
85
|
+
hook_url = "https://hooks.slack.com/services/<team>/<channel>/<token>" # keep this secret
|
|
86
|
+
payload = {'text': 'Hello from Shuuten 👋 (webhook test)'}
|
|
87
|
+
|
|
88
|
+
shuuten.send_to_slack(hook_url, payload)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Credits
|
|
92
|
+
|
|
93
|
+
This package was created with [Cookiecutter](https://github.com/audreyfeldroy/cookiecutter) and the [audreyfeldroy/cookiecutter-pypackage](https://github.com/audreyfeldroy/cookiecutter-pypackage) project template.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
CONTRIBUTING.md
|
|
2
|
+
HISTORY.md
|
|
3
|
+
LICENSE
|
|
4
|
+
MANIFEST.in
|
|
5
|
+
README.md
|
|
6
|
+
pyproject.toml
|
|
7
|
+
docs/index.md
|
|
8
|
+
docs/installation.md
|
|
9
|
+
docs/usage.md
|
|
10
|
+
src/shuuten/__init__.py
|
|
11
|
+
src/shuuten/__main__.py
|
|
12
|
+
src/shuuten/cli.py
|
|
13
|
+
src/shuuten/shuuten.py
|
|
14
|
+
src/shuuten/utils.py
|
|
15
|
+
src/shuuten.egg-info/PKG-INFO
|
|
16
|
+
src/shuuten.egg-info/SOURCES.txt
|
|
17
|
+
src/shuuten.egg-info/dependency_links.txt
|
|
18
|
+
src/shuuten.egg-info/requires.txt
|
|
19
|
+
src/shuuten.egg-info/top_level.txt
|
|
20
|
+
tests/__init__.py
|
|
21
|
+
tests/test_shuuten.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
shuuten
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Unit test package for shuuten."""
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
import pytest
|
|
3
|
+
|
|
4
|
+
"""Tests for `shuuten` package."""
|
|
5
|
+
|
|
6
|
+
# from shuuten import shuuten
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@pytest.fixture
|
|
10
|
+
def response():
|
|
11
|
+
"""Sample pytest fixture.
|
|
12
|
+
|
|
13
|
+
See more at: http://doc.pytest.org/en/latest/fixture.html
|
|
14
|
+
"""
|
|
15
|
+
# import requests
|
|
16
|
+
# return requests.get('https://github.com/audreyfeldroy/cookiecutter-pypackage')
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def test_content(response):
|
|
20
|
+
"""Sample pytest test function with the pytest fixture as an argument."""
|
|
21
|
+
# from bs4 import BeautifulSoup
|
|
22
|
+
# assert 'GitHub' in BeautifulSoup(response.content).title.string
|