├── .gitignore ├── LICENSE ├── Makefile ├── README.rst ├── setup.py └── xlsx └── __init__.py /.gitignore: -------------------------------------------------------------------------------- 1 | /.coverage 2 | /dist/ 3 | /docs/.build/ 4 | /*.egg-info 5 | *.pyc 6 | _scratch/ 7 | Session.vim 8 | /setuptools-* 9 | /.tox 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright © 2013 Steve Canny, https://github.com/scanny 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the “Software”), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | PYTHON = python 2 | BEHAVE = behave 3 | SETUP = $(PYTHON) ./setup.py 4 | 5 | .PHONY: accept clean coverage readme register sdist test upload 6 | 7 | help: 8 | @echo "Please use \`make ' where is one or more of" 9 | @echo " accept run acceptance tests using behave" 10 | @echo " clean delete intermediate work product and start fresh" 11 | @echo " coverage run nosetests with coverage" 12 | @echo " readme update README.html from README.rst" 13 | @echo " register update metadata (README.rst) on PyPI" 14 | @echo " sdist generate a source distribution into dist/" 15 | @echo " upload upload distribution tarball to PyPI" 16 | 17 | accept: 18 | $(BEHAVE) --stop 19 | 20 | clean: 21 | find . -type f -name \*.pyc -exec rm {} \; 22 | rm -rf dist *.egg-info .coverage .DS_Store 23 | 24 | coverage: 25 | py.test --cov-report term-missing --cov=docx tests/ 26 | 27 | readme: 28 | rst2html README.rst >README.html 29 | open README.html 30 | 31 | register: 32 | $(SETUP) register 33 | 34 | sdist: 35 | $(SETUP) sdist 36 | 37 | upload: 38 | $(SETUP) sdist upload 39 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | *python-xlsx* is a library for creating and modifying Microsoft Excel .xlsx 2 | files from Office 2007 and later. 3 | 4 | *python-xlsx* is a companion library to *python-pptx* and *python-docx*, which 5 | together allow manipulation of Microsoft Office files using Python. 6 | 7 | *python-xlsx* is currently in the planning stage; a first release is expected 8 | in 2014. 9 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import re 5 | 6 | # from ez_setup import use_setuptools 7 | # use_setuptools() 8 | 9 | from setuptools import setup 10 | 11 | MAIN_PKG = 'xlsx' 12 | 13 | thisdir = os.path.dirname(__file__) 14 | 15 | # history_path = os.path.join(thisdir, 'HISTORY.rst') 16 | init_py_path = os.path.join(thisdir, MAIN_PKG, '__init__.py') 17 | license_path = os.path.join(thisdir, 'LICENSE') 18 | readme_path = os.path.join(thisdir, 'README.rst') 19 | 20 | # with open(history_path) as f: 21 | # history = f.read() 22 | with open(license_path) as f: 23 | license = f.read() 24 | with open(readme_path) as f: 25 | readme = f.read() 26 | with open(init_py_path) as f: 27 | version = re.search("__version__ = '([^']+)'", f.read()).group(1) 28 | 29 | NAME = 'python-xlsx' 30 | VERSION = version 31 | DESCRIPTION = ( 32 | 'Create and modify Excel .xlsx files' 33 | ) 34 | 35 | # LONG_DESCRIPTION = '%s\n\n%s' % (readme, history) 36 | LONG_DESCRIPTION = '%s' % (readme) 37 | 38 | KEYWORDS = 'excel open xml xslx office' 39 | AUTHOR = 'Steve Canny' 40 | AUTHOR_EMAIL = 'python-opc@googlegroups.com' 41 | URL = 'https://github.com/python-openxml/python-xlsx' 42 | LICENSE = license 43 | 44 | # MODULES = ['ez_setup'] 45 | PACKAGES = ['xlsx'] 46 | 47 | # ENTRY_POINTS = { 48 | # 'console_scripts': [ 49 | # 'opc = opcdiag.cli:main' 50 | # ] 51 | # } 52 | 53 | INSTALL_REQUIRES = [ 54 | 'lxml >= 3.0', 55 | ] 56 | 57 | TEST_SUITE = 'tests' 58 | TESTS_REQUIRE = [ 59 | 'behave >= 1.2.3', 60 | 'mock >= 1.0.1', 61 | 'pytest >= 2.3.4' 62 | ] 63 | 64 | CLASSIFIERS = [ 65 | 'Development Status :: 1 - Planning', 66 | 'Environment :: Console', 67 | 'Intended Audience :: Developers', 68 | 'License :: OSI Approved :: MIT License', 69 | 'Operating System :: OS Independent', 70 | 'Programming Language :: Python', 71 | 'Programming Language :: Python :: 2', 72 | 'Programming Language :: Python :: 2.6', 73 | 'Programming Language :: Python :: 2.7', 74 | 'Programming Language :: Python :: 3', 75 | 'Programming Language :: Python :: 3.2', 76 | 'Programming Language :: Python :: 3.3', 77 | 'Topic :: Office/Business :: Office Suites', 78 | 'Topic :: Software Development :: Libraries' 79 | ] 80 | 81 | params = { 82 | 'name': NAME, 83 | 'version': VERSION, 84 | 'description': DESCRIPTION, 85 | 'keywords': KEYWORDS, 86 | 'long_description': LONG_DESCRIPTION, 87 | 'author': AUTHOR, 88 | 'author_email': AUTHOR_EMAIL, 89 | 'url': URL, 90 | 'license': LICENSE, 91 | 'packages': PACKAGES, 92 | # 'py_modules': MODULES, 93 | # 'entry_points': ENTRY_POINTS, 94 | 'install_requires': INSTALL_REQUIRES, 95 | 'tests_require': TESTS_REQUIRE, 96 | 'test_suite': TEST_SUITE, 97 | 'classifiers': CLASSIFIERS, 98 | } 99 | 100 | setup(**params) 101 | -------------------------------------------------------------------------------- /xlsx/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | __version__ = '0.1.0dev1' # pragma: no cover 4 | --------------------------------------------------------------------------------