pipen-gcs


Namepipen-gcs JSON
Version 0.0.1 PyPI version JSON
download
home_pageNone
SummaryA plugin for pipen to handle file metadata in Google Cloud Storage
upload_time2024-07-23 22:13:25
maintainerNone
docs_urlNone
authorpwwang
requires_python<4.0,>=3.9
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pipen-gcs

A plugin for [pipen][1] to handle files in Google Cloud Storage

## Installation

```bash
pip install -U pipen-gcs

# uninstall to disable
pip uninstall pipen-gcs
```

## Usage

```python
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.

```python
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.

[1]: https://github.com/pwwang/pipen

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pipen-gcs",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "pwwang",
    "author_email": "1188067+pwwang@users.noreply.github.com",
    "download_url": "https://files.pythonhosted.org/packages/8f/d6/6ee878b1e74d867e147a2d812a299a73a259be40528196eabfc229e5d22c/pipen_gcs-0.0.1.tar.gz",
    "platform": null,
    "description": "# pipen-gcs\n\nA plugin for [pipen][1] to handle files in Google Cloud Storage\n\n## Installation\n\n```bash\npip install -U pipen-gcs\n\n# uninstall to disable\npip uninstall pipen-gcs\n```\n\n## Usage\n\n```python\nfrom pipen import Proc, Pipen\n\nclass MyProc(Proc):\n    input = \"infile:file\"\n    input_data = [\"gs://bucket/path/to/file\"]\n    output = \"outfile:file:gs://bucket/path/to/output\"\n    script = \"cat {{infile}} > {{outfile}}\"\n\nclass MyPipen(Pipen):\n    starts = MyProc\n    # input files/directories will be downloaded to /tmp\n    # output files/directories will be generated in /tmp and then uploaded\n    #   to the cloud storage\n    plugin_opts = {\"gcs_localize\": \"/tmp\"}\n\nif __name__ == \"__main__\":\n    MyPipen().run()\n```\n\nYou can also disable localization, then you will have to handle the\ncloud storage files yourself.\n\n```python\nfrom pipen import Proc, Pipen\n\nclass MyProc(Proc):\n    input = \"infile:file\"\n    input_data = [\"gs://bucket/path/to/file\"]\n    output = \"outfile:file:gs://bucket/path/to/output\"\n    script = \"gsutil cp {{infile}} {{outfile}}\"\n\nclass MyPipen(Pipen):\n    starts = MyProc\n    plugin_opts = {\"gcs_localize\": False}\n\nif __name__ == \"__main__\":\n    MyPipen().run()\n```\n\n## Configuration\n\n- `gcs_localize`: The directory to localize the cloud storage files. If\n  set to `False`, the files will not be localized. Default is `False`.\n- `gcs_credentials`: The path to the Google Cloud Service Account\n  credentials file.\n\n[1]: https://github.com/pwwang/pipen\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A plugin for pipen to handle file metadata in Google Cloud Storage",
    "version": "0.0.1",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fcf6d382843189998ffe0de1ae3a134682e6ac3aba153d43fa8a9e3cea1bfefa",
                "md5": "b8f5662f314570a2f9b8f129351df340",
                "sha256": "5be333bd6cd77b9a69c22d25ee6ed8f83a87f8d2146c643c3f1adb85c79d1ed7"
            },
            "downloads": -1,
            "filename": "pipen_gcs-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b8f5662f314570a2f9b8f129351df340",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 9639,
            "upload_time": "2024-07-23T22:13:24",
            "upload_time_iso_8601": "2024-07-23T22:13:24.482038Z",
            "url": "https://files.pythonhosted.org/packages/fc/f6/d382843189998ffe0de1ae3a134682e6ac3aba153d43fa8a9e3cea1bfefa/pipen_gcs-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8fd66ee878b1e74d867e147a2d812a299a73a259be40528196eabfc229e5d22c",
                "md5": "dde1d929dbd3c30ad867ef6de7c18938",
                "sha256": "322ece177aac5299c4f76e7b17b51679d5675a99c800ff18d05b8220ad03fa8a"
            },
            "downloads": -1,
            "filename": "pipen_gcs-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "dde1d929dbd3c30ad867ef6de7c18938",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 9020,
            "upload_time": "2024-07-23T22:13:25",
            "upload_time_iso_8601": "2024-07-23T22:13:25.606989Z",
            "url": "https://files.pythonhosted.org/packages/8f/d6/6ee878b1e74d867e147a2d812a299a73a259be40528196eabfc229e5d22c/pipen_gcs-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-23 22:13:25",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pipen-gcs"
}
        
Elapsed time: 1.10756s