通过使用Python下载S3的CSV文件给CSV文件
我需要一个应用程序来从s3 bucket
中拾取一些csv
文件,然后将它们发送到指定的收件人。我能够使用问题结束时的解决方案来使代码工作: 附件
但是,上面的该代码解决方案首先将文件完全下载到local Storage
,然后再次读取它们并将其发送电子邮件。我的公司非常喜欢我找到一个解决方案,可以直接从s3
直接通过电子邮件发送附件,而不必依赖local Storage
。这可能吗?如果是这样,怎么样?
Note :我不使用aws lambda
,只是从服务器运行的常规Python应用程序,与我所指的问题不同。
I need an application to pick up some csv
files from an s3 bucket
and e-mail them to specified recipients. I was able to make the code work using the solution present at the end of the question here:
Python Lambda to send files uploaded to s3 as email attachments
However, this code solution above first downloads the files entirely to local storage
, then reads them again and e-mails them. My company strongly prefers I find a solution to e-mail the attachment directly from s3
without having to rely on local storage
. Is this possible? If so, how?
Note: I am not using an AWS Lambda
, just a regular python application run from a server, unlike the question I refer to.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以设计在服务器上运行的Python应用程序,以通过
> Serverless
应用程序发送电子邮件。serverless
应用程序将在将其附加到电子邮件并发送电子邮件之前从S3下载对象。/code> 具有SDK python开发。
事件的顺序看起来像
You could design your python application running on the server to send the email via
serverless
application, say. Theserverless
app would download the object from s3, before attaching it to the email and sending it.AWS supports python, and
serverless
has an SDK for python development.The sequence of events would look something like