Skip to main content

A plugin for pipen to handle file metadata in Google Cloud Storage

Project description

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 {{infile}} > {{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 {{infile}} {{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_credentials: The path to the Google Cloud Service Account credentials file.

Project details


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.1.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

pipen_gcs-0.0.1-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pipen_gcs-0.0.1.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1023-azure

File hashes

Hashes for pipen_gcs-0.0.1.tar.gz
Algorithm Hash digest
SHA256 322ece177aac5299c4f76e7b17b51679d5675a99c800ff18d05b8220ad03fa8a
MD5 dde1d929dbd3c30ad867ef6de7c18938
BLAKE2b-256 8fd66ee878b1e74d867e147a2d812a299a73a259be40528196eabfc229e5d22c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pipen_gcs-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1023-azure

File hashes

Hashes for pipen_gcs-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5be333bd6cd77b9a69c22d25ee6ed8f83a87f8d2146c643c3f1adb85c79d1ed7
MD5 b8f5662f314570a2f9b8f129351df340
BLAKE2b-256 fcf6d382843189998ffe0de1ae3a134682e6ac3aba153d43fa8a9e3cea1bfefa

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page