xlwt-1.3.0/0000755000372000037200000000000013146751561013362 5ustar travistravis00000000000000xlwt-1.3.0/docs/0000755000372000037200000000000013146751561014312 5ustar travistravis00000000000000xlwt-1.3.0/docs/Makefile0000644000372000037200000001266413146751460015761 0ustar travistravis00000000000000# Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " devhelp to make HTML files and a Devhelp project" @echo " epub to make an epub" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " text to make text files" @echo " man to make manual pages" @echo " texinfo to make Texinfo files" @echo " info to make Texinfo files and run them through makeinfo" @echo " gettext to make PO message catalogs" @echo " changes to make an overview of all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" clean: -rm -rf $(BUILDDIR)/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." singlehtml: $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/xlwt.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/xlwt.qhc" devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" @echo "# mkdir -p $$HOME/.local/share/devhelp/xlwt" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/xlwt" @echo "# devhelp" epub: $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub @echo @echo "Build finished. The epub file is in $(BUILDDIR)/epub." latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make' in that directory to run these through (pdf)latex" \ "(use \`make latexpdf' here to do that automatically)." latexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through pdflatex..." $(MAKE) -C $(BUILDDIR)/latex all-pdf @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." text: $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text @echo @echo "Build finished. The text files are in $(BUILDDIR)/text." man: $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." texinfo: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." @echo "Run \`make' in that directory to run these through makeinfo" \ "(use \`make info' here to do that automatically)." info: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo "Running Texinfo files through makeinfo..." make -C $(BUILDDIR)/texinfo info @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." gettext: $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale @echo @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." xlwt-1.3.0/docs/api.rst0000644000372000037200000000063613146751460015620 0ustar travistravis00000000000000API Reference ============= .. automodule:: xlwt.Workbook :members: .. automodule:: xlwt.Worksheet :members: .. automodule:: xlwt.Row :members: .. automodule:: xlwt.Column :members: .. automodule:: xlwt.Cell :members: .. automodule:: xlwt.Formatting :members: .. automodule:: xlwt.Style :members: .. automodule:: xlwt.Bitmap :members: .. automodule:: xlwt.CompoundDoc :members: xlwt-1.3.0/docs/changes.rst0000644000372000037200000001116513146751460016456 0ustar travistravis00000000000000Changes ======= .. currentmodule:: xlwt 1.3.0 (22 August 2017) ---------------------- - Officially support Python 3.6, drop support for 2.6. - Fix bytes/string type mismatch in :func:`upack2rt` on python 3. - Packaging and code style tweaks. - Use generator expressions to avoid unnecessary lists in memory. Thanks to the following for their contributions to this release: - Jon Dufresne - Bill Adams 1.2.0 (4 January 2017) ---------------------- - Remove ``LOCALE`` from regular expression that caused :class:`DeprecationWarning` that become an exception in Python 3.6 - Add :meth:`Workbook.sheet_index` helper. - :meth:`Workbook.get_sheet` now takes either a string name or an integer index. 1.1.2 (9 June 2016) ------------------- - Fix failure in style compression under Python 3. - Officially support Python 3.5 - Documentation tweaks. 1.1.1 (2 June 2016) ------------------- - Fix release problems. 1.1.0 (2 June 2016) ------------------- - Fix SST BIFF record in Python 3. - Fix for writing :class:`ExternSheetRecord` in Python 3. - Add the ability to insert bitmap images from buffers as well as files. - Official support for Python 3.5. Thanks to "thektulu" and Lele Gaifax for the Python 3 fixes. Thanks to Ross Golder for the support for inserting images from buffers. 1.0.0 (15 April 2015) --------------------- - Python 3 support. - Initial set of unit tests. - An initial set of Sphinx documentation. - Move to setuptools for packaging. - Wire up Travis, Coveralls and ReadTheDocs. - Allow longs as row indexes. Big thanks to Thomas Kluyver for his work on Python 3 support, Manfred Moitzi for donating his unit tests. Belated thanks to Landon Jurgens for his help on converting the documentation to Sphinx. 0.7.5 (5 April 2013) -------------------- - Fixes a bug that could cause a corrupt SST in .xls files written by a wide-unicode Python build. - A :class:`ValueError` is now raised immediately if an attempt is made to set column width to other than an int in ``range(65536)`` - Added the ability to set a custom RGB colour in the palette to use for colours. Thanks to Alan Rotman for the work, although this could really use an example in the examples folder... - Fixed an issue trying to set a diagonal border using easyxf. Thanks to Neil Etheridge for the fix. - Fixed a regression from 0.7.2 when writing sheets with frozen panes. 0.7.4 (13 April 2012) --------------------- - Python 2.3 to 2.7 are now the officially supported versions, no Python 3 yet, sorry. - The ``datemode`` in an xlwt :class:`Workbook` can be set to 1904 by doing ``workbook.dates_1904 = 1`` and is written to the output file. However the datemode was not being reflected in conversions from :class:`datetime.datetime` and :class:`datetime.date` objects to floats for output, resulting in dates that were 4 years too high when seen in Excel. 0.7.3 (21 February 2012) ------------------------ - Added user_set and best_fit attributes to Column class. - Fixed an ``[Errno 0] Error`` raised when :meth:`Worksheet.flush_row_data` was called after :meth:`Workbook.save` - Fixed an error on Windows that occurred when writing large blocks to files. - Added the ability to write rich text cells - Fixed a bug when writing ``MULBLANK`` records on big-endian platforms. - allow the ``active_pane`` on worksheets to be specified - added support for zoom (magn) factors and improved possibilities when generating split panes 0.7.2 (1 June 2009) ------------------- - Added function Utils.rowcol_pair_to_cellrange. ``(0, 0, 65535, 255) -> "A1:IV65536"`` - Removed :class:`Worksheet` property ``show_empty_as_zero``, and added attribute :attr:`~Worksheet.show_zero_values` (default: ``1 == True``). - Fixed formula code generation problem with formulas including MAX/SUM/etc functions with arguments like A1+123. - Added .pattern_examples.xls and put a pointer to it in the easyxf part of Style.py. - Fixed Row.set_cell_formula() bug introduced in 0.7.1. - Fixed bug(?) with SCL/magnification handling causing(?) Excel to raise a dialogue box if sheet is set to open in page preview mode and user then switches to normal view. - Added color and colour as synonyms for font.colour_index in easyxf. - Removed unused attribute Row.__has_default_format. 0.7.1 (4 March 2009) -------------------- See source control for changes made. 0.7.0 (19 September 2008) ------------------------- - Fixed more bugs and added more various new bits of functionality 0.7.0a4 (8 October 2007) ------------------------ - fork of pyExcelerator, released to python-excel. - Fixed various bugs in pyExcelerator and added various new bits of functionality xlwt-1.3.0/docs/conf.py0000644000372000037200000000117213146751460015610 0ustar travistravis00000000000000import datetime import os, pkginfo on_rtd = os.environ.get('READTHEDOCS', None) == 'True' pkg_info = pkginfo.Develop(os.path.join(os.path.dirname(__file__), os.pardir)) extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx'] source_suffix = '.rst' master_doc = 'index' project = u'xlwt' copyright = '2002-%s xlwt contributors' % datetime.datetime.now().year version = release = pkg_info.version exclude_patterns = ['_build'] pygments_style = 'sphinx' if on_rtd: html_theme = 'default' else: html_theme = 'classic' htmlhelp_basename = project+'doc' intersphinx_mapping = {'python': ('https://docs.python.org', None)} xlwt-1.3.0/docs/development.rst0000644000372000037200000000324213146751460017365 0ustar travistravis00000000000000Development =========== .. highlight:: bash This package is developed using continuous integration which can be found here: https://travis-ci.org/python-excel/xlwt If you wish to contribute to this project, then you should fork the repository found here: https://github.com/python-excel/xlwt Once that has been done and you have a checkout, you can follow these instructions to perform various development tasks: Setting up a virtualenv ----------------------- The recommended way to set up a development environment is to turn your checkout into a virtualenv and then install the package in editable form as follows:: $ virtualenv . $ bin/pip install -Ur requirements.txt $ bin/pip install -e . Running the tests ----------------- Once you've set up a virtualenv, the tests can be run as follows:: $ bin/nosetests To run tests on all the versions of Python that are supported, you can do:: $ bin/tox If you change the supported python versions in ``.travis.yml``, please remember to do the following to update ``tox.ini``:: $ bin/panci --to=tox .travis.yml > tox.ini Building the documentation -------------------------- The Sphinx documentation is built by doing the following, having activated the virtualenv above, from the directory containing setup.py:: $ cd docs $ make html Making a release ---------------- To make a release, just update the version in ``xlwt/__init__.py``, update the change log, tag it and push to https://github.com/python-excel/xlwt and Travis CI should take care of the rest. Once the above is done, make sure to go to https://readthedocs.org/projects/xlwt/versions/ and make sure the new release is marked as an Active Version. xlwt-1.3.0/docs/index.rst0000644000372000037200000000130713146751460016152 0ustar travistravis00000000000000xlwt documentation ================== xlwt is a library for writing data and formatting information to older Excel files (ie: .xls) Documentation is sparse, please see the API reference or code for help: .. toctree:: :maxdepth: 1 api.rst Perhaps more useful is to consult the `tutorial`__ and the examples in the `examples` folder of the distribution. __ https://github.com/python-excel/tutorial For details of how to install the package or get involved in its development, please see the sections below: .. toctree:: :maxdepth: 1 installation.rst development.rst changes.rst licenses.rst Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` xlwt-1.3.0/docs/installation.rst0000644000372000037200000000073013146751460017543 0ustar travistravis00000000000000Installation Instructions ========================= If you want to experiment with xlwt, the easiest way to install it is to do the following in a virtualenv:: pip install xlwt If your package uses setuptools and you decide to use xlwt, then you should add it as a requirement by adding an ``install_requires`` parameter in your call to ``setup`` as follows: .. code-block:: python setup( # other stuff here install_requires=['xlwt'], ) xlwt-1.3.0/docs/licenses.rst0000644000372000037200000001174113146751460016653 0ustar travistravis00000000000000Licenses ======== xlwt has various licenses that apply to the different parts of it, they are listed below: The license for the work John Machin has done since xlwt was created:: Portions copyright (c) 2007, Stephen John Machin, Lingfo Pty Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. None of the names of Stephen John Machin, Lingfo Pty Ltd and any contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The licensing for the unit tests added as part of the work for Python 3 compatibility is as follows:: Author: mozman -- Purpose: test_mini Created: 03.12.2010 Copyright (C) 2010, Manfred Moitzi License: BSD licence The license for pyExcelerator, from which xlwt was forked:: Copyright (C) 2005 Roman V. Kiseliov All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. All advertising materials mentioning features or use of this software must display the following acknowledgment: "This product includes software developed by Roman V. Kiseliov ." 4. Redistributions of any form whatsoever must retain the following acknowledgment: "This product includes software developed by Roman V. Kiseliov ." THIS SOFTWARE IS PROVIDED BY Roman V. Kiseliov ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Roman V. Kiseliov OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Roman V. Kiseliov Russia Kursk Libknecht St., 4 +7(0712)56-09-83 Portions of xlwt.Utils are based on pyXLWriter which is licensed as follows:: Copyright (c) 2004 Evgeny Filatov Copyright (c) 2002-2004 John McNamara (Perl Spreadsheet::WriteExcel) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details: https://www.gnu.org/licenses/lgpl.html pyXLWriter also makes reference to the PERL Spreadsheet::WriteExcel as follows:: This module was written/ported from PERL Spreadsheet::WriteExcel module The author of the PERL Spreadsheet::WriteExcel module is John McNamara xlwt-1.3.0/docs/make.bat0000644000372000037200000001174413146751460015724 0ustar travistravis00000000000000@ECHO OFF REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) set BUILDDIR=_build set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . set I18NSPHINXOPTS=%SPHINXOPTS% . if NOT "%PAPER%" == "" ( set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% ) if "%1" == "" goto help if "%1" == "help" ( :help echo.Please use `make ^` where ^ is one of echo. html to make standalone HTML files echo. dirhtml to make HTML files named index.html in directories echo. singlehtml to make a single large HTML file echo. pickle to make pickle files echo. json to make JSON files echo. htmlhelp to make HTML files and a HTML help project echo. qthelp to make HTML files and a qthelp project echo. devhelp to make HTML files and a Devhelp project echo. epub to make an epub echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter echo. text to make text files echo. man to make manual pages echo. texinfo to make Texinfo files echo. gettext to make PO message catalogs echo. changes to make an overview over all changed/added/deprecated items echo. linkcheck to check all external links for integrity echo. doctest to run all doctests embedded in the documentation if enabled goto end ) if "%1" == "clean" ( for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i del /q /s %BUILDDIR%\* goto end ) if "%1" == "html" ( %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/html. goto end ) if "%1" == "dirhtml" ( %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. goto end ) if "%1" == "singlehtml" ( %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. goto end ) if "%1" == "pickle" ( %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can process the pickle files. goto end ) if "%1" == "json" ( %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can process the JSON files. goto end ) if "%1" == "htmlhelp" ( %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can run HTML Help Workshop with the ^ .hhp project file in %BUILDDIR%/htmlhelp. goto end ) if "%1" == "qthelp" ( %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can run "qcollectiongenerator" with the ^ .qhcp project file in %BUILDDIR%/qthelp, like this: echo.^> qcollectiongenerator %BUILDDIR%\qthelp\xlwt.qhcp echo.To view the help file: echo.^> assistant -collectionFile %BUILDDIR%\qthelp\xlwt.ghc goto end ) if "%1" == "devhelp" ( %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp if errorlevel 1 exit /b 1 echo. echo.Build finished. goto end ) if "%1" == "epub" ( %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub if errorlevel 1 exit /b 1 echo. echo.Build finished. The epub file is in %BUILDDIR%/epub. goto end ) if "%1" == "latex" ( %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex if errorlevel 1 exit /b 1 echo. echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. goto end ) if "%1" == "text" ( %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text if errorlevel 1 exit /b 1 echo. echo.Build finished. The text files are in %BUILDDIR%/text. goto end ) if "%1" == "man" ( %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man if errorlevel 1 exit /b 1 echo. echo.Build finished. The manual pages are in %BUILDDIR%/man. goto end ) if "%1" == "texinfo" ( %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo if errorlevel 1 exit /b 1 echo. echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. goto end ) if "%1" == "gettext" ( %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale if errorlevel 1 exit /b 1 echo. echo.Build finished. The message catalogs are in %BUILDDIR%/locale. goto end ) if "%1" == "changes" ( %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes if errorlevel 1 exit /b 1 echo. echo.The overview file is in %BUILDDIR%/changes. goto end ) if "%1" == "linkcheck" ( %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck if errorlevel 1 exit /b 1 echo. echo.Link check complete; look for any errors in the above output ^ or in %BUILDDIR%/linkcheck/output.txt. goto end ) if "%1" == "doctest" ( %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest if errorlevel 1 exit /b 1 echo. echo.Testing of doctests in the sources finished, look at the ^ results in %BUILDDIR%/doctest/output.txt. goto end ) :end xlwt-1.3.0/examples/0000755000372000037200000000000013146751561015200 5ustar travistravis00000000000000xlwt-1.3.0/examples/big-16Mb.py0000644000372000037200000000127213146751460017016 0ustar travistravis00000000000000from __future__ import print_function #!/usr/bin/env python # tries stress SST, SAT and MSAT from time import * from xlwt.Workbook import * from xlwt.Style import * style = XFStyle() wb = Workbook() ws0 = wb.add_sheet('0') colcount = 200 + 1 rowcount = 6000 + 1 t0 = time() print("\nstart: %s" % ctime(t0)) print("Filling...") for col in xrange(colcount): print("[%d]" % col, end=' ') for row in xrange(rowcount): #ws0.write(row, col, "BIG(%d, %d)" % (row, col)) ws0.write(row, col, "BIG") t1 = time() - t0 print("\nsince starting elapsed %.2f s" % (t1)) print("Storing...") wb.save('big-16Mb.xls') t2 = time() - t0 print("since starting elapsed %.2f s" % (t2)) xlwt-1.3.0/examples/big-35Mb.py0000644000372000037200000000103513146751460017014 0ustar travistravis00000000000000from __future__ import print_function #!/usr/bin/env python # tries stress SST, SAT and MSAT from time import * from xlwt import * style = XFStyle() wb = Workbook() ws0 = wb.add_sheet('0') colcount = 200 + 1 rowcount = 6000 + 1 t0 = time() for col in xrange(colcount): for row in xrange(rowcount): ws0.write(row, col, "BIG(%d, %d)" % (row, col)) t1 = time() - t0 print("\nsince starting elapsed %.2f s" % (t1)) print("Storing...") wb.save('big-35Mb.xls') t2 = time() - t0 print("since starting elapsed %.2f s" % (t2)) xlwt-1.3.0/examples/blanks.py0000644000372000037200000000116113146751460017021 0ustar travistravis00000000000000#!/usr/bin/env python # -*- coding: windows-1251 -*- # Copyright (C) 2005 Kiseliov Roman from xlwt import * font0 = Font() font0.name = 'Times New Roman' font0.struck_out = True font0.bold = True style0 = XFStyle() style0.font = font0 wb = Workbook() ws0 = wb.add_sheet('0') ws0.write(1, 1, 'Test', style0) for i in range(0, 0x53): borders = Borders() borders.left = i borders.right = i borders.top = i borders.bottom = i style = XFStyle() style.borders = borders ws0.write(i, 2, '', style) ws0.write(i, 3, hex(i), style0) ws0.write_merge(5, 8, 6, 10, "") wb.save('blanks.xls') xlwt-1.3.0/examples/col_width.py0000644000372000037200000000056213146751460017527 0ustar travistravis00000000000000#!/usr/bin/env python # -*- coding: windows-1251 -*- # Copyright (C) 2005 Kiseliov Roman __rev_id__ = """$Id$""" from xlwt import * w = Workbook() ws = w.add_sheet('Hey, Dude') for i in range(6, 80): fnt = Font() fnt.height = i*20 style = XFStyle() style.font = fnt ws.write(1, i, 'Test') ws.col(i).width = 0x0d00 + i w.save('col_width.xls') xlwt-1.3.0/examples/country.py0000644000372000037200000000027313146751460017255 0ustar travistravis00000000000000#!/usr/bin/env python # -*- coding: windows-1252 -*- # Copyright (C) 2007 John Machin from xlwt import * w = Workbook() w.country_code = 61 ws = w.add_sheet('AU') w.save('country.xls') xlwt-1.3.0/examples/dates.py0000644000372000037200000000106213146751460016647 0ustar travistravis00000000000000#!/usr/bin/env python # -*- coding: windows-1251 -*- # Copyright (C) 2005 Kiseliov Roman from xlwt import * from datetime import datetime w = Workbook() ws = w.add_sheet('Hey, Dude') fmts = [ 'M/D/YY', 'D-MMM-YY', 'D-MMM', 'MMM-YY', 'h:mm AM/PM', 'h:mm:ss AM/PM', 'h:mm', 'h:mm:ss', 'M/D/YY h:mm', 'mm:ss', '[h]:mm:ss', 'mm:ss.0', ] i = 0 for fmt in fmts: ws.write(i, 0, fmt) style = XFStyle() style.num_format_str = fmt ws.write(i, 4, datetime.now(), style) i += 1 w.save('dates.xls') xlwt-1.3.0/examples/format.py0000644000372000037200000000120313146751460017034 0ustar travistravis00000000000000#!/usr/bin/env python # -*- coding: windows-1251 -*- # Copyright (C) 2005 Kiseliov Roman from xlwt import * font0 = Font() font0.name = 'Times New Roman' font0.struck_out = True font0.bold = True style0 = XFStyle() style0.font = font0 wb = Workbook() ws0 = wb.add_sheet('0') ws0.write(1, 1, 'Test', style0) for i in range(0, 0x53): fnt = Font() fnt.name = 'Arial' fnt.colour_index = i fnt.outline = True borders = Borders() borders.left = i style = XFStyle() style.font = fnt style.borders = borders ws0.write(i, 2, 'colour', style) ws0.write(i, 3, hex(i), style0) wb.save('format.xls') xlwt-1.3.0/examples/formula_names.py0000644000372000037200000000164313146751460020404 0ustar travistravis00000000000000from __future__ import print_function #!/usr/bin/env python # -*- coding: windows-1251 -*- # Copyright (C) 2005 Kiseliov Roman from xlwt import * from xlwt.ExcelFormulaParser import FormulaParseException w = Workbook() ws = w.add_sheet('F') ## This example is a little silly since the formula building is ## so simplistic that it often fails because the generated text ## has the wrong number of parameters for the function being ## tested. i = 0 succeed_count = 0 fail_count = 0 for n in sorted(ExcelMagic.std_func_by_name): ws.write(i, 0, n) text = n + "($A$1)" try: formula = Formula(text) except FormulaParseException as e: print("Could not parse %r: %s" % (text,e.args[0])) fail_count += 1 else: ws.write(i, 3, formula) succeed_count += 1 i += 1 w.save('formula_names.xls') print("succeeded with %i functions, failed with %i" % (succeed_count,fail_count)) xlwt-1.3.0/examples/formulas.py0000644000372000037200000000251613146751460017404 0ustar travistravis00000000000000#!/usr/bin/env python # -*- coding: windows-1251 -*- # Copyright (C) 2005 Kiseliov Roman from xlwt import * w = Workbook() ws = w.add_sheet('F') ws.write(0, 0, Formula("-(1+1)")) ws.write(1, 0, Formula("-(1+1)/(-2-2)")) ws.write(2, 0, Formula("-(134.8780789+1)")) ws.write(3, 0, Formula("-(134.8780789e-10+1)")) ws.write(4, 0, Formula("-1/(1+1)+9344")) ws.write(0, 1, Formula("-(1+1)")) ws.write(1, 1, Formula("-(1+1)/(-2-2)")) ws.write(2, 1, Formula("-(134.8780789+1)")) ws.write(3, 1, Formula("-(134.8780789e-10+1)")) ws.write(4, 1, Formula("-1/(1+1)+9344")) ws.write(0, 2, Formula("A1*B1")) ws.write(1, 2, Formula("A2*B2")) ws.write(2, 2, Formula("A3*B3")) ws.write(3, 2, Formula("A4*B4*sin(pi()/4)")) ws.write(4, 2, Formula("A5%*B5*pi()/1000")) ############## ## NOTE: parameters are separated by semicolon!!! ############## ws.write(5, 2, Formula("C1+C2+C3+C4+C5/(C1+C2+C3+C4/(C1+C2+C3+C4/(C1+C2+C3+C4)+C5)+C5)-20.3e-2")) ws.write(5, 3, Formula("C1^2")) ws.write(6, 2, Formula("SUM(C1;C2;;;;;C3;;;C4)")) ws.write(6, 3, Formula("SUM($A$1:$C$5)")) ws.write(7, 0, Formula('"lkjljllkllkl"')) ws.write(7, 1, Formula('"yuyiyiyiyi"')) ws.write(7, 2, Formula('A8 & B8 & A8')) ws.write(8, 2, Formula('now()')) ws.write(10, 2, Formula('TRUE')) ws.write(11, 2, Formula('FALSE')) ws.write(12, 3, Formula('IF(A1>A2;3;"hkjhjkhk")')) w.save('formulas.xls') xlwt-1.3.0/examples/hyperlinks.py0000644000372000037200000000127713146751460017747 0ustar travistravis00000000000000#!/usr/bin/env python # -*- coding: windows-1251 -*- # Copyright (C) 2005 Kiseliov Roman from xlwt import * f = Font() f.height = 20*72 f.name = 'Verdana' f.bold = True f.underline = Font.UNDERLINE_DOUBLE f.colour_index = 4 h_style = XFStyle() h_style.font = f w = Workbook() ws = w.add_sheet('F') ############## ## NOTE: parameters are separated by semicolon!!! ############## n = "HYPERLINK" ws.write_merge(1, 1, 1, 10, Formula(n + '("https://www.irs.gov/pub/irs-pdf/f1000.pdf";"f1000.pdf")'), h_style) ws.write_merge(2, 2, 2, 25, Formula(n + '("mailto:roman.kiseliov@gmail.com?subject=pyExcelerator-feedback&Body=Hello,%20Roman!";"pyExcelerator-feedback")'), h_style) w.save("hyperlinks.xls") xlwt-1.3.0/examples/image.py0000644000372000037200000000060713146751460016635 0ustar travistravis00000000000000#!/usr/bin/env python # -*- coding: windows-1251 -*- # Copyright (C) 2005 Kiseliov Roman from xlwt import * w = Workbook() ws = w.add_sheet('Image') ws.insert_bitmap('python.bmp', 2, 2) # Also works if you already have the image bitmap data in memory... with open ("python.bmp", "r") as bmpfile: bmpdata = bmpfile.read() ws.insert_bitmap_data(bmpdata, 10, 2) w.save('image.xls') xlwt-1.3.0/examples/image_chg_col_wid.py0000644000372000037200000000121313146751460021150 0ustar travistravis00000000000000# This demonstrates the effect of changing the column width # when inserting a picture/image. import xlwt w = xlwt.Workbook() ws = w.add_sheet('Image') ws.write(0, 2, "chg wid: none") ws.insert_bitmap('python.bmp', 2, 2) ws.write(0, 4, "chg wid: after") ws.insert_bitmap('python.bmp', 2, 4) ws.col(4).width = 20 * 256 ws.write(0, 6, "chg wid: before") ws.col(6).width = 20 * 256 ws.insert_bitmap('python.bmp', 2, 6) ws.write(0, 8, "chg wid: after") ws.insert_bitmap('python.bmp', 2, 8) ws.col(5).width = 8 * 256 ws.write(0, 10, "chg wid: before") ws.col(10).width = 8 * 256 ws.insert_bitmap('python.bmp', 2, 10) w.save('image_chg_col_wid.xls') xlwt-1.3.0/examples/merged.py0000644000372000037200000000137713146751460017023 0ustar travistravis00000000000000#!/usr/bin/env python # -*- coding: windows-1251 -*- # Copyright (C) 2005 Kiseliov Roman from xlwt import * fnt = Font() fnt.name = 'Arial' fnt.colour_index = 4 fnt.bold = True borders = Borders() borders.left = 6 borders.right = 6 borders.top = 6 borders.bottom = 6 al = Alignment() al.horz = Alignment.HORZ_CENTER al.vert = Alignment.VERT_CENTER style = XFStyle() style.font = fnt style.borders = borders style.alignment = al wb = Workbook() ws0 = wb.add_sheet('sheet0') ws1 = wb.add_sheet('sheet1') ws2 = wb.add_sheet('sheet2') for i in range(0, 0x200, 2): ws0.write_merge(i, i+1, 1, 5, 'test %d' % i, style) ws1.write_merge(i, i, 1, 7, 'test %d' % i, style) ws2.write_merge(i, i+1, 1, 7 + (i%10), 'test %d' % i, style) wb.save('merged.xls') xlwt-1.3.0/examples/merged0.py0000644000372000037200000000100513146751460017067 0ustar travistravis00000000000000#!/usr/bin/env python # -*- coding: windows-1251 -*- # Copyright (C) 2005 Kiseliov Roman from xlwt import * wb = Workbook() ws0 = wb.add_sheet('sheet0') fnt = Font() fnt.name = 'Arial' fnt.colour_index = 4 fnt.bold = True borders = Borders() borders.left = 6 borders.right = 6 borders.top = 6 borders.bottom = 6 style = XFStyle() style.font = fnt style.borders = borders ws0.write_merge(3, 3, 1, 5, 'test1', style) ws0.write_merge(4, 10, 1, 5, 'test2', style) ws0.col(1).width = 0x0d00 wb.save('merged0.xls') xlwt-1.3.0/examples/merged1.py0000644000372000037200000000344413146751460017101 0ustar travistravis00000000000000#!/usr/bin/env python # -*- coding: windows-1251 -*- # Copyright (C) 2005 Kiseliov Roman from xlwt import * wb = Workbook() ws0 = wb.add_sheet('sheet0') fnt1 = Font() fnt1.name = 'Verdana' fnt1.bold = True fnt1.height = 18*0x14 pat1 = Pattern() pat1.pattern = Pattern.SOLID_PATTERN pat1.pattern_fore_colour = 0x16 brd1 = Borders() brd1.left = 0x06 brd1.right = 0x06 brd1.top = 0x06 brd1.bottom = 0x06 fnt2 = Font() fnt2.name = 'Verdana' fnt2.bold = True fnt2.height = 14*0x14 brd2 = Borders() brd2.left = 0x01 brd2.right = 0x01 brd2.top = 0x01 brd2.bottom = 0x01 pat2 = Pattern() pat2.pattern = Pattern.SOLID_PATTERN pat2.pattern_fore_colour = 0x01F fnt3 = Font() fnt3.name = 'Verdana' fnt3.bold = True fnt3.italic = True fnt3.height = 12*0x14 brd3 = Borders() brd3.left = 0x07 brd3.right = 0x07 brd3.top = 0x07 brd3.bottom = 0x07 fnt4 = Font() al1 = Alignment() al1.horz = Alignment.HORZ_CENTER al1.vert = Alignment.VERT_CENTER al2 = Alignment() al2.horz = Alignment.HORZ_RIGHT al2.vert = Alignment.VERT_CENTER al3 = Alignment() al3.horz = Alignment.HORZ_LEFT al3.vert = Alignment.VERT_CENTER style1 = XFStyle() style1.font = fnt1 style1.alignment = al1 style1.pattern = pat1 style1.borders = brd1 style2 = XFStyle() style2.font = fnt2 style2.alignment = al1 style2.pattern = pat2 style2.borders = brd2 style3 = XFStyle() style3.font = fnt3 style3.alignment = al1 style3.pattern = pat2 style3.borders = brd3 price_style = XFStyle() price_style.font = fnt4 price_style.alignment = al2 price_style.borders = brd3 price_style.num_format_str = '_(#,##0.00_) "money"' ware_style = XFStyle() ware_style.font = fnt4 ware_style.alignment = al3 ware_style.borders = brd3 ws0.merge(3, 3, 1, 5, style1) ws0.merge(4, 10, 1, 6, style2) ws0.merge(14, 16, 1, 7, style3) ws0.col(1).width = 0x0d00 wb.save('merged1.xls') xlwt-1.3.0/examples/mini.py0000644000372000037200000000026213146751460016504 0ustar travistravis00000000000000#!/usr/bin/env python # -*- coding: windows-1251 -*- # Copyright (C) 2005 Kiseliov Roman from xlwt import * w = Workbook() ws = w.add_sheet('xlwt was here') w.save('mini.xls') xlwt-1.3.0/examples/num_formats.py0000644000372000037200000000221113146751460020076 0ustar travistravis00000000000000#!/usr/bin/env python # -*- coding: windows-1251 -*- # Copyright (C) 2005 Kiseliov Roman from xlwt import * w = Workbook() ws = w.add_sheet('Hey, Dude') fmts = [ 'general', '0', '0.00', '#,##0', '#,##0.00', '"$"#,##0_);("$"#,##', '"$"#,##0_);[Red]("$"#,##', '"$"#,##0.00_);("$"#,##', '"$"#,##0.00_);[Red]("$"#,##', '0%', '0.00%', '0.00E+00', '# ?/?', '# ??/??', 'M/D/YY', 'D-MMM-YY', 'D-MMM', 'MMM-YY', 'h:mm AM/PM', 'h:mm:ss AM/PM', 'h:mm', 'h:mm:ss', 'M/D/YY h:mm', '_(#,##0_);(#,##0)', '_(#,##0_);[Red](#,##0)', '_(#,##0.00_);(#,##0.00)', '_(#,##0.00_);[Red](#,##0.00)', '_("$"* #,##0_);_("$"* (#,##0);_("$"* "-"_);_(@_)', '_(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)', '_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)', '_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)', 'mm:ss', '[h]:mm:ss', 'mm:ss.0', '##0.0E+0', '@' ] i = 0 for fmt in fmts: ws.write(i, 0, fmt) style = XFStyle() style.num_format_str = fmt ws.write(i, 4, -1278.9078, style) i += 1 w.save('num_formats.xls') xlwt-1.3.0/examples/numbers_demo.py0000644000372000037200000000074613146751460020236 0ustar travistravis00000000000000#!/usr/bin/env python # -*- coding: windows-1251 -*- # Copyright (C) 2005 Kiseliov Roman from xlwt import * w = Workbook() ws = w.add_sheet('Hey, Dude') ws.write(0, 0, 1) ws.write(1, 0, 1.23) ws.write(2, 0, 12345678) ws.write(3, 0, 123456.78) ws.write(0, 1, -1) ws.write(1, 1, -1.23) ws.write(2, 1, -12345678) ws.write(3, 1, -123456.78) ws.write(0, 2, -17867868678687.0) ws.write(1, 2, -1.23e-5) ws.write(2, 2, -12345678.90780980) ws.write(3, 2, -123456.78) w.save('numbers.xls') xlwt-1.3.0/examples/outline.py0000644000372000037200000000550113146751460017230 0ustar travistravis00000000000000#!/usr/bin/env python # -*- coding: windows-1251 -*- # Copyright (C) 2005 Kiseliov Roman from xlwt import * fnt = Font() fnt.name = 'Arial' fnt.colour_index = 4 fnt.bold = True borders = Borders() borders.left = 6 borders.right = 6 borders.top = 6 borders.bottom = 6 style = XFStyle() style.font = fnt style.borders = borders wb = Workbook() ws0 = wb.add_sheet('Rows Outline') ws0.write_merge(1, 1, 1, 5, 'test 1', style) ws0.write_merge(2, 2, 1, 4, 'test 1', style) ws0.write_merge(3, 3, 1, 3, 'test 2', style) ws0.write_merge(4, 4, 1, 4, 'test 1', style) ws0.write_merge(5, 5, 1, 4, 'test 3', style) ws0.write_merge(6, 6, 1, 5, 'test 1', style) ws0.write_merge(7, 7, 1, 5, 'test 4', style) ws0.write_merge(8, 8, 1, 4, 'test 1', style) ws0.write_merge(9, 9, 1, 3, 'test 5', style) ws0.row(1).level = 1 ws0.row(2).level = 1 ws0.row(3).level = 2 ws0.row(4).level = 2 ws0.row(5).level = 2 ws0.row(6).level = 2 ws0.row(7).level = 2 ws0.row(8).level = 1 ws0.row(9).level = 1 ws1 = wb.add_sheet('Columns Outline') ws1.write_merge(1, 1, 1, 5, 'test 1', style) ws1.write_merge(2, 2, 1, 4, 'test 1', style) ws1.write_merge(3, 3, 1, 3, 'test 2', style) ws1.write_merge(4, 4, 1, 4, 'test 1', style) ws1.write_merge(5, 5, 1, 4, 'test 3', style) ws1.write_merge(6, 6, 1, 5, 'test 1', style) ws1.write_merge(7, 7, 1, 5, 'test 4', style) ws1.write_merge(8, 8, 1, 4, 'test 1', style) ws1.write_merge(9, 9, 1, 3, 'test 5', style) ws1.col(1).level = 1 ws1.col(2).level = 1 ws1.col(3).level = 2 ws1.col(4).level = 2 ws1.col(5).level = 2 ws1.col(6).level = 2 ws1.col(7).level = 2 ws1.col(8).level = 1 ws1.col(9).level = 1 ws2 = wb.add_sheet('Rows and Columns Outline') ws2.write_merge(1, 1, 1, 5, 'test 1', style) ws2.write_merge(2, 2, 1, 4, 'test 1', style) ws2.write_merge(3, 3, 1, 3, 'test 2', style) ws2.write_merge(4, 4, 1, 4, 'test 1', style) ws2.write_merge(5, 5, 1, 4, 'test 3', style) ws2.write_merge(6, 6, 1, 5, 'test 1', style) ws2.write_merge(7, 7, 1, 5, 'test 4', style) ws2.write_merge(8, 8, 1, 4, 'test 1', style) ws2.write_merge(9, 9, 1, 3, 'test 5', style) ws2.row(1).level = 1 ws2.row(2).level = 1 ws2.row(3).level = 2 ws2.row(4).level = 2 ws2.row(5).level = 2 ws2.row(6).level = 2 ws2.row(7).level = 2 ws2.row(8).level = 1 ws2.row(9).level = 1 ws2.write_merge(1, 1, 1, 5, 'test 1', style) ws2.write_merge(2, 2, 1, 4, 'test 1', style) ws2.write_merge(3, 3, 1, 3, 'test 2', style) ws2.write_merge(4, 4, 1, 4, 'test 1', style) ws2.write_merge(5, 5, 1, 4, 'test 3', style) ws2.write_merge(6, 6, 1, 5, 'test 1', style) ws2.write_merge(7, 7, 1, 5, 'test 4', style) ws2.write_merge(8, 8, 1, 4, 'test 1', style) ws2.write_merge(9, 9, 1, 3, 'test 5', style) ws2.col(1).level = 1 ws2.col(2).level = 1 ws2.col(3).level = 2 ws2.col(4).level = 2 ws2.col(5).level = 2 ws2.col(6).level = 2 ws2.col(7).level = 2 ws2.col(8).level = 1 ws2.col(9).level = 1 wb.save('outline.xls') xlwt-1.3.0/examples/panes.py0000644000372000037200000000216613146751460016663 0ustar travistravis00000000000000#!/usr/bin/env python # -*- coding: windows-1251 -*- # Copyright (C) 2005 Kiseliov Roman from xlwt import * w = Workbook() ws1 = w.add_sheet('sheet 1') ws2 = w.add_sheet('sheet 2') ws3 = w.add_sheet('sheet 3') ws4 = w.add_sheet('sheet 4') ws5 = w.add_sheet('sheet 5') ws6 = w.add_sheet('sheet 6') for i in range(0x100): ws1.write(i//0x10, i%0x10, i) for i in range(0x100): ws2.write(i//0x10, i%0x10, i) for i in range(0x100): ws3.write(i//0x10, i%0x10, i) for i in range(0x100): ws4.write(i//0x10, i%0x10, i) for i in range(0x100): ws5.write(i//0x10, i%0x10, i) for i in range(0x100): ws6.write(i//0x10, i%0x10, i) ws1.panes_frozen = True ws1.horz_split_pos = 2 ws2.panes_frozen = True ws2.vert_split_pos = 2 ws3.panes_frozen = True ws3.horz_split_pos = 1 ws3.vert_split_pos = 1 ws4.panes_frozen = False ws4.horz_split_pos = 12 ws4.horz_split_first_visible = 2 ws5.panes_frozen = False ws5.vert_split_pos = 40 ws4.vert_split_first_visible = 2 ws6.panes_frozen = False ws6.horz_split_pos = 12 ws4.horz_split_first_visible = 2 ws6.vert_split_pos = 40 ws4.vert_split_first_visible = 2 w.save('panes.xls') xlwt-1.3.0/examples/panes2.py0000644000372000037200000000244413146751460016744 0ustar travistravis00000000000000#!/usr/bin/env python # -*- coding: ascii -*- # portions Copyright (C) 2005 Kiseliov Roman import xlwt w = xlwt.Workbook() sheets = [w.add_sheet('sheet ' + str(sheetx+1)) for sheetx in range(7)] ws1, ws2, ws3, ws4, ws5, ws6, ws7 = sheets for sheet in sheets: for i in range(0x100): sheet.write(i // 0x10, i % 0x10, i) H = 1 V = 2 HF = H + 2 VF = V + 2 ws1.panes_frozen = True ws1.horz_split_pos = H ws1.horz_split_first_visible = HF ws2.panes_frozen = True ws2.vert_split_pos = V ws2.vert_split_first_visible = VF ws3.panes_frozen = True ws3.horz_split_pos = H ws3.vert_split_pos = V ws3.horz_split_first_visible = HF ws3.vert_split_first_visible = VF H = 10 V = 12 HF = H + 2 VF = V + 2 ws4.panes_frozen = False ws4.horz_split_pos = H * 12.75 # rows ws4.horz_split_first_visible = HF ws5.panes_frozen = False ws5.vert_split_pos = V * 8.43 # rows ws5.vert_split_first_visible = VF ws6.panes_frozen = False ws6.horz_split_pos = H * 12.75 # rows ws6.horz_split_first_visible = HF ws6.vert_split_pos = V * 8.43 # cols ws6.vert_split_first_visible = VF ws7.split_position_units_are_twips = True ws7.panes_frozen = False ws7.horz_split_pos = H * 250 + 240 # twips ws7.horz_split_first_visible = HF ws7.vert_split_pos = V * 955 + 410 # twips ws7.vert_split_first_visible = VF w.save('panes2.xls') xlwt-1.3.0/examples/panes3.py0000644000372000037200000000203013146751460016734 0ustar travistravis00000000000000from xlwt import Workbook from xlwt.BIFFRecords import PanesRecord w = Workbook() # do each of the 4 scenarios with each of the 4 possible # active pane settings for px,py in ( (0,0), # no split (0,10), # horizontal split (10,0), # vertical split (10,10), # both split ): for active in range(4): # 0 - logical bottom-right pane # 1 - logical top-right pane # 2 - logical bottom-left pane # 3 - logical top-left pane # only set valid values: if active not in PanesRecord.valid_active_pane.get( (int(px > 0),int(py > 0)) ): continue sheet = w.add_sheet('px-%i py-%i active-%i' %( px,py,active )) for rx in range(20): for cx in range(20): sheet.write(rx,cx,'R%iC%i'%(rx,cx)) sheet.panes_frozen = False sheet.vert_split_pos = px * 8.43 sheet.horz_split_pos = py * 12.75 sheet.active_pane = active w.save('panes3.xls') xlwt-1.3.0/examples/parse-fmla.py0000644000372000037200000000055713146751460017606 0ustar travistravis00000000000000from xlwt import ExcelFormulaParser, ExcelFormula import sys f = ExcelFormula.Formula( """ -((1.80 + 2.898 * 1)/(1.80 + 2.898))* AVERAGE((1.80 + 2.898 * 1)/(1.80 + 2.898); (1.80 + 2.898 * 1)/(1.80 + 2.898); (1.80 + 2.898 * 1)/(1.80 + 2.898)) + SIN(PI()/4)""") #for t in f.rpn(): # print "%15s %15s" % (ExcelFormulaParser.PtgNames[t[0]], t[1]) xlwt-1.3.0/examples/pattern_examples.xls0000644000372000037200000005200013146751460021276 0ustar travistravis00000000000000ÐÏࡱá>þÿ (þÿÿÿþÿÿÿ'ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ - ÍÙÀá°Áâ\p John Machin B°aÀ=œ¯¼=àZx