{ "info": { "author": "mingrammer", "author_email": "mingrammer@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development :: Libraries", "Topic :: Utilities" ], "description": "\n# Sheet2db\n\nSheet2db is a tiny python library for one-way syncing the Google spreadsheet to database. (Currently, it supports only MySQL)\n\nIt is useful for managing some static data on Google spreadsheet, but also want to sync the sheet data to database.\n\n***Sheet2db DOES NOT collect any your secret values!***\n\n# Installation\n\n```\npip install sheet2db\n```\n\n# Usage\n\n> You must have API key which is accessible to Google Spreadsheet API\n\nExample sheet format (**items** tab):\n\n````\n===========================\n| A | B | C | D |\n===========================\n| id | name | count | ver |\n|----|------|-------|-----|\n| .. | .... | ..... | ... |\n===========================\n````\n\nFollowing example will sync **items** tab of **1U3un2ZJPRhLrWzc2DMXq8VI7Nqf9pYlajfO4mQVCZpE** spreadsheet to database:\n\n> \"AIzaSyC6pabjqmaPiguYoHbq4W7a0DV0wQg5JGk\" is a fake api key\n\n```python\nfrom sheet2db import Sheet2db\n\n# Pass API key\nsyncer = Sheet2db(api_key='AIzaSyC6pabjqmaPiguYoHbq4W7a0DV0wQg5JGk')\n\n# If you need to access to private spreadsheet, you can't use API key. Use oauth credentials instead.\nsyncer = Sheet2db(\n creds_path='credentials.json',\n token_path='token.json')\n\n# Fetch data from spreadsheet\nsyncer.fetch(\n sheet='1U3un2ZJPRhLrWzc2DMXq8VI7Nqf9pYlajfO4mQVCZpE',\n tab='items',\n range='A1:D')\n\n# Sync fetched data to database (mysql)\nsyncer.sync(\n host='192.168.168.10',\n port=3306,\n user='mingrammer',\n password='p@ssw0rd',\n db='static',\n table='items')\n```\n\nYou can also use ssh tunneling to access to remote database with **sshtunnel**\n\n```python\nwith sshtunnel.SSHTunnelForwarder(\n ('db.service.io', 22),\n ssh_username='ssh_user'\n ssh_pkey='~/.ssh/id_rsa'\n ssh_private_key_password='ssh_pk_password',\n remote_bind_address=('localhost', 3306),\n) as tunnel:\n syncer.sync(\n host = tunnel.local_bind_host,\n port = tunnel.local_bind_host,\n user = 'mingrammer',\n password = 'p@ssw0rd',\n db = 'static',\n table = 'items')\n```\n\n# License\n\nMIT\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mingrammer/sheet2db", "keywords": "spreadsheet sync", "license": "", "maintainer": "", "maintainer_email": "", "name": "sheet2db", "package_url": "https://pypi.org/project/sheet2db/", "platform": "", "project_url": "https://pypi.org/project/sheet2db/", "project_urls": { "Homepage": "https://github.com/mingrammer/sheet2db" }, "release_url": "https://pypi.org/project/sheet2db/1.0.0/", "requires_dist": [ "asn1crypto (==0.24.0)", "cachetools (==2.1.0)", "cffi (==1.11.5)", "cryptography (==2.3)", "google-api-python-client (==1.7.4)", "google-auth-httplib2 (==0.0.3)", "google-auth (==1.5.1)", "httplib2 (==0.11.3)", "idna (==2.7)", "oauth2client (==4.1.2)", "pyasn1-modules (==0.2.2)", "pyasn1 (==0.4.4)", "pycparser (==2.18)", "pymysql (==0.9.2)", "rsa (==3.4.2)", "six (==1.11.0)", "uritemplate (==3.0.0)" ], "requires_python": ">=3", "summary": "A tiny library for one-way syncing the Google spreadsheet to database", "version": "1.0.0" }, "last_serial": 4148993, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "09c2597776a7daf31e796cd0b4117436", "sha256": "3afa32698f651e8dae5459757ea0c58d9689d7ff94267f527aade0caf29ace7e" }, "downloads": -1, "filename": "sheet2db-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "09c2597776a7daf31e796cd0b4117436", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3", "size": 3725, "upload_time": "2018-08-08T13:28:14", "url": "https://files.pythonhosted.org/packages/99/77/19beeb17953bea1644483ce84125596caa5c56cda171eb45811af67d0228/sheet2db-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "68afaee980131ebfd3ddad40f67193e1", "sha256": "d8edaf224c3adfa72c15d5849a635b67e11ca08b697c1c5ccbd5fee751fa8b91" }, "downloads": -1, "filename": "sheet2db-1.0.0.tar.gz", "has_sig": false, "md5_digest": "68afaee980131ebfd3ddad40f67193e1", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 4246, "upload_time": "2018-08-08T13:28:16", "url": "https://files.pythonhosted.org/packages/e5/40/5b9f272c06a6dcc372f421382401c4e51384dead9c9470b72b92de338ac1/sheet2db-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "09c2597776a7daf31e796cd0b4117436", "sha256": "3afa32698f651e8dae5459757ea0c58d9689d7ff94267f527aade0caf29ace7e" }, "downloads": -1, "filename": "sheet2db-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "09c2597776a7daf31e796cd0b4117436", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3", "size": 3725, "upload_time": "2018-08-08T13:28:14", "url": "https://files.pythonhosted.org/packages/99/77/19beeb17953bea1644483ce84125596caa5c56cda171eb45811af67d0228/sheet2db-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "68afaee980131ebfd3ddad40f67193e1", "sha256": "d8edaf224c3adfa72c15d5849a635b67e11ca08b697c1c5ccbd5fee751fa8b91" }, "downloads": -1, "filename": "sheet2db-1.0.0.tar.gz", "has_sig": false, "md5_digest": "68afaee980131ebfd3ddad40f67193e1", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 4246, "upload_time": "2018-08-08T13:28:16", "url": "https://files.pythonhosted.org/packages/e5/40/5b9f272c06a6dcc372f421382401c4e51384dead9c9470b72b92de338ac1/sheet2db-1.0.0.tar.gz" } ] }