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 toFalse, the files will not be localized. Default isFalse.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.2.tar.gz
(9.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pipen_gcs-0.0.2.tar.gz.
File metadata
- Download URL: pipen_gcs-0.0.2.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.10.12 Linux/6.5.0-1025-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5d9e8effea9cfb64aa0682e0f11a45bd4b69175a00d742384ccfc4a0959b607
|
|
| MD5 |
e90251f5d82f121b63344635850bf62a
|
|
| BLAKE2b-256 |
0d4b07d727d6d170ee8bcbc93093d47a4d90b15a91b3dfc8300d6e6904d7a0f8
|
File details
Details for the file pipen_gcs-0.0.2-py3-none-any.whl.
File metadata
- Download URL: pipen_gcs-0.0.2-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.10.12 Linux/6.5.0-1025-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7721908988752fe7c907dd1a5885e114fb5deb1a56c72b37bf18f136cca74d81
|
|
| MD5 |
3c2699be1d04f94d68f978575cbffd26
|
|
| BLAKE2b-256 |
a57aa3ad2ed95a74e571d3997c97773705c88d04e3c7c89041c7235c35c70653
|