Replace applymoban.py with Yaml configuration
Add Change log.
This commit is contained in:
parent
31a34d1a7a
commit
9c0a54d0bd
|
@ -1,5 +1,10 @@
|
|||
{% extends "travis.yml.jj2" %}
|
||||
|
||||
{%block test_other_python_versions%} - 2.6
|
||||
{%block custom_python_versions%}
|
||||
python:
|
||||
- 2.6
|
||||
- 2.7
|
||||
{%endblock%}
|
||||
|
||||
{% block custom_install %} - rm README.rst; touch README.rst # fails
|
||||
{%endblock%}
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
configuration:
|
||||
configuration_dir: "commons/config"
|
||||
template_dir:
|
||||
- "commons/templates"
|
||||
- ".moban.d"
|
||||
configuration: pyexcel_ods.yaml
|
||||
targets:
|
||||
- README.rst: README.rst
|
||||
- setup.py: setup.py
|
||||
- "docs/source/conf.py": "docs/source/conf.py.jj2"
|
||||
- .travis.yml: travis.yml
|
||||
- requirements.txt: requirements.txt
|
||||
- LICENSE: LICENSE.jj2
|
||||
- MANIFEST.in: MANIFEST.in.jj2
|
||||
- "tests/requirements.txt": "tests/requirements.txt"
|
||||
- test.sh: test.sh.jj2
|
||||
- test.bat: test.sh.jj2
|
12
.travis.yml
12
.travis.yml
|
@ -2,16 +2,14 @@ sudo: false
|
|||
language: python
|
||||
notifications:
|
||||
email: false
|
||||
env:
|
||||
global:
|
||||
python:
|
||||
- 2.7
|
||||
- 2.6
|
||||
install:
|
||||
- rm applymoban.py
|
||||
- pip install -r requirements.txt
|
||||
- 2.7
|
||||
before_install:
|
||||
- rm README.rst; touch README.rst # fails
|
||||
- if [[ -f rnd_requirements.txt ]]; then pip install -r rnd_requirements.txt; fi
|
||||
- pip install -r tests/requirements.txt
|
||||
script:
|
||||
make test
|
||||
after_success:
|
||||
codecov
|
||||
codecov
|
||||
|
|
|
@ -0,0 +1,101 @@
|
|||
Change log
|
||||
================================================================================
|
||||
|
||||
|
||||
0.1.1 - 30.01.2016
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Added
|
||||
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
#. 'streaming' is an extra option given to get_data. Only when 'streaming'
|
||||
is explicitly set to True, the data will be consisted of generators,
|
||||
hence will break your existing code.
|
||||
#. uses yield in to_array and returns a generator
|
||||
#. support multi-line text cell #5
|
||||
#. feature migration from pyexcel-ods3 pyexcel/pyexcel-ods3#5
|
||||
|
||||
Updated
|
||||
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
#. compatibility with pyexcel-io 0.1.1
|
||||
|
||||
|
||||
0.0.12 - 10.10.2015
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Updated
|
||||
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
#. Bug fix: excessive trailing columns with empty values
|
||||
|
||||
|
||||
0.0.11 - 26.09.2015
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Updated
|
||||
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
#. Complete fix for libreoffice datetime field
|
||||
|
||||
|
||||
0.0.10 - 15.09.2015
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Updated
|
||||
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
#. Bug fix: date field could have datetime from libreoffice
|
||||
|
||||
|
||||
0.0.9 - 21.08.2015
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Updated
|
||||
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
#. Bug fix: utf-8 string throw unicode exceptions
|
||||
|
||||
|
||||
0.0.8 - 28.06.2015
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Updated
|
||||
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
#. Pin dependency odfpy 0.9.6 to avoid buggy odfpy 1.3.0
|
||||
|
||||
|
||||
0.0.7 - 28.05.2015
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Updated
|
||||
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
#. Bug fix: "number-columns-repeated" is now respected
|
||||
|
||||
|
||||
0.0.6 - 21.05.2015
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Updated
|
||||
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
#. get_data and save_data are seen across pyexcel-* extensions. remember them
|
||||
once and use them across all extensions.
|
||||
|
||||
|
||||
0.0.5 - 22.02.2015
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Added
|
||||
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
#. Loads only one sheet from a multiple sheet book
|
||||
#. Use New BSD License
|
||||
|
||||
|
||||
0.0.4 - 14.12.2014
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Updated
|
||||
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
#. IO interface update as pyexcel-io introduced keywords.
|
||||
|
||||
|
||||
0.0.3 - 08.12.2014
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
#. initial release
|
|
@ -1 +1,2 @@
|
|||
include README.rst
|
||||
include CHANGELOG.rst
|
||||
|
|
58
README.rst
58
README.rst
|
@ -17,7 +17,7 @@ does the same thing but supports Python 3.3 and 3.4 and depends on lxml.
|
|||
Known constraints
|
||||
==================
|
||||
|
||||
Fonts, colors and charts are not supported.
|
||||
Fonts, colors and charts are not supported.
|
||||
|
||||
Installation
|
||||
================================================================================
|
||||
|
@ -62,7 +62,11 @@ Write to an ods file
|
|||
... from StringIO import StringIO
|
||||
... else:
|
||||
... from io import BytesIO as StringIO
|
||||
>>> from pyexcel_io import OrderedDict
|
||||
>>> PY2 = sys.version_info[0] == 2
|
||||
>>> if PY2 and sys.version_info[1] < 7:
|
||||
... from ordereddict import OrderedDict
|
||||
... else:
|
||||
... from collections import OrderedDict
|
||||
|
||||
|
||||
Here's the sample code to write a dictionary to an ods file:
|
||||
|
@ -125,6 +129,12 @@ Continue from previous example:
|
|||
As a pyexcel plugin
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
No longer, explicit import is needed since pyexcel version 0.2.2. Instead,
|
||||
this library is auto-loaded. So if you want to read data in ods format,
|
||||
installing it is enough.
|
||||
|
||||
Any version under pyexcel 0.2.2, you have to keep doing the following:
|
||||
|
||||
Import it in your file to enable this plugin:
|
||||
|
||||
.. code-block:: python
|
||||
|
@ -141,16 +151,16 @@ Here is the sample code:
|
|||
.. code-block:: python
|
||||
|
||||
>>> import pyexcel as pe
|
||||
>>> from pyexcel.ext import ods
|
||||
>>> # from pyexcel.ext import ods
|
||||
>>> sheet = pe.get_book(file_name="your_file.ods")
|
||||
>>> sheet
|
||||
Sheet Name: Sheet 1
|
||||
Sheet 1:
|
||||
+---+---+---+
|
||||
| 1 | 2 | 3 |
|
||||
+---+---+---+
|
||||
| 4 | 5 | 6 |
|
||||
+---+---+---+
|
||||
Sheet Name: Sheet 2
|
||||
Sheet 2:
|
||||
+-------+-------+-------+
|
||||
| row 1 | row 2 | row 3 |
|
||||
+-------+-------+-------+
|
||||
|
@ -180,13 +190,13 @@ You got to wrap the binary content with stream to get ods working:
|
|||
... r = pe.get_book(file_type="ods", file_content=content)
|
||||
... print(r)
|
||||
...
|
||||
Sheet Name: Sheet 1
|
||||
Sheet 1:
|
||||
+---+---+---+
|
||||
| 1 | 2 | 3 |
|
||||
+---+---+---+
|
||||
| 4 | 5 | 6 |
|
||||
+---+---+---+
|
||||
Sheet Name: Sheet 2
|
||||
Sheet 2:
|
||||
+-------+-------+-------+
|
||||
| row 1 | row 2 | row 3 |
|
||||
+-------+-------+-------+
|
||||
|
@ -215,6 +225,38 @@ License
|
|||
|
||||
New BSD License
|
||||
|
||||
Developer guide
|
||||
==================
|
||||
|
||||
Development steps for code changes
|
||||
|
||||
#. git clone https://github.com/pyexcel/pyexcel-ods.git
|
||||
#. cd pyexcel-ods
|
||||
#. pip install -r requirements.txt
|
||||
#. pip install -r tests/requirements.txt
|
||||
|
||||
|
||||
In order to update test envrionment, and documentation, additional setps are
|
||||
required:
|
||||
|
||||
#. pip install moban
|
||||
#. git clone https://github.com/pyexcel/pyexcel-commons.git
|
||||
#. make your changes in `.moban.d` directory, then issue command `moban`
|
||||
|
||||
|
||||
How to test your contribution
|
||||
------------------------------
|
||||
|
||||
Although `nose` and `doctest` are both used in code testing, it is adviable that unit tests are put in tests. `doctest` is incorporated only to make sure the code examples in documentation remain valid across different development releases.
|
||||
|
||||
On Linux/Unix systems, please launch your tests like this::
|
||||
|
||||
$ make test
|
||||
|
||||
On Windows systems, please issue this command::
|
||||
|
||||
> test.bat
|
||||
|
||||
Credits
|
||||
================================================================================
|
||||
|
||||
|
@ -225,4 +267,4 @@ ODSReader is originally written by `Marco Conti <https://github.com/marcoconti83
|
|||
|
||||
>>> import os
|
||||
>>> os.unlink("your_file.ods")
|
||||
>>> os.unlink("another_file.ods")
|
||||
>>> os.unlink("another_file.ods")
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
from os import path, system
|
||||
|
||||
config_dir = 'commons/config'
|
||||
template_dir = 'commons/templates'
|
||||
|
||||
if not path.exists("commons"):
|
||||
system("git clone https://github.com/pyexcel/pyexcel-commons.git commons")
|
||||
system("moban -cd {0} -td {1} -t docs/source/conf.py.jj2 -o docs/source/conf.py -c moban.yaml".format(config_dir, template_dir))
|
||||
system("moban -cd {0} -td {1} .moban.d -t README.rst -o README.rst -c moban.yaml".format(config_dir, template_dir))
|
||||
system("moban -cd {0} -td {1} .moban.d -t setup.py -o setup.py -c moban.yaml".format(config_dir, template_dir))
|
||||
system("moban -cd {0} -td {1} .moban.d -t travis.yml -o .travis.yml -c moban.yaml".format(config_dir, template_dir))
|
||||
system("moban -cd {0} -td .moban.d -t requirements.txt -o requirements.txt -c moban.yaml".format(config_dir))
|
||||
system("moban -cd {0} -td {1} -t LICENSE.jj2 -o LICENSE -c moban.yaml".format(config_dir, template_dir))
|
||||
system("moban -cd {0} -td {1} .moban.d -t tests/requirements.txt -o tests/requirements.txt -c moban.yaml".format(config_dir, template_dir))
|
||||
system("moban -cd {0} -td {1} .moban.d -t MANIFEST.in.jj2 -o MANIFEST.in -c moban.yaml".format(config_dir, template_dir))
|
|
@ -248,4 +248,4 @@ texinfo_documents = [
|
|||
#texinfo_show_urls = 'footnote'
|
||||
|
||||
# If true, do not generate a @detailmenu in the "Top" node's menu.
|
||||
#texinfo_no_detailmenu = False
|
||||
#texinfo_no_detailmenu = False
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
overrides: "pyexcel.yaml"
|
||||
name: "pyexcel-ods"
|
||||
nick_name: ods
|
||||
version: 0.1.1
|
||||
file_type: ods
|
||||
dependencies:
|
||||
- pyexcel-io>=0.1.0
|
||||
- odfpy==0.9.6
|
||||
description: A wrapper library to read, manipulate and write data in ods format
|
91
setup.py
91
setup.py
|
@ -5,45 +5,68 @@ except ImportError:
|
|||
use_setuptools()
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
with open("README.rst", 'r') as readme:
|
||||
README_txt = readme.read()
|
||||
NAME = 'pyexcel-ods'
|
||||
AUTHOR = 'C.W.'
|
||||
VERSION = '0.1.1'
|
||||
EMAIL = 'wangc_2011 (at) hotmail.com'
|
||||
LICENSE = 'New BSD'
|
||||
PACKAGES = find_packages(exclude=['ez_setup', 'examples', 'tests'])
|
||||
DESCRIPTION = 'A wrapper library to read, manipulate and write data in ods format'
|
||||
KEYWORDS = [
|
||||
'excel',
|
||||
'python',
|
||||
'pyexcel',
|
||||
]
|
||||
|
||||
dependencies = [
|
||||
INSTALL_REQUIRES = [
|
||||
'pyexcel-io>=0.1.0',
|
||||
'odfpy==0.9.6',
|
||||
]
|
||||
|
||||
extras = {}
|
||||
EXTRAS_REQUIRE = {
|
||||
}
|
||||
|
||||
|
||||
setup(
|
||||
name='pyexcel-ods',
|
||||
author='C. W.',
|
||||
version='0.1.1',
|
||||
author_email='wangc_2011 (at) hotmail.com',
|
||||
url='https://github.com/pyexcel/pyexcel-ods',
|
||||
description='A wrapper library to read, manipulate and write data in ods format',
|
||||
install_requires=dependencies,
|
||||
extras_require=extras,
|
||||
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
|
||||
include_package_data=True,
|
||||
long_description=README_txt,
|
||||
zip_safe=False,
|
||||
tests_require=['nose'],
|
||||
keywords=[
|
||||
'excel',
|
||||
'python',
|
||||
'pyexcel',
|
||||
],
|
||||
license='New BSD',
|
||||
classifiers=[
|
||||
'Topic :: Office/Business',
|
||||
'Topic :: Utilities',
|
||||
'Topic :: Software Development :: Libraries',
|
||||
'Programming Language :: Python',
|
||||
'License :: OSI Approved :: BSD License',
|
||||
'Intended Audience :: Developers',
|
||||
CLASSIFIERS = [
|
||||
'Topic :: Office/Business',
|
||||
'Topic :: Utilities',
|
||||
'Topic :: Software Development :: Libraries',
|
||||
'Programming Language :: Python',
|
||||
'License :: OSI Approved :: BSD License',
|
||||
'Intended Audience :: Developers',
|
||||
'Programming Language :: Python :: 2.6',
|
||||
'Programming Language :: Python :: 2.7'
|
||||
]
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
def read_files(*files):
|
||||
"""Read files into setup"""
|
||||
text = ""
|
||||
for single_file in files:
|
||||
text = text + read(single_file) + "\n"
|
||||
return text
|
||||
|
||||
|
||||
def read(afile):
|
||||
"""Read a file into setup"""
|
||||
with open(afile, 'r') as opened_file:
|
||||
return opened_file.read()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
setup(
|
||||
name=NAME,
|
||||
author=AUTHOR,
|
||||
version=VERSION,
|
||||
author_email=EMAIL,
|
||||
description=DESCRIPTION,
|
||||
install_requires=INSTALL_REQUIRES,
|
||||
keywords=KEYWORDS,
|
||||
extras_require=EXTRAS_REQUIRE,
|
||||
packages=PACKAGES,
|
||||
include_package_data=True,
|
||||
long_description=read_files('README.rst', 'CHANGELOG.rst'),
|
||||
zip_safe=False,
|
||||
tests_require=['nose'],
|
||||
license=LICENSE,
|
||||
classifiers=CLASSIFIERS
|
||||
)
|
||||
|
|
3
test.bat
3
test.bat
|
@ -1 +1,2 @@
|
|||
nosetests --with-cov --with-doctest --doctest-extension=.rst -I applymoban.py -I setup.py
|
||||
pip freeze
|
||||
nosetests --with-cov --cov pyexcel_ods --cov tests --with-doctest --doctest-extension=.rst tests README.rst pyexcel_ods
|
||||
|
|
3
test.sh
3
test.sh
|
@ -1 +1,2 @@
|
|||
nosetests --rednose --with-cov --cov pyexcel_ods --cov tests --with-doctest --doctest-extension=.rst
|
||||
pip freeze
|
||||
nosetests --with-cov --cov pyexcel_ods --cov tests --with-doctest --doctest-extension=.rst tests README.rst pyexcel_ods
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
nose
|
||||
rednose
|
||||
nose-cov
|
||||
codecov
|
||||
coverage
|
||||
|
|
Loading…
Reference in New Issue