prefect-google-sheets


Nameprefect-google-sheets JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/stefanocascavilla/prefect-google-sheets
SummaryPrefect collection of tasks in order to work with Google Sheets
upload_time2022-12-20 14:38:51
maintainer
docs_urlNone
authorStefano Cascavilla
requires_python>=3.7
licenseApache License 2.0
keywords prefect
VCS
bugtrack_url
requirements prefect pandas gspread-dataframe gspread google-auth
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # prefect-google-sheets

<p align="center">
    <a href="https://pypi.python.org/pypi/prefect-google-sheets/" alt="PyPI version">
        <img alt="PyPI" src="https://img.shields.io/pypi/v/prefect-google-sheets?color=0052FF&labelColor=090422"></a>
    <a href="https://github.com/stefanocascavilla/prefect-google-sheets/" alt="Stars">
        <img src="https://img.shields.io/github/stars/stefanocascavilla/prefect-google-sheets?color=0052FF&labelColor=090422" /></a>
    <a href="https://pepy.tech/badge/prefect-google-sheets/" alt="Downloads">
        <img src="https://img.shields.io/pypi/dm/prefect-google-sheets?color=0052FF&labelColor=090422" /></a>
    <a href="https://github.com/stefanocascavilla/prefect-google-sheets/pulse" alt="Activity">
        <img src="https://img.shields.io/github/commit-activity/m/stefanocascavilla/prefect-google-sheets?color=0052FF&labelColor=090422" /></a>
    <br>
    <a href="https://prefect-community.slack.com" alt="Slack">
        <img src="https://img.shields.io/badge/slack-join_community-red.svg?color=0052FF&labelColor=090422&logo=slack" /></a>
    <a href="https://discourse.prefect.io/" alt="Discourse">
        <img src="https://img.shields.io/badge/discourse-browse_forum-red.svg?color=0052FF&labelColor=090422&logo=discourse" /></a>
</p>

## Welcome!

Prefect collection of tasks in order to work with Google Sheets

## Getting Started

### Python setup

Requires an installation of Python 3.7+.

We recommend using a Python virtual environment manager such as pipenv, conda or virtualenv.

These tasks are designed to work with Prefect 2.0. For more information about how to use Prefect, please refer to the [Prefect documentation](https://orion-docs.prefect.io/).

### Installation

Install `prefect-google-sheets` with `pip`:

```bash
pip install prefect-google-sheets
```

Then, register to [view the block](https://orion-docs.prefect.io/ui/blocks/) on Prefect Cloud:

```bash
prefect block register -m prefect_google_sheets
```

Note, to use the `load` method on Blocks, you must already have a block document [saved through code](https://orion-docs.prefect.io/concepts/blocks/#saving-blocks) or [saved through the UI](https://orion-docs.prefect.io/ui/blocks/).

### Write and run a flow

```python
from prefect import flow
from prefect_google_sheets.tasks import (
    read_google_sheet_as_data_frame,
    read_google_sheet_as_list_of_lists,
    read_google_sheet_as_dict_of_lists,
)


@flow
def read_sheets():
    sheet_df = read_google_sheet_as_data_frame(
        is_public_sheet="<True or False, depending if the sheet you are reading is public or not>",
        google_service_account="<The Google Service Account information in order to access the sheet>",
        google_sheet_key="<The key of the sheet to read>",
        google_sheet_name="<The name of the sheet to read>",
        first_row_header="<True or False, depending if the first row of the table needs to be considered as the header>",
        on_bad_lines="<What to do if bad lines are discovered while reading the sheet>",
        clean="<True or False, depending if blank columns and rows need to be removed>"
    )

    sheet_list_of_lists = read_google_sheet_as_list_of_lists(
        is_public_sheet="<True or False, depending if the sheet you are reading is public or not>",
        google_service_account="<The Google Service Account information in order to access the sheet>",
        google_sheet_key="<The key of the sheet to read>",
        google_sheet_name="<The name of the sheet to read>",
        first_row_header="<True or False, depending if the first row of the table needs to be considered as the header>",
        on_bad_lines="<What to do if bad lines are discovered while reading the sheet>",
        clean="<True or False, depending if blank columns and rows need to be removed>"
    )

    sheet_dict_of_lists = read_google_sheet_as_dict_of_lists(
        is_public_sheet="<True or False, depending if the sheet you are reading is public or not>",
        google_service_account="<The Google Service Account information in order to access the sheet>",
        google_sheet_key="<The key of the sheet to read>",
        google_sheet_name="<The name of the sheet to read>",
        first_row_header="<True or False, depending if the first row of the table needs to be considered as the header>",
        on_bad_lines="<What to do if bad lines are discovered while reading the sheet>",
        clean="<True or False, depending if blank columns and rows need to be removed>"
    )

read_sheet_as_dataframe()
```

For more tips on how to use tasks and flows in a Collection, check out [Using Collections](https://orion-docs.prefect.io/collections/usage/)!

## Resources

If you encounter any bugs while using `prefect-google-sheets`, feel free to open an issue in the [prefect-google-sheets](https://github.com/stefanocascavilla/prefect-google-sheets) repository.

If you have any questions or issues while using `prefect-google-sheets`, you can find help in either the [Prefect Discourse forum](https://discourse.prefect.io/) or the [Prefect Slack community](https://prefect.io/slack).

Feel free to ⭐️ or watch [`prefect-google-sheets`](https://github.com/stefanocascavilla/prefect-google-sheets) for updates too!

## Development

If you'd like to install a version of `prefect-google-sheets` for development, clone the repository and perform an editable install with `pip`:

```bash
git clone https://github.com/stefanocascavilla/prefect-google-sheets.git

cd prefect-google-sheets/

pip install -e ".[dev]"

# Install linting pre-commit hooks
pre-commit install
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/stefanocascavilla/prefect-google-sheets",
    "name": "prefect-google-sheets",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "prefect",
    "author": "Stefano Cascavilla",
    "author_email": "cascavilla1@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/93/ea/bf7562746899dda372d179f0a6ef51ac919d32cd53ed70bc529175090550/prefect-google-sheets-0.1.1.tar.gz",
    "platform": null,
    "description": "# prefect-google-sheets\n\n<p align=\"center\">\n    <a href=\"https://pypi.python.org/pypi/prefect-google-sheets/\" alt=\"PyPI version\">\n        <img alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/prefect-google-sheets?color=0052FF&labelColor=090422\"></a>\n    <a href=\"https://github.com/stefanocascavilla/prefect-google-sheets/\" alt=\"Stars\">\n        <img src=\"https://img.shields.io/github/stars/stefanocascavilla/prefect-google-sheets?color=0052FF&labelColor=090422\" /></a>\n    <a href=\"https://pepy.tech/badge/prefect-google-sheets/\" alt=\"Downloads\">\n        <img src=\"https://img.shields.io/pypi/dm/prefect-google-sheets?color=0052FF&labelColor=090422\" /></a>\n    <a href=\"https://github.com/stefanocascavilla/prefect-google-sheets/pulse\" alt=\"Activity\">\n        <img src=\"https://img.shields.io/github/commit-activity/m/stefanocascavilla/prefect-google-sheets?color=0052FF&labelColor=090422\" /></a>\n    <br>\n    <a href=\"https://prefect-community.slack.com\" alt=\"Slack\">\n        <img src=\"https://img.shields.io/badge/slack-join_community-red.svg?color=0052FF&labelColor=090422&logo=slack\" /></a>\n    <a href=\"https://discourse.prefect.io/\" alt=\"Discourse\">\n        <img src=\"https://img.shields.io/badge/discourse-browse_forum-red.svg?color=0052FF&labelColor=090422&logo=discourse\" /></a>\n</p>\n\n## Welcome!\n\nPrefect collection of tasks in order to work with Google Sheets\n\n## Getting Started\n\n### Python setup\n\nRequires an installation of Python 3.7+.\n\nWe recommend using a Python virtual environment manager such as pipenv, conda or virtualenv.\n\nThese tasks are designed to work with Prefect 2.0. For more information about how to use Prefect, please refer to the [Prefect documentation](https://orion-docs.prefect.io/).\n\n### Installation\n\nInstall `prefect-google-sheets` with `pip`:\n\n```bash\npip install prefect-google-sheets\n```\n\nThen, register to [view the block](https://orion-docs.prefect.io/ui/blocks/) on Prefect Cloud:\n\n```bash\nprefect block register -m prefect_google_sheets\n```\n\nNote, to use the `load` method on Blocks, you must already have a block document [saved through code](https://orion-docs.prefect.io/concepts/blocks/#saving-blocks) or [saved through the UI](https://orion-docs.prefect.io/ui/blocks/).\n\n### Write and run a flow\n\n```python\nfrom prefect import flow\nfrom prefect_google_sheets.tasks import (\n    read_google_sheet_as_data_frame,\n    read_google_sheet_as_list_of_lists,\n    read_google_sheet_as_dict_of_lists,\n)\n\n\n@flow\ndef read_sheets():\n    sheet_df = read_google_sheet_as_data_frame(\n        is_public_sheet=\"<True or False, depending if the sheet you are reading is public or not>\",\n        google_service_account=\"<The Google Service Account information in order to access the sheet>\",\n        google_sheet_key=\"<The key of the sheet to read>\",\n        google_sheet_name=\"<The name of the sheet to read>\",\n        first_row_header=\"<True or False, depending if the first row of the table needs to be considered as the header>\",\n        on_bad_lines=\"<What to do if bad lines are discovered while reading the sheet>\",\n        clean=\"<True or False, depending if blank columns and rows need to be removed>\"\n    )\n\n    sheet_list_of_lists = read_google_sheet_as_list_of_lists(\n        is_public_sheet=\"<True or False, depending if the sheet you are reading is public or not>\",\n        google_service_account=\"<The Google Service Account information in order to access the sheet>\",\n        google_sheet_key=\"<The key of the sheet to read>\",\n        google_sheet_name=\"<The name of the sheet to read>\",\n        first_row_header=\"<True or False, depending if the first row of the table needs to be considered as the header>\",\n        on_bad_lines=\"<What to do if bad lines are discovered while reading the sheet>\",\n        clean=\"<True or False, depending if blank columns and rows need to be removed>\"\n    )\n\n    sheet_dict_of_lists = read_google_sheet_as_dict_of_lists(\n        is_public_sheet=\"<True or False, depending if the sheet you are reading is public or not>\",\n        google_service_account=\"<The Google Service Account information in order to access the sheet>\",\n        google_sheet_key=\"<The key of the sheet to read>\",\n        google_sheet_name=\"<The name of the sheet to read>\",\n        first_row_header=\"<True or False, depending if the first row of the table needs to be considered as the header>\",\n        on_bad_lines=\"<What to do if bad lines are discovered while reading the sheet>\",\n        clean=\"<True or False, depending if blank columns and rows need to be removed>\"\n    )\n\nread_sheet_as_dataframe()\n```\n\nFor more tips on how to use tasks and flows in a Collection, check out [Using Collections](https://orion-docs.prefect.io/collections/usage/)!\n\n## Resources\n\nIf you encounter any bugs while using `prefect-google-sheets`, feel free to open an issue in the [prefect-google-sheets](https://github.com/stefanocascavilla/prefect-google-sheets) repository.\n\nIf you have any questions or issues while using `prefect-google-sheets`, you can find help in either the [Prefect Discourse forum](https://discourse.prefect.io/) or the [Prefect Slack community](https://prefect.io/slack).\n\nFeel free to \u2b50\ufe0f or watch [`prefect-google-sheets`](https://github.com/stefanocascavilla/prefect-google-sheets) for updates too!\n\n## Development\n\nIf you'd like to install a version of `prefect-google-sheets` for development, clone the repository and perform an editable install with `pip`:\n\n```bash\ngit clone https://github.com/stefanocascavilla/prefect-google-sheets.git\n\ncd prefect-google-sheets/\n\npip install -e \".[dev]\"\n\n# Install linting pre-commit hooks\npre-commit install\n```\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "Prefect collection of tasks in order to work with Google Sheets",
    "version": "0.1.1",
    "split_keywords": [
        "prefect"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "51c37efa92167809a355edbc9ee47d17",
                "sha256": "24dacc4a5ceacee0c3b6daf31f242a61bd263089b231c22db6a4f02d74228c60"
            },
            "downloads": -1,
            "filename": "prefect_google_sheets-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "51c37efa92167809a355edbc9ee47d17",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 12641,
            "upload_time": "2022-12-20T14:38:50",
            "upload_time_iso_8601": "2022-12-20T14:38:50.305273Z",
            "url": "https://files.pythonhosted.org/packages/cf/db/27e905f41fc4f8d7412ccd2da3112b7d9ea14acd556e1e5513846bcfc47b/prefect_google_sheets-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "a3f441c2f77451a052b7023f5de2358a",
                "sha256": "21af6044c0c0677591e0b7fe1b54ddff62357aadd9ac79e7d1e458da62bd3d72"
            },
            "downloads": -1,
            "filename": "prefect-google-sheets-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "a3f441c2f77451a052b7023f5de2358a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 28187,
            "upload_time": "2022-12-20T14:38:51",
            "upload_time_iso_8601": "2022-12-20T14:38:51.719452Z",
            "url": "https://files.pythonhosted.org/packages/93/ea/bf7562746899dda372d179f0a6ef51ac919d32cd53ed70bc529175090550/prefect-google-sheets-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-20 14:38:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "stefanocascavilla",
    "github_project": "prefect-google-sheets",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "prefect",
            "specs": [
                [
                    ">=",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "pandas",
            "specs": [
                [
                    "~=",
                    "1.3.5"
                ]
            ]
        },
        {
            "name": "gspread-dataframe",
            "specs": [
                [
                    "~=",
                    "3.3.0"
                ]
            ]
        },
        {
            "name": "gspread",
            "specs": [
                [
                    "~=",
                    "5.7.2"
                ]
            ]
        },
        {
            "name": "google-auth",
            "specs": [
                [
                    "~=",
                    "2.15.0"
                ]
            ]
        }
    ],
    "lcname": "prefect-google-sheets"
}
        
Elapsed time: 0.03951s