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.4.tar.gz (9.3 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.4-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pipen_gcs-0.0.4.tar.gz
Algorithm Hash digest
SHA256 ebf3298cb705bfa5dafb0dcc4ec60da5f39833b4295b883b20f1a0f81bc15a3d
MD5 818e90d9f576a13bb6ee4e270fd5c556
BLAKE2b-256 4a971baac605208f1b6b4ad727ec512329db75c65042d185188f934131f9e7d5

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pipen_gcs-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 011a115307e85be3b704a7a23532dfb055be874e12e28141f2e8ca39da97bbb7
MD5 3235cb5126bcca5f2f903672a9798d4b
BLAKE2b-256 fcb36c79e282b15ba21aaef523f714102c336fabf66261c322337909eeebe193

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