将通过电子邮件接收到的数据上传到数据仓库。

huangapple go评论63阅读模式
英文:

Uploading data received via email to data warehouse

问题

我将每周通过电子邮件从供应商那里收到CSV数据文件,我们使用Outlook。我想将附件上传到我们的数据仓库,即Google BigQuery。

在寻找最简单的方法时,我发现了亚马逊的Simple Email Service,看起来它可以自动将电子邮件和附件保存到存储桶中。这将是很好的……只要它在Google Cloud Platform上就好了。

是否有与此等效的GCP解决方案?如果没有,是否有一种标准方法来将通过电子邮件收到的数据文件上传到数据仓库?

英文:

I am going to receive csv files of data from a vendor weekly via email, we use Outlook. I want to upload the attachments into our data warehouse, which is Google BigQuery.

In looking for the easiest way to do this I found Amazon's Simple Email Service which looks like it can automatically save the email and attachment to a storage bucket. This would be great... if only it was on Google Cloud Platform.

Is there a GCP equivalent to this? Or if not is there a standard approach to uploading data files received via email to a warehouse?

答案1

得分: 2

这就是您要寻找的App Engine,它通过Mail API为您提供了监听传入电子邮件的可能性。您可以通过在写入Cloud Storage时指定存储桶来读取和写入附件到GCS存储桶

from google.appengine.api import app_identity
bucket_name = os.environ.get('BUCKET_NAME',app_identity.get_default_gcs_bucket_name())

要处理接收电子邮件消息,您需要在应用程序配置中将电子邮件地址与脚本处理程序关联,然后在应用程序代码中包含这些处理程序。

请参考官方文档,并阅读有关配额和限制的信息,例如传入邮件消息的最大大小,包括附件为31.5 MB。

英文:

That's what you are looking for is App Engine, which gives you the possibility to listen to incoming emails via Mail API. You can read and write attachments to GCS bucket, by specifying the bucket while writing in Cloud Storage.

from google.appengine.api import app_identity
bucket_name = os.environ.get('BUCKET_NAME',app_identity.get_default_gcs_bucket_name())

To process receiving email messages, you associate email addresses with script handlers in your app configuration, then include the handlers in your app's code.

Please, refer to official documentation and read about quotas and limits, e.g. maximum size of incoming mail messages, including attachments equals to 31.5 MB.

huangapple
  • 本文由 发表于 2020年1月6日 21:02:47
  • 转载请务必保留本文链接:https://go.coder-hub.com/59612617.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定