{ "info": { "author": "bray, dean.sellis, tkemenczy, chalkdust1011, et al", "author_email": "bray@sent.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "======================\r\ndjango_excel_templates\r\n======================\r\n\r\nDjango MS Excel Generator aims to create a template system for generation of\r\nthe Excel documents for views (instead of HTML).\r\n\r\n\r\n1. **Simple case**: sniff model and make an excel table; \r\n2. **Medium case**: sniff model, make excel table, and apply predetermined styles (fonts, colors, layout)\r\n3. **Advanced case**: take models and set custom styles or modify existing\r\n\r\n\r\nRequiments\r\n----------\r\n \r\n * `Python 2.4+ \\< 3.0 `_\r\n * `Django `_\r\n * `xlwt >= 0.7.2 `_\r\n\r\n\r\nInstall\r\n-------\r\n\r\nYou have two options:\r\n\r\n1. Easy_insall with install the package and all dependencies if they aren't already installed into your lib/python/::\r\n\r\n easy_install django_excel_templates \r\n\r\n2. Download and untar the package; run::\r\n\r\n python setup.py install\r\n\r\n\r\nExamples\r\n--------\r\n\r\n``testobj`` in the following examples is django.db.models.query.QuerySet instance\r\n\r\n**Simple**:\r\ncreate ExcelReport instance, add excel sheet, add queryset to analyze:\r\n\r\n>>> from django_excel_templates import *\r\n>>> report = ExcelReport()\r\n>>> report.addSheet(\"TestBasic\")\r\n>>> report.addQuerySet(testobj, REPORT_HORZ, addheader=True)\r\n\r\n\r\n**Medium** (create styles, one by one):\r\ncreate ExcelStyle instance to specify style (see help(ExcelStyle) for available methods and style options),\r\ncreate ExcelFormatter instance, add style to it:\r\n\r\n>>> report.addSheet(\"TestStyle\")\r\n>>> style = ExcelStyle() \r\n>>> style.set_alignment(horz=3, wrap=1)\r\n>>> style.set_font(font_color='000000', bold=True, italic=True)\r\n>>> style.set_border(border_color='000000', border_style=5)\r\n>>> style.set_pattern(pattern_color='339933', pattern=1)\r\n>>> formatter = ExcelFormatter()\r\n>>> formatter.addBodyStyle(style=style)\r\n>>> report.addFormatter(formatter)\r\n>>> report.addQuerySet(testobj, orientation=REPORT_HORZ, addheader=True)\r\n\r\n\r\n**Medium** (create styles all at once):\r\n\r\n>>> report.addSheet(\"TestStyle2\")\r\n>>> headerstyle = ExcelStyle(font_color='00FF00', shadow=True, underline=True, \r\n pattern_color='000000', pattern=1, border_style=5, \r\n border_color='FFFFFF')\r\n>>> col_style = ExcelStyle(font_color='FFFFFF')\r\n>>> formatter.addHeaderStyle(headerstyle)\r\n>>> formatter.addColunmStyle('column_name', style=col_style)\r\n>>> report.addQuerySet(testobj, REPORT_HORZ, True)\r\n\r\n\r\n**Advanced**:\r\nchange existing styles, set custom styles, adjust column style and width:\r\n\r\n>>> report.addSheet(\"ModifyStyle\")\r\n>>> style.set_font(font_color='000000', bold=False, underline=True)\r\n>>> style.set_border(border_color='330099', border_style=6)\r\n>>> style.set_pattern(pattern_color='FFFFFF', pattern=1)\r\n>>> colstyle.set_pattern(pattern_color='FFFF33', pattern=1)\r\n>>> formatter.setWidth('column1_name, column2_name', width=600)\r\n>>> report.addQuerySet(testobj, REPORT_HORZ, True)\r\n\r\n\r\nTo make django.http.HttpResponse out of ``report`` and tell the broswer to treat it as an excel attachment:\r\n\r\n>>> response = HttpResponse(report.writeReport(), mimetype='application/ms-excel')\r\n>>> response['Content-Disposition'] = 'attachment; filename=foo.xls'", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://code.google.com/p/django-excel-templates/", "keywords": "", "license": "UNKNOWN", "maintainer": "", "maintainer_email": "", "name": "django_excel_templates", "package_url": "https://pypi.org/project/django_excel_templates/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django_excel_templates/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://code.google.com/p/django-excel-templates/" }, "release_url": "https://pypi.org/project/django_excel_templates/0.1/", "requires_dist": null, "requires_python": null, "summary": "Generate Excel Tables from Django", "version": "0.1" }, "last_serial": 791096, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "d5b6963e8cde6e730220d2866206aef3", "sha256": "b6d804df960351a6da5f0c9040b9cdf9e22c95490d3d23e81803ffa2a48be7e6" }, "downloads": -1, "filename": "django_excel_templates-0.1.tar.gz", "has_sig": false, "md5_digest": "d5b6963e8cde6e730220d2866206aef3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12770, "upload_time": "2009-11-16T00:40:08", "url": "https://files.pythonhosted.org/packages/49/50/4d10dfd431c46a0223b84550a630d3e156aadfdb3253771f46b4abb081e4/django_excel_templates-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d5b6963e8cde6e730220d2866206aef3", "sha256": "b6d804df960351a6da5f0c9040b9cdf9e22c95490d3d23e81803ffa2a48be7e6" }, "downloads": -1, "filename": "django_excel_templates-0.1.tar.gz", "has_sig": false, "md5_digest": "d5b6963e8cde6e730220d2866206aef3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12770, "upload_time": "2009-11-16T00:40:08", "url": "https://files.pythonhosted.org/packages/49/50/4d10dfd431c46a0223b84550a630d3e156aadfdb3253771f46b4abb081e4/django_excel_templates-0.1.tar.gz" } ] }