{ "info": { "author": "Mark Brenig-Jones", "author_email": "markbrenigjones@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7" ], "description": "SheetSync\n=========\n\n|Build Status|\n\nA python library to create, update and delete rows of data in a google spreadsheet. `Click here to read the full documentation `_.\n\nInstallation\n------------\nInstall from PyPi using `pip `_::\n\n pip install sheetsync\n\nOr you can clone the git repo and install from the code::\n\n git clone git@github.com:mbrenig/sheetsync.git LocalSheetSync\n pip install LocalSheetSync\n\nNote, you may need to run the commands above with ``sudo``.\n\nSetting up OAuth 2.0 access\n---------------------------\nThe Google Drive API now requires the use of OAuth2.0. This means you will need\nto go through a bit of configuration to get an API Client ID and Client Secret\nbefore using sheetsync.\n\nRead the step-by-step `getting started guide `_ for instructions.\n\nInjecting data to a Google sheet\n--------------------------------\nSheetSync works with data in a dictionary of dictionaries. Each row is\nrepresented by a dictionary, and these are themselves stored in a dictionary\nindexed by a row-specific key. For example this dictionary represents two rows\nof data each with columns \"Color\" and \"Performer\":\n\n.. code-block:: python\n\n data = { \"Kermit\": {\"Color\" : \"Green\", \"Performer\" : \"Jim Henson\"},\n \"Miss Piggy\" : {\"Color\" : \"Pink\", \"Performer\" : \"Frank Oz\"}\n }\n\nTo insert this data (add or update rows) into a target\nworksheet in a google spreadsheet doc use this code:\n\n.. code-block:: python\n\n import logging\n from sheetsync import Sheet, ia_credentials_helper\n # Turn on logging so you can see what sheetsync is doing.\n logging.getLogger('sheetsync').setLevel(logging.DEBUG)\n logging.basicConfig()\n\n # Create OAuth2 credentials, or reload them from a local cache file.\n CLIENT_ID = '171566521677-3ppd15g5u4lv93van0eri4tbk4fmaq2c.apps.googleusercontent.com'\n CLIENT_SECRET = 'QJN*****************hk-i'\n creds = ia_credentials_helper(CLIENT_ID, CLIENT_SECRET, \n credentials_cache_file='cred_cache.json')\n\n data = { \"Kermit\": {\"Color\" : \"Green\", \"Performer\" : \"Jim Henson\"},\n \"Miss Piggy\" : {\"Color\" : \"Pink\", \"Performer\" : \"Frank Oz\"} }\n\n # Find or create a spreadsheet, then inject data.\n target = Sheet(credentials=creds, document_name=\"sheetsync Getting Started\")\n target.inject(data)\n print \"Spreadsheet created here: %s\" % target.document_href\n\nThe first part of this script imports the ``Sheet`` object and\n``ia_credentials_helper`` function. This function is included to help you quickly\ngenerate an `OAuth2Credentials `_ object using your Client ID and Secret.\n\nThe second part creates a new spreadsheet document in your google drive and then inserts the data like so:\n\n.. image:: https://raw.githubusercontent.com/mbrenig/SheetSync/master/docs/Sheet1.png\n\nLater on you'll probably want to access this data, to do that note the\nspreadsheet's document key from the URL:\n\n.. image:: https://raw.githubusercontent.com/mbrenig/SheetSync/master/docs/URL.png\n\nand access the data as follows:\n\n.. code-block:: python\n\n source = Sheet(credentials=creds,\n document_key=\"1bnieREGAyXZ2TnhXgYrIacCIY09Q2lfGXNZbjsvJ82M\",\n worksheet_name='Sheet1')\n print source.data()\n\nThe 'inject' method only adds or updates rows. If you want to delete rows from the spreadsheet to keep it in sync with the input data then use the 'sync' method.\n\nFull documentation\n------------------\nIs available `here `_.\n\nTesting and development\n-----------------------\nSheetSync comes with tox tests. To run them, you'll need to copy the .secret\nfile to .mysecrets and fill in your own Client ID, Secret and Testdoc folder\nkey. Then run with the following two commands::\n\n . .mysecrets\n tox\n\nThe license is MIT so feel free to edit, improve. Cheers.\n\n.. |Build Status| image:: https://travis-ci.org/mbrenig/SheetSync.svg?branch=master\n :target: https://travis-ci.org/mbrenig/SheetSync", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mbrenig/SheetSync/", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "sheetsync", "package_url": "https://pypi.org/project/sheetsync/", "platform": "any", "project_url": "https://pypi.org/project/sheetsync/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/mbrenig/SheetSync/" }, "release_url": "https://pypi.org/project/sheetsync/0.2.2/", "requires_dist": null, "requires_python": null, "summary": "Synchronize rows of data with a google spreadsheet", "version": "0.2.2" }, "last_serial": 1709419, "releases": { "0.2.2": [ { "comment_text": "", "digests": { "md5": "49d2aec3e94ce5ea5a2d2e6112f7b3bc", "sha256": "7e6aa8d6370e60b6c2aece60833371b68a60d201ef815e17df7d7de28d156d02" }, "downloads": -1, "filename": "sheetsync-0.2.2.tar.gz", "has_sig": false, "md5_digest": "49d2aec3e94ce5ea5a2d2e6112f7b3bc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21889, "upload_time": "2015-09-05T16:46:26", "url": "https://files.pythonhosted.org/packages/00/ab/d3040b818f04e8d986128d1126d24f109e5c809ccdba8e370858850fd79e/sheetsync-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "49d2aec3e94ce5ea5a2d2e6112f7b3bc", "sha256": "7e6aa8d6370e60b6c2aece60833371b68a60d201ef815e17df7d7de28d156d02" }, "downloads": -1, "filename": "sheetsync-0.2.2.tar.gz", "has_sig": false, "md5_digest": "49d2aec3e94ce5ea5a2d2e6112f7b3bc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21889, "upload_time": "2015-09-05T16:46:26", "url": "https://files.pythonhosted.org/packages/00/ab/d3040b818f04e8d986128d1126d24f109e5c809ccdba8e370858850fd79e/sheetsync-0.2.2.tar.gz" } ] }