【问题标题】:How to upload a .csv file to GCP storage using Julia如何使用 Julia 将 .csv 文件上传到 GCP 存储
【发布时间】:2022-07-26 23:28:32
【问题描述】:

我想直接从 Julia 在 GCP 存储中写入一个 .csv 文件。

【问题讨论】:

    标签: csv julia


    【解决方案1】:

    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" 
    )
    

    【讨论】:

      猜你喜欢
      • 2022-06-10
      • 2019-05-06
      • 2023-01-18
      • 2022-06-21
      • 1970-01-01
      • 2020-02-29
      • 2019-12-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多