Skip to main content

pipen-gcs

A plugin for pipen to handle files in Google Cloud Storage

Installation

pip install -U pipen-gcs

# uninstall to disable
pip uninstall pipen-gcs

Usage

from pipen import Proc, Pipen

class MyProc(Proc):
    input = "infile:file"
    input_data = ["gs://bucket/path/to/file"]
    output = "outfile:file:gs://bucket/path/to/output"
    script = "cat {{in.infile}} > {{out.outfile}}"

class MyPipen(Pipen):
    starts = MyProc
    # input files/directories will be downloaded to /tmp
    # output files/directories will be generated in /tmp and then uploaded
    #   to the cloud storage
    plugin_opts = {"gcs_localize": "/tmp"}

if __name__ == "__main__":
    MyPipen().run()

You can also disable localization, then you will have to handle the cloud storage files yourself.

from pipen import Proc, Pipen

class MyProc(Proc):
    input = "infile:file"
    input_data = ["gs://bucket/path/to/file"]
    output = "outfile:file:gs://bucket/path/to/output"
    script = "gsutil cp {{in.infile}} {{out.outfile}}"

class MyPipen(Pipen):
    starts = MyProc
    plugin_opts = {"gcs_localize": False}

if __name__ == "__main__":
    MyPipen().run()

Configuration

  • gcs_localize: The directory to localize the cloud storage files. If set to False, the files will not be localized. Default is False.
  • gcs_localize_force: If set to True, the files will be localized even if they exist locally. Default is False.
  • gcs_credentials: The path to the Google Cloud Service Account credentials file.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pipen_gcs-0.0.3.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pipen_gcs-0.0.3-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file pipen_gcs-0.0.3.tar.gz.

File metadata

  • Download URL: pipen_gcs-0.0.3.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.3 Linux/6.8.0-1017-azure

File hashes

Hashes for pipen_gcs-0.0.3.tar.gz
Algorithm Hash digest
SHA256 0ec9e7c053f2bbf6913b1677ba6194601dffe1d3e234012aad0f3caf66078ba4
MD5 a61469c49bfeaa842ab28ac3b98d1e91
BLAKE2b-256 2b96c91877960e6dc89c9bd7833f75dbaa7ea93c6849c9ef2ce4110cf0e459a0

See more details on using hashes here.

File details

Details for the file pipen_gcs-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: pipen_gcs-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.3 Linux/6.8.0-1017-azure

File hashes

Hashes for pipen_gcs-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cc72d667440f1ac489cd23f7613d35dfb161fbda110d80253db81fd7a122adc1
MD5 a9675be16a5d36c6239df71f8bb3d80d
BLAKE2b-256 8f053b2cbdb39211a32092c54db9a3cb0aad61261310720f6d27c1045ff4e9f2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page