{ "info": { "author": "Florent Aide", "author_email": "florent.aide@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Office/Business :: Financial :: Spreadsheet", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Introduction\n============\n\n`any2xl`_ is a helper module to ease producing XLS(X) files from different\nsources. It uses `openpyxl`_ by Eric Gazoni to produce the actual XLS file.\nIt provides primitives and helpers alongside with `any2`_ that help produce\nXLS(X)\nfiles from diverse sources.\n\nLicence\n=======\n\nThis package is covered by the permissive BSD licence.\n\nPython versions\n===============\n\nany2xl works on python 2.7 and python 3.4\n\nExample Usage\n=============\n\n::\n\n from datetime import datetime as dt\n from decimal import Decimal\n from any2xl import List2xl\n\n target_filename = \"out.xls\"\n\n data = [\n (dt.now(), Decimal(\"15.3\"), u'No\u00ebl'),\n (dt.now(), Decimal(\"10.3\"), u'Pentec\u00f4te'),\n (dt.now(), Decimal(\"100.02\"), u'J\u00e9r\u00f4me'),\n (dt.now(), Decimal(\"0.03\"), u'Some unaccented data'),\n ]\n\n colnames = [\"Time\", \"Amount\", \"Description\"]\n\n # we want column names as the first line of our XLS file\n # so we give the names to the constructor\n xl = List2xl(target_filename, colnames=colnames)\n\n # and we ask the write method to write the names\n xl.write(data, write_names=True)\n\n # serialize to disk\n xl.finalize()\n\nIn this example we only act as a really thin wrapper over the openpyxl\nlibrary and if you only need this kind of functionality you may be better off\nusing directly openpyxl...\n\nThe purpose of any2xl and were it is really interesting is when you have more\ncomplex datastructures::\n\n from decimal import Decimal\n import datetime\n\n from any2xl import List2xl\n from any2 import Obj2List\n from any2 import NameTransformer\n\n quantizer = Decimal('0.01')\n\n\n class SubObj(object):\n def __init__(self, v):\n self.amount = Decimal('42.4242424242')\n self.start_date = datetime.date(year=2001, month=2, day=3)\n self.description = \"%s_%s\" % (\"Task\", v)\n\n\n class MyObj(object):\n def __init__(self, v, urgent):\n self.description = v\n self.urgent = urgent\n self.subobj = SubObj(v)\n\n\n def quantize2(value):\n return value.quantize(quantizer)\n\n def yesno(value):\n if value:\n return \"Yes\"\n else:\n return \"No\"\n\n vals = [('Project 1', True), ('Project 2', False), ('Project 3', False)]\n objs = [MyObj(*val) for val in vals]\n\n # the name transformer will work on output columns\n # in fact indexes...\n colnames = [\n \"Start Date\",\n \"Amount\",\n \"Description\",\n \"Task Description\",\n \"Is Urgent\"\n ]\n transformer = NameTransformer(colnames)\n transformer.register_func('Amount', quantize2)\n transformer.register_func('Is Urgent', yesno)\n\n # to adapt an object as a list we must give the list of attributes we want\n attrs = [\n 'subobj.start_date',\n 'subobj.amount',\n 'description',\n 'subobj.description',\n 'urgent'\n ]\n data_feed = Obj2List(objs, attrs, transformer=transformer)\n\n xl = List2xl('obj2list_out.xls', colnames=colnames)\n xl.write(data_feed, write_names=True)\n xl.finalize()\n\n\nHere you see that we have a (somewhat complex) input iterator yielding\nimbricated objects and we need to transform some of the data during the\nprocess.\n\nWe could have used other transformers, the list is in any2.transformers\n\nPlans\n=====\n\n - Adding unit tests is our main priority, the main functionalities are in\n `any2`_ which is 100% test covered. So we only need to add the thin wrapper\n above openpyxl in our unit tests\n - At the moment we can only produce \"raw\" xls files without formatting. We\n plan to introduce new xl specific formatters to be able to apply cell and\n row formattings in the same way we use transformers.\n\nChangelog\n=========\n\n0.1 Jul. 29 2015\n~~~~~~~~~~~~~~~~\n\n - Initial release\n\nContributors\n============\n\nBy order of contribution date:\n\n - `Florent Aide`_\n\n.. _Florent Aide: https://bitbucket.org/faide\n.. _any2: https://bitbucket.org/faide/any2\n.. _any2xl: https://bitbucket.org/faide/any2xl\n.. _openpyxl: https://openpyxl.readthedocs.org/en/latest/\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/faide/any2xl", "keywords": "xls xlsx adapter", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "any2xl", "package_url": "https://pypi.org/project/any2xl/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/any2xl/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://bitbucket.org/faide/any2xl" }, "release_url": "https://pypi.org/project/any2xl/0.1/", "requires_dist": null, "requires_python": null, "summary": "A library to generate Excel files from Python iterables", "version": "0.1" }, "last_serial": 1655355, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "8e1714689566d60ac3b77ef9a9950cf6", "sha256": "b2a39d95dfb7a21c1f1c96bef1edfa64c3f5905f1eeb57c6c9f81b37385d8c7f" }, "downloads": -1, "filename": "any2xl-0.1-py3.4.egg", "has_sig": true, "md5_digest": "8e1714689566d60ac3b77ef9a9950cf6", "packagetype": "bdist_egg", "python_version": "3.4", "requires_python": null, "size": 4322, "upload_time": "2015-07-29T16:32:02", "url": "https://files.pythonhosted.org/packages/63/aa/c0055abdda582df00321d813bc077de04a237d63edb8b072d2853ddceddf/any2xl-0.1-py3.4.egg" }, { "comment_text": "", "digests": { "md5": "f3d096bb88d394e984e06b31e62b52a2", "sha256": "0f807b14f6052cbbca33b8bb996f7b305738680f72cb9ab2b5125ddeb74ab9eb" }, "downloads": -1, "filename": "any2xl-0.1-py3-none-any.whl", "has_sig": true, "md5_digest": "f3d096bb88d394e984e06b31e62b52a2", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 3652, "upload_time": "2015-07-29T16:32:06", "url": "https://files.pythonhosted.org/packages/eb/6e/d7ce9b89bb33ed77427f0799ea24922e222e261aa38c66cabde2439374d2/any2xl-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "32b8d9f56217395cc596b471f72d07ee", "sha256": "d42281c4653ec67570cc3a79043859f3f4a3c8388bf95f8a21658be02a806abe" }, "downloads": -1, "filename": "any2xl-0.1.tar.gz", "has_sig": true, "md5_digest": "32b8d9f56217395cc596b471f72d07ee", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3906, "upload_time": "2015-07-29T16:31:55", "url": "https://files.pythonhosted.org/packages/75/6a/3da866d4b1dfb9ddb41c1a10895064be3f91676981166bbbfa8b0fef63c9/any2xl-0.1.tar.gz" }, { "comment_text": "", "digests": { "md5": "f57032bf4f3d3cf9d351c88276242976", "sha256": "74c0d49d8ffa16d975cfe3984ebe1d42ee86c300b0f85ce8bea7cf2081bffb86" }, "downloads": -1, "filename": "any2xl-0.1.zip", "has_sig": true, "md5_digest": "f57032bf4f3d3cf9d351c88276242976", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6191, "upload_time": "2015-07-29T16:31:59", "url": "https://files.pythonhosted.org/packages/99/73/97e4474864f05854bb70f3d865debcdf1180dd5ce03166533f465786560f/any2xl-0.1.zip" } ], "0.1.dev1": [] }, "urls": [ { "comment_text": "", "digests": { "md5": "8e1714689566d60ac3b77ef9a9950cf6", "sha256": "b2a39d95dfb7a21c1f1c96bef1edfa64c3f5905f1eeb57c6c9f81b37385d8c7f" }, "downloads": -1, "filename": "any2xl-0.1-py3.4.egg", "has_sig": true, "md5_digest": "8e1714689566d60ac3b77ef9a9950cf6", "packagetype": "bdist_egg", "python_version": "3.4", "requires_python": null, "size": 4322, "upload_time": "2015-07-29T16:32:02", "url": "https://files.pythonhosted.org/packages/63/aa/c0055abdda582df00321d813bc077de04a237d63edb8b072d2853ddceddf/any2xl-0.1-py3.4.egg" }, { "comment_text": "", "digests": { "md5": "f3d096bb88d394e984e06b31e62b52a2", "sha256": "0f807b14f6052cbbca33b8bb996f7b305738680f72cb9ab2b5125ddeb74ab9eb" }, "downloads": -1, "filename": "any2xl-0.1-py3-none-any.whl", "has_sig": true, "md5_digest": "f3d096bb88d394e984e06b31e62b52a2", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 3652, "upload_time": "2015-07-29T16:32:06", "url": "https://files.pythonhosted.org/packages/eb/6e/d7ce9b89bb33ed77427f0799ea24922e222e261aa38c66cabde2439374d2/any2xl-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "32b8d9f56217395cc596b471f72d07ee", "sha256": "d42281c4653ec67570cc3a79043859f3f4a3c8388bf95f8a21658be02a806abe" }, "downloads": -1, "filename": "any2xl-0.1.tar.gz", "has_sig": true, "md5_digest": "32b8d9f56217395cc596b471f72d07ee", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3906, "upload_time": "2015-07-29T16:31:55", "url": "https://files.pythonhosted.org/packages/75/6a/3da866d4b1dfb9ddb41c1a10895064be3f91676981166bbbfa8b0fef63c9/any2xl-0.1.tar.gz" }, { "comment_text": "", "digests": { "md5": "f57032bf4f3d3cf9d351c88276242976", "sha256": "74c0d49d8ffa16d975cfe3984ebe1d42ee86c300b0f85ce8bea7cf2081bffb86" }, "downloads": -1, "filename": "any2xl-0.1.zip", "has_sig": true, "md5_digest": "f57032bf4f3d3cf9d351c88276242976", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6191, "upload_time": "2015-07-29T16:31:59", "url": "https://files.pythonhosted.org/packages/99/73/97e4474864f05854bb70f3d865debcdf1180dd5ce03166533f465786560f/any2xl-0.1.zip" } ] }