{ "info": { "author": "Robin Thomas", "author_email": "rthomas900@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Office/Business :: Financial :: Spreadsheet", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "gspread-formatting\n------------------\n\n.. image:: https://badge.fury.io/py/gspread-formatting.svg\n :target: https://badge.fury.io/py/gspread-formatting\n\nThis package provides complete support of basic cell formatting for Google spreadsheets\nto the popular ``gspread`` package, along with a few related features such as setting\n\"frozen\" rows and columns in a worksheet.\n\nThe package also offers graceful formatting of Google spreadsheets using a Pandas DataFrame.\nSee the section below for usage and details.\n\nUsage\n~~~~~\n\nBasic formatting of a range of cells in a worksheet is offered by the ``format_cell_range`` function. \nAll basic formatting components of the v4 Sheets API's ``CellFormat`` are present as classes \nin the ``gspread_formatting`` module, available both by ``InitialCaps`` names and ``camelCase`` names: \nfor example, the background color class is ``BackgroundColor`` but is also available as \n``backgroundColor``, while the color class is ``Color`` but available also as ``color``. \nAttributes of formatting components are best specified as keyword arguments using ``camelCase`` \nnaming, e.g. ``backgroundColor=...``. Complex formats may be composed easily, by nesting the calls to the classes. \n\nSee `the CellFormat page of the Sheets API documentation `_\nto learn more about each formatting component.::\n\n from gspread_formatting import *\n\n fmt = cellFormat(\n backgroundColor=color(1, 0.9, 0.9),\n textFormat=textFormat(bold=True, foregroundColor=color(1, 0, 1)),\n horizontalAlignment='CENTER'\n )\n\n format_cell_range(worksheet, 'A1:J1', fmt)\n\nThe ``format_cell_ranges`` function allows for formatting multiple ranges with corresponding formats,\nall in one function call and Sheets API operation::\n\n fmt = cellFormat(\n backgroundColor=color(1, 0.9, 0.9),\n textFormat=textFormat(bold=True, foregroundColor=color(1, 0, 1)),\n horizontalAlignment='CENTER'\n )\n\n fmt2 = cellFormat(\n backgroundColor=color(0.9, 0.9, 0.9),\n horizontalAlignment='RIGHT'\n )\n\n format_cell_ranges(worksheet, [('A1:J1', fmt), ('K1:K200', fmt2)])\n\nRetrieving, Comparing, and Composing CellFormats\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nA Google spreadsheet's own default format, as a CellFormat object, is available via ``get_default_format(spreadsheet)``.\n``get_effective_format(worksheet, label)`` and ``get_user_entered_format(worksheet, label)`` also will return\nfor any provided cell label either a CellFormat object (if any formatting is present) or None.\n\n``CellFormat`` objects are comparable with ``==`` and ``!=``, and are mutable at all times; \nthey can be safely copied with Python's ``copy.deepcopy`` function. ``CellFormat`` objects can be combined\ninto a new ``CellFormat`` object using the ``add`` method (or ``+`` operator). ``CellFormat`` objects also offer \n``difference`` and ``intersection`` methods, as well as the corresponding\noperators ``-`` (for difference) and ``&`` (for intersection).::\n\n >>> default_format = CellFormat(backgroundColor=color(1,1,1), textFormat=textFormat(bold=True))\n >>> user_format = CellFormat(textFormat=textFormat(italic=True))\n >>> effective_format = default_format + user_format\n >>> effective_format\n CellFormat(backgroundColor=color(1,1,1), textFormat=textFormat(bold=True, italic=True))\n >>> effective_format - user_format \n CellFormat(backgroundColor=color(1,1,1), textFormat=textFormat(bold=True))\n >>> effective_format - user_format == default_format\n True\n\nFrozen Rows and Columns\n~~~~~~~~~~~~~~~~~~~~~~~\n\nThe following functions get or set \"frozen\" row or column counts for a worksheet::\n\n get_frozen_row_count(worksheet)\n get_frozen_column_count(worksheet)\n set_frozen(worksheet, rows=1)\n set_frozen(worksheet, cols=1)\n set_frozen(worksheet, rows=1, cols=0)\n\nFormatting a Worksheet Using a Pandas DataFrame\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nIf you are using Pandas DataFrames to provide data to a Google spreadsheet -- using perhaps\nthe ``gspread-dataframe`` package `available on PyPI `_ --\nthe ``format_with_dataframe`` function in ``gspread_formatting.dataframe`` allows you to use that same \nDataFrame object and specify formatting for a worksheet. There is a ``DEFAULT_FORMATTER`` in the module,\nwhich will be used if no formatter object is provided to ``format_with_dataframe``::\n\n from gspread_formatting.dataframe import format_with_dataframe, BasicFormatter\n from gspread_formatting import Color\n\n # uses DEFAULT_FORMATTER\n format_with_dataframe(worksheet, dataframe, include_index=True, include_column_header=True)\n\n formatter = BasicFormatter(\n header_background_color=Color(0,0,0), \n header_text_color=Color(1,1,1),\n decimal_format='#,##0.00'\n )\n\n format_with_dataframe(worksheet, dataframe, formatter, include_index=False, include_column_header=True)\n\nInstallation\n------------\n\nRequirements\n~~~~~~~~~~~~\n\n* Python 2.6+ or Python 3+\n* gspread >= 3.0.0\n\nFrom PyPI\n~~~~~~~~~\n\n::\n\n pip install gspread-formatting\n\nFrom GitHub\n~~~~~~~~~~~\n\n::\n\n git clone https://github.com/robin900/gspread-formatting.git\n cd gspread-formatting\n python setup.py install\n\nDevelopment and Testing\n-----------------------\n\nInstall packages listed in ``requirements-dev.txt``. To run the test suite\nin ``test.py`` you will need to:\n\n* Authorize as the Google account you wish to use as a test, and download\n a JSON file containing the credentials. Name the file ``creds.json``\n and locate it in the top-level folder of the repository.\n* Set up a ``tests.config`` file using the ``tests.config.example`` file as a template.\n Specify the ID of a spreadsheet that the Google account you are using\n can access with write privileges.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/robin900/gspread-formatting", "keywords": "spreadsheets,google-spreadsheets,formatting,cell-format", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "gspread-formatting", "package_url": "https://pypi.org/project/gspread-formatting/", "platform": "", "project_url": "https://pypi.org/project/gspread-formatting/", "project_urls": { "Homepage": "https://github.com/robin900/gspread-formatting" }, "release_url": "https://pypi.org/project/gspread-formatting/0.0.7/", "requires_dist": [ "gspread (>=3.0.0)" ], "requires_python": "", "summary": "Apply cell formatting to gspread worksheets", "version": "0.0.7" }, "last_serial": 5704000, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "3e488df502459749a923589379b4c3c6", "sha256": "418fd63ed96a6f69d74753018e8e1a18aef6dcaf3f9c80f09b8afc2e02c01059" }, "downloads": -1, "filename": "gspread_formatting-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "3e488df502459749a923589379b4c3c6", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 7073, "upload_time": "2018-07-20T14:39:36", "url": "https://files.pythonhosted.org/packages/29/57/eaaab16b0571d03a630f83e9926268e938b42bb2d921e6ef6a82f33b85b8/gspread_formatting-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e8358cc08d815302aeba2ee0e203ed04", "sha256": "9b7b3e3faf609f0bd68012a40c9aa36844d822410661f2dfef8b05b4f4f4263e" }, "downloads": -1, "filename": "gspread-formatting-0.0.1.tar.gz", "has_sig": false, "md5_digest": "e8358cc08d815302aeba2ee0e203ed04", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6091, "upload_time": "2018-07-20T14:39:35", "url": "https://files.pythonhosted.org/packages/d8/9b/45442cc53a3e971589a16ef5f9d682f1af51bb8836dbbb71686c0dc6a1d4/gspread-formatting-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "5db252795fb382c2c6b4994a2b4efe5d", "sha256": "c9e948623e6a91eaea26096ca1ebf8263a7723a7cd476c7670c4c58615132261" }, "downloads": -1, "filename": "gspread_formatting-0.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5db252795fb382c2c6b4994a2b4efe5d", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 7464, "upload_time": "2018-07-23T18:17:11", "url": "https://files.pythonhosted.org/packages/30/06/4e76a37c5a1e59f1d106312c6b841d8e39d90ea91344f39b793fb371ee8b/gspread_formatting-0.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f741f9a160a7ba5e61c8fbaa857ab39c", "sha256": "2e7001c438b0bf36f469104a3d1ecee68f322bdbdbcb3006f3b8d884aa4b7f76" }, "downloads": -1, "filename": "gspread-formatting-0.0.2.tar.gz", "has_sig": false, "md5_digest": "f741f9a160a7ba5e61c8fbaa857ab39c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6541, "upload_time": "2018-07-23T18:17:09", "url": "https://files.pythonhosted.org/packages/7f/ee/1495b86934b2f44a0d8c754a4437f77c7ce9a95edfc333ef50dc01a80eb8/gspread-formatting-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "f03cf883a8e336d61160f9da1c6f3ffb", "sha256": "fd060d06282402059f9f3a08247362ea831886db507d6198674fee15abe43735" }, "downloads": -1, "filename": "gspread_formatting-0.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f03cf883a8e336d61160f9da1c6f3ffb", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 10190, "upload_time": "2018-08-24T13:54:13", "url": "https://files.pythonhosted.org/packages/be/df/0d49b776d2bf9069f1441eebb6252aed8762d72524ae98252130f181e754/gspread_formatting-0.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b98525db36a8e6de60cc88fa2a71c6e0", "sha256": "8883fdd70fe7bbbe97f3f50eec63a68abba91b4bbe75a22d8547e618c33b028b" }, "downloads": -1, "filename": "gspread-formatting-0.0.3.tar.gz", "has_sig": false, "md5_digest": "b98525db36a8e6de60cc88fa2a71c6e0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6873, "upload_time": "2018-08-24T13:54:12", "url": "https://files.pythonhosted.org/packages/4d/2d/82084d7ebac7575b5086223f9af0ac80c5300e832948f2d2ff2c2d63f11b/gspread-formatting-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "6a5a693c805ffcbc80da70ae914e2b70", "sha256": "90069d321d1e8b1ca4b325cfaa3028167df192b1391634d42796ca26ba956d9f" }, "downloads": -1, "filename": "gspread_formatting-0.0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6a5a693c805ffcbc80da70ae914e2b70", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 11603, "upload_time": "2019-03-26T14:00:18", "url": "https://files.pythonhosted.org/packages/c5/aa/3e9de77985a55137543ca4fab14a5e16a847ef48041213e89f1c994fdbaa/gspread_formatting-0.0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "89431761c7b19385cf7b54e00e877783", "sha256": "973ccc4e2437b2e82bfbe1f823690c408b14228a6a32e4f3359cc0cdec62ebe1" }, "downloads": -1, "filename": "gspread-formatting-0.0.4.tar.gz", "has_sig": false, "md5_digest": "89431761c7b19385cf7b54e00e877783", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4091, "upload_time": "2019-03-26T14:00:19", "url": "https://files.pythonhosted.org/packages/fa/41/13fc1f2d4018bbc576a2e76d50fee84ed1d6c34b341ced6619b8ba5061d0/gspread-formatting-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "ce83b40b7c743dc46ba982be748813a1", "sha256": "cf205e193696e1c7d05dc9f8e5174279a40116dba540f65e1c72f33267a8618e" }, "downloads": -1, "filename": "gspread_formatting-0.0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ce83b40b7c743dc46ba982be748813a1", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 11603, "upload_time": "2019-04-30T13:50:42", "url": "https://files.pythonhosted.org/packages/77/3c/b25a02573f6ab57fbe20264fd0be15f835f733c881b1376eb59da8e59382/gspread_formatting-0.0.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "708eb34575036d175c22731fe1198c2a", "sha256": "4c5b8fb707ad117b253ba4fdce89aa63f77ca92737e3f41f5782379cd40d8977" }, "downloads": -1, "filename": "gspread-formatting-0.0.5.tar.gz", "has_sig": false, "md5_digest": "708eb34575036d175c22731fe1198c2a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4098, "upload_time": "2019-04-30T13:50:40", "url": "https://files.pythonhosted.org/packages/74/95/1ae2556f7b4460edc849b6838fe2363272d30d6a81bb2b386918eceaf630/gspread-formatting-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "340b64bf7645bb93f24fa36416acd896", "sha256": "398ec316e91c4f2125765972df837214f5e1649d0736ff7e971eb17d4d87d1a6" }, "downloads": -1, "filename": "gspread_formatting-0.0.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "340b64bf7645bb93f24fa36416acd896", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 11602, "upload_time": "2019-04-30T14:25:48", "url": "https://files.pythonhosted.org/packages/ca/47/5c25ab77cd3b4c7fe1abe29ffe1c29f47521e2a1a5286fe9349be1aba28b/gspread_formatting-0.0.6-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "54824b9f08db3076f409f94dc711041e", "sha256": "f29f348cc3be6d3f613ac7664cf4b6eb4c41759906684bed41e53ac54f7b712a" }, "downloads": -1, "filename": "gspread-formatting-0.0.6.tar.gz", "has_sig": false, "md5_digest": "54824b9f08db3076f409f94dc711041e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4096, "upload_time": "2019-04-30T14:25:46", "url": "https://files.pythonhosted.org/packages/21/2d/e83202da8c3cb9d4474eb2b2b54d51037b3795cbaa28cc0a0148ddd14d66/gspread-formatting-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "a4f3fcbe2de91d0c52f06bb4839fd790", "sha256": "8e62254ef630b64f55ffd12ff0659355d61fca3197c4396126b5a056364e16cd" }, "downloads": -1, "filename": "gspread_formatting-0.0.7-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a4f3fcbe2de91d0c52f06bb4839fd790", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11720, "upload_time": "2019-08-20T15:28:41", "url": "https://files.pythonhosted.org/packages/a0/c0/eeda413d0ca4355227705d59126075abd127aec2b5e85b16e0b03f56616f/gspread_formatting-0.0.7-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7efa368ee976a020099af2a620647f6f", "sha256": "92122165af5e4d3b75140fd9afa43a13472635d757a291ffc6ee451211eab500" }, "downloads": -1, "filename": "gspread-formatting-0.0.7.tar.gz", "has_sig": false, "md5_digest": "7efa368ee976a020099af2a620647f6f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13230, "upload_time": "2019-08-20T15:28:42", "url": "https://files.pythonhosted.org/packages/d0/c6/2da11a48d3cc554b526d954ac7c17116a852cd61c14b5fe30c84f30b1895/gspread-formatting-0.0.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a4f3fcbe2de91d0c52f06bb4839fd790", "sha256": "8e62254ef630b64f55ffd12ff0659355d61fca3197c4396126b5a056364e16cd" }, "downloads": -1, "filename": "gspread_formatting-0.0.7-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a4f3fcbe2de91d0c52f06bb4839fd790", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11720, "upload_time": "2019-08-20T15:28:41", "url": "https://files.pythonhosted.org/packages/a0/c0/eeda413d0ca4355227705d59126075abd127aec2b5e85b16e0b03f56616f/gspread_formatting-0.0.7-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7efa368ee976a020099af2a620647f6f", "sha256": "92122165af5e4d3b75140fd9afa43a13472635d757a291ffc6ee451211eab500" }, "downloads": -1, "filename": "gspread-formatting-0.0.7.tar.gz", "has_sig": false, "md5_digest": "7efa368ee976a020099af2a620647f6f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13230, "upload_time": "2019-08-20T15:28:42", "url": "https://files.pythonhosted.org/packages/d0/c6/2da11a48d3cc554b526d954ac7c17116a852cd61c14b5fe30c84f30b1895/gspread-formatting-0.0.7.tar.gz" } ] }