{ "info": { "author": "RJH", "author_email": "rjh.python@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Office/Business", "Topic :: Office/Business :: Office Suites", "Topic :: Text Processing" ], "description": "What is this?\n-------------\nDon't be sad, turn that messy spreadsheet into actual data! This is for people new to programming who need to do stuff with typical messy spreadsheet data.\n\nIt's also for anyone who could use quick clean access to the kind of spreadsheet data passed around in offices.\n\nIt's not for data scientists and huge data sets (fortunately there's plenty of support for that elsewhere).\n\nHow to install\n--------------\n::\n\n pip3 install sad\n\nHow to access the spreadsheet\n-----------------------------\nThese examples assume a simple spreadsheet file called ``hr.csv`` that contains these values:\n\n::\n\n Full Name Employee ID Start Date\n Sue Storm 1000 1/1/18\n Kitty Pride 1001 2/5/18\n\nUse this ``import`` statement:\n\n::\n\n from sad import Spreadsheet\n\nThe spreadsheet data needs to be in CSV format. Open the file and pass the file object to ``Spreadsheet.from_csv()``:\n\n::\n\n hr_csv = open('hr.csv')\n sheet = Spreadsheet.from_csv(hr_csv)\n\nAccessing cells by index\n------------------------\nThe ``Spreadsheet`` can be treated as a 2-dimensional array, so if you want the value of the second cell down and third cell over, you can do this:\n\n::\n\n value = sheet[1][2]\n print(value)\n\nThis prints:\n\n::\n\n 1/1/18\n\nAccessing cells by header name\n------------------------------\nIf you use a header name to get to a cell, the first row of the spreadsheet is assumed to be the headers. To get the same cell as above, you can do this:\n\n::\n\n value = sheet[1]['Start Date']\n print(value)\n\nThis also prints:\n\n::\n\n 1/1/18\n\nYou may find it more intuitive to get the row first, like so:\n\n::\n\n employee = sheet[1]\n print(employee['Start Date']\n\nEven better, you can use header names for both the row and column:\n\n::\n\n print(sheet['Sue Storm']['Start Date'])\n\nLooping over rows\n-----------------\nIt's easy to loop over rows:\n\n::\n\n for row in sheet:\n print(row)\n\nThis prints:\n\n::\n\n First Name, Last name, start date\n Sue, Storm, 1/1/18\n Kitty, Pride, 2/5/18\n\nTo print every cell in the spreadsheet:\n\n::\n\n for row in sheet:\n for cell in row:\n print(cell)\n\nThis prints:\n\n::\n\n Full Name\n Employee ID\n Start Date\n Sue\n Storm\n 1/1/18\n Kitty\n Pride\n 2/5/18\n\nLooping over columns\n--------------------\nYou can also loop over columns:\n\n::\n\n for col in sheet.columns:\n print(col)\n print('----')\n\nThis prints:\n\n::\n\n Full Name\n Sue Storm\n Kitty Pride\n ----\n Employee ID\n 1000\n 1001\n ----\n Start Date\n 1/1/18\n 2/5/18\n\nWhat's next?\n------------\nThis first release provides some nice intuitive ways to access spreadsheet data.\n\nFuture releases will add support for dealing with typical problems in spreadsheets that were created for humans to read rather than for computers to process.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/rjh-python/sad", "keywords": "spreadsheet csv excel numbers", "license": "", "maintainer": "", "maintainer_email": "", "name": "sad", "package_url": "https://pypi.org/project/sad/", "platform": "", "project_url": "https://pypi.org/project/sad/", "project_urls": { "Homepage": "https://github.com/rjh-python/sad" }, "release_url": "https://pypi.org/project/sad/1.0.0/", "requires_dist": null, "requires_python": ">=3", "summary": "Spreadsheets as data: spreadsheet handling for humans", "version": "1.0.0" }, "last_serial": 3597228, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "d57000ee9814df1021dafa1c7f670fb8", "sha256": "95e68321586726896188c7e0e144ab77b712163e0a59ac1a24c93550dc03c71b" }, "downloads": -1, "filename": "sad-1.0.0.tar.gz", "has_sig": false, "md5_digest": "d57000ee9814df1021dafa1c7f670fb8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 6738, "upload_time": "2018-02-19T21:56:32", "url": "https://files.pythonhosted.org/packages/6c/92/3d6d1485f4dbbe52f4fb88881f6a5a37067e566857db72b0015ac3a2bddd/sad-1.0.0.tar.gz" } ], "1.0.0rc1": [ { "comment_text": "", "digests": { "md5": "72c2f3aaafbfcde1b9372ffa55624ca5", "sha256": "09cdc63f63ecb5afc585448d369d14b24ab3e2f06dac1e558b786f2cd84a1c5f" }, "downloads": -1, "filename": "sad-1.0.0rc1.tar.gz", "has_sig": false, "md5_digest": "72c2f3aaafbfcde1b9372ffa55624ca5", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 4642, "upload_time": "2018-02-19T19:36:59", "url": "https://files.pythonhosted.org/packages/1c/ab/a9c5eee7031e0239e3f3b84f7b5c79b0cb470fd0b699a9c1bebee959db2f/sad-1.0.0rc1.tar.gz" } ], "1.0.0rc2": [ { "comment_text": "", "digests": { "md5": "5a0eaa9b27f2a59efff61e1135a2c775", "sha256": "da95dc5219fa0afe95f159e3c8d16b943953a9fc8a2664fb566f16d13b7a2f27" }, "downloads": -1, "filename": "sad-1.0.0rc2.tar.gz", "has_sig": false, "md5_digest": "5a0eaa9b27f2a59efff61e1135a2c775", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 6457, "upload_time": "2018-02-19T20:40:31", "url": "https://files.pythonhosted.org/packages/87/c0/42e5b51de885fec2191e8950fa3047b0f8511796e01b2cfa6b98dd0306fd/sad-1.0.0rc2.tar.gz" } ], "1.0.0rc3": [ { "comment_text": "", "digests": { "md5": "34c1c6c574011a8ab009432efee3cabe", "sha256": "de222ccaac1f45a00280327e91b64435d32e15dfd71fe4f64f49ac20683ab46b" }, "downloads": -1, "filename": "sad-1.0.0rc3.tar.gz", "has_sig": false, "md5_digest": "34c1c6c574011a8ab009432efee3cabe", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 6493, "upload_time": "2018-02-19T21:05:11", "url": "https://files.pythonhosted.org/packages/0b/4a/1ba15cc3b9fca3e7e42af04b8a8d0fce3d7f89d1f8a25ca63d3e7482ca0a/sad-1.0.0rc3.tar.gz" } ], "1.0.0rc4": [ { "comment_text": "", "digests": { "md5": "442314729aa86a617f2cd70b89612626", "sha256": "233a98c61eff8fb9dd01b0353034336ffd72d6e768b76fe743bc8f7ca8bf32ac" }, "downloads": -1, "filename": "sad-1.0.0rc4.tar.gz", "has_sig": false, "md5_digest": "442314729aa86a617f2cd70b89612626", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 6503, "upload_time": "2018-02-19T21:37:55", "url": "https://files.pythonhosted.org/packages/ec/38/a8f83abfba6120656cfe4ee22188824318728a61c8bdf1da19a8e04424be/sad-1.0.0rc4.tar.gz" } ], "1.0.0rc5": [ { "comment_text": "", "digests": { "md5": "0cc5bae5ee4a8620a08b774c7f9346aa", "sha256": "ee6c2c159e36509483b56b4b49ac8986f9b22f534ec1d9ea4b8610713554b5f8" }, "downloads": -1, "filename": "sad-1.0.0rc5.tar.gz", "has_sig": false, "md5_digest": "0cc5bae5ee4a8620a08b774c7f9346aa", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 6756, "upload_time": "2018-02-19T21:54:17", "url": "https://files.pythonhosted.org/packages/fd/64/bb295cad7a576a69fb74d556b9b158b195737b0027039d9312d920ed8d0a/sad-1.0.0rc5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d57000ee9814df1021dafa1c7f670fb8", "sha256": "95e68321586726896188c7e0e144ab77b712163e0a59ac1a24c93550dc03c71b" }, "downloads": -1, "filename": "sad-1.0.0.tar.gz", "has_sig": false, "md5_digest": "d57000ee9814df1021dafa1c7f670fb8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 6738, "upload_time": "2018-02-19T21:56:32", "url": "https://files.pythonhosted.org/packages/6c/92/3d6d1485f4dbbe52f4fb88881f6a5a37067e566857db72b0015ac3a2bddd/sad-1.0.0.tar.gz" } ] }