【发布时间】:2022-07-26 23:28:32
【问题描述】:
我想直接从 Julia 在 GCP 存储中写入一个 .csv 文件。
【问题讨论】:
我想直接从 Julia 在 GCP 存储中写入一个 .csv 文件。
【问题讨论】:
GoogleCloud.jl 支持此功能,所有步骤都可以在它的tutorial 中找到
我在这里引用它,但请查看教程的版本。
using GoogleCloud
creds = GoogleCredentials(expanduser("~/credentials.json"))
session = GoogleSession(creds, ["devstorage.full_control"])
set_session!(storage, session) # storage is the API root, exported from GoogleCloud.jl
file_contents = readstring(open("file.csv", "r"));
storage(:Object, :insert, "a12345foo"; # Returns metadata about the object
name="file.csv",
data=file_contents,
content_type="text/csv"
)
【讨论】: