fastsqs 0.1.0__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.
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fastsqs
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Async SQS routing and middleware library
|
|
5
|
+
Home-page: https://github.com/yourusername/fastsqs
|
|
6
|
+
Author: Your Name
|
|
7
|
+
Author-email: your.email@example.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Requires-Python: >=3.8
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
Requires-Dist: pydantic>=2.0.0
|
|
16
|
+
Dynamic: author
|
|
17
|
+
Dynamic: author-email
|
|
18
|
+
Dynamic: classifier
|
|
19
|
+
Dynamic: description
|
|
20
|
+
Dynamic: description-content-type
|
|
21
|
+
Dynamic: home-page
|
|
22
|
+
Dynamic: license
|
|
23
|
+
Dynamic: license-file
|
|
24
|
+
Dynamic: requires-dist
|
|
25
|
+
Dynamic: requires-python
|
|
26
|
+
Dynamic: summary
|
|
27
|
+
|
|
28
|
+
# fastsqs
|
|
29
|
+
|
|
30
|
+
**Fast, modern, async SQS routing and middleware for Python.**
|
|
31
|
+
|
|
32
|
+
[](https://pypi.org/project/fastsqs/)
|
|
33
|
+
[](LICENSE)
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Key Features
|
|
38
|
+
|
|
39
|
+
- 🚀 **High Performance:** Async message routing for AWS SQS, designed for speed and scalability.
|
|
40
|
+
- 🧩 **Declarative Routing:** Organize your SQS message handling with nested routers and decorators.
|
|
41
|
+
- 🔒 **Validation:** Per-route payload validation using Pydantic models.
|
|
42
|
+
- 🛠️ **Middleware:** Add before/after hooks for logging, timing, masking, and more.
|
|
43
|
+
- 🦾 **Partial Batch Failure:** Native support for AWS Lambda batch failure responses.
|
|
44
|
+
- 🐍 **Pythonic & Intuitive:** Type hints, editor support, and a familiar API for Python developers.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Requirements
|
|
49
|
+
|
|
50
|
+
- Python 3.8+
|
|
51
|
+
- [Pydantic](https://docs.pydantic.dev/) (installed automatically)
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Installation
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pip install fastsqs
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Example
|
|
64
|
+
|
|
65
|
+
### Create your app
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
from fastsqs import QueueApp, QueueRouter, Middleware
|
|
69
|
+
from pydantic import BaseModel
|
|
70
|
+
|
|
71
|
+
class GreetingPayload(BaseModel):
|
|
72
|
+
type: str
|
|
73
|
+
message: str
|
|
74
|
+
|
|
75
|
+
router = QueueRouter("type")
|
|
76
|
+
|
|
77
|
+
@router.route("greeting", model=GreetingPayload)
|
|
78
|
+
async def handle_greeting(payload, record, context, ctx, data):
|
|
79
|
+
print(f"Greeting: {data.message}")
|
|
80
|
+
|
|
81
|
+
app = QueueApp(title="Greeting SQS App", debug=True)
|
|
82
|
+
app.include_router(router)
|
|
83
|
+
|
|
84
|
+
def lambda_handler(event, context):
|
|
85
|
+
return app.handler(event, context)
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Add Middleware
|
|
89
|
+
|
|
90
|
+
```python
|
|
91
|
+
class PrintMiddleware(Middleware):
|
|
92
|
+
async def before(self, payload, record, context, ctx):
|
|
93
|
+
print("Before:", payload)
|
|
94
|
+
async def after(self, payload, record, context, ctx, error):
|
|
95
|
+
print("After:", payload, "Error:", error)
|
|
96
|
+
|
|
97
|
+
app.add_middleware(PrintMiddleware())
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## How it Works
|
|
103
|
+
|
|
104
|
+
- **Routing:** Use `QueueRouter` to route messages by payload fields. Decorators make it easy to register handlers.
|
|
105
|
+
- **Validation:** Attach Pydantic models to routes for automatic payload validation.
|
|
106
|
+
- **Middleware:** Add global or per-route middleware for logging, timing, masking, etc.
|
|
107
|
+
- **Batch Failure:** Handles partial failures for SQS-triggered Lambda functions, so only failed messages are retried.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Documentation
|
|
112
|
+
|
|
113
|
+
- [API Reference](#) (coming soon)
|
|
114
|
+
- [Tutorials](#) (coming soon)
|
|
115
|
+
- [Examples](#) (see `examples/`)
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Contributing
|
|
120
|
+
|
|
121
|
+
Contributions, issues, and feature requests are welcome!
|
|
122
|
+
Please open an issue or submit a pull request.
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## License
|
|
127
|
+
|
|
128
|
+
This project is licensed under the terms of the MIT license.
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
**Ready to build async, robust SQS message processors? Try fastsqs today!**
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
fastsqs-0.1.0.dist-info/licenses/LICENSE,sha256=r-UKmQ4c5Jk7r5bvoVjzLJkbU2jFh0AgvBBKQJPVRlo,89
|
|
2
|
+
fastsqs-0.1.0.dist-info/METADATA,sha256=7OVob6KxnVlkQ6b5V01iWXtv-0MPZaYMJ0H9pzKrPI8,3417
|
|
3
|
+
fastsqs-0.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
4
|
+
fastsqs-0.1.0.dist-info/top_level.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
5
|
+
fastsqs-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|